Skip to content

Commit

Permalink
debian: Also insert authd as NSS source on reinstall (#461)
Browse files Browse the repository at this point in the history
debian: Also insert authd as NSS source on reinstall

The debian/postrm script removes authd as a source from
/etc/nsswitch.conf, but the debian/postinst script only added it when
the package was installed for the fist time. That led to NSS not using
authd as a source when the package was reinstalled.

We now ensure that authd is always added as a source to the `passwd`,
`group` and `shadow` databases in /etc/nsswitch.conf when the authd
package is installed.

That's done by always calling `insert_nss_entry` on install, which is
already implemented so that it only adds the `authd` string to those
`passwd|group|shadow` lines in /etc/nsswitch.conf which don't already
contain it, so we can just always call that function on install.

UDENG-3906
  • Loading branch information
adombeck authored Aug 15, 2024
2 parents dcabc30 + 81fef54 commit 4883232
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,5 @@ action="$1"

if [ configure = "$action" ]; then
pam-auth-update --package

if [ -z "$2" ]; then
log "First installation detected..."
# first install: setup the recommended configuration (unless
# nsswitch.conf already contains authd entries)
insert_nss_entry
fi
insert_nss_entry
fi

0 comments on commit 4883232

Please sign in to comment.