summaryrefslogtreecommitdiffstats
path: root/debian/systemd-homed.postinst
blob: 0be578fb45efd21470522a15347ace932a0a7d7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

set -e

# pam-auth-update makes wrong assumptions and doesn't allow no-op modules, so
# we need to remove 'use_authtok try_first_pass' after it runs
_fixup_common_password() {
    sed -i "s/pam_unix.so obscure use_authtok try_first_pass/pam_unix.so obscure/g" /etc/pam.d/common-password || true
}

if [ "$1" = "triggered" ]; then
    shift
    for trigger in $@; do
        case $trigger in
            /usr/share/pam-configs)
                _fixup_common_password
                ;;
        esac
    done
    exit 0
fi

pam-auth-update --package --enable systemd-homed
_fixup_common_password

#DEBHELPER#