Debian Codegraph @

tests/grouptools/groupmems/48_groupmems_user_add_user-gshadow_locked/groupmems.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" "groupmems (-a) fails if the gshadow file is locked"
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 "Create lock file for /etc/gshadow..."
20 touch /etc/gshadow.lock
21 echo "done"
22
23 echo -n "myuser will call groupmems..."
24 ./run_groupmems.exp
25 echo "OK"
26
27 rm -f /etc/gshadow.lock
28
29 echo -n "Check the passwd file..."
30 ../../../common/compare_file.pl config/etc/passwd /etc/passwd
31 echo "OK"
32 echo -n "Check the group file..."
33 ../../../common/compare_file.pl config/etc/group /etc/group
34 echo "OK"
35 echo -n "Check the shadow file..."
36 ../../../common/compare_file.pl config/etc/shadow /etc/shadow
37 echo "OK"
38 echo -n "Check the gshadow file..."
39 ../../../common/compare_file.pl config/etc/gshadow /etc/gshadow
40 echo "OK"
41
42 log_status "$0" "SUCCESS"
43 restore_config
44 trap '' 0
45