| 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 encrypted password" |
| 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 -e)..." |
| 20 |
echo 'nobody:test |
| 21 |
lp:test2' | chpasswd -e |
| 22 |
echo "OK" |
| 23 |
|
| 24 |
echo -n "Check the passwd file..." |
| 25 |
../../../common/compare_file.pl data/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 |
|