Debian Codegraph @

tests/usertools/chpasswd-PAM/22_chpasswd_password_SHA512/chpasswd.test

raw
1 #!/bin/sh
2
3 set -e
4
5 cd $(dirname $0)
6
7 . ../../../common/config.sh
8 . ../../../common/log.sh
9
10 log_start "$0" "chpasswd can use create SHA512 passwords"
11
12 save_config
13
14 # restore the files on exit
15 trap 'log_status "$0" "FAILURE"; restore_config' 0
16
17 change_config
18
19 echo -n "Change nobody and lp's password (chpasswd --crypt-method SHA512)..."
20 echo 'nobody:test
21 lp:test2' | chpasswd --crypt-method SHA512
22 echo "OK"
23
24 echo -n "Check the passwd file..."
25 ../../../common/compare_file.pl config/etc/passwd /etc/passwd
26 echo "OK"
27 echo -n "Check the group file..."
28 ../../../common/compare_file.pl config/etc/group /etc/group
29 echo "OK"
30 echo -n "Check the shadow file..."
31 ../../../common/compare_file.pl data/shadow /etc/shadow
32 echo "OK"
33 echo -n "Check the gshadow file..."
34 ../../../common/compare_file.pl config/etc/gshadow /etc/gshadow
35 echo "OK"
36
37 log_status "$0" "SUCCESS"
38 restore_config
39 trap '' 0
40