3 # this tests acl_xattr config parameter "ignore system acl"
7 Usage: $0 SERVER USERNAME PASSWORD PREFIX SMBCLIENT SMBCACLS
18 SMBCLIENT="$VALGRIND ${SMBCLIENT}"
19 SMBCACLS="$VALGRIND ${SMBCACLS}"
21 incdir=`dirname $0`/../../../testprogs/blackbox
26 local fname="$share.$$"
27 local local_fname=$PREFIX/$fname
29 $SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "rm $fname"
30 $SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "ls" | grep "$fname" && exit 1
31 $SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "lcd $PREFIX; put $fname" || exit 1
39 local fname="$share.$$"
40 b4=$($SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "getfacl $fname" 2>/dev/null) || exit 1
41 $SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD -a "ACL:$SERVER\force_user:ALLOWED/0x0/READ" 2>/dev/null || exit 1
42 af=$($SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "getfacl $fname" 2>/dev/null) || exit 1
45 if test "$expected" = "true" ; then
58 local fname="$share.$$"
60 echo -n "determining uid of $USERNAME..."
61 b4_expected=$(getent passwd $USERNAME) || exit 1
62 b4_expected=$(echo "$b4_expected" | awk -F: '{print $3}')
65 echo -n "determining uid of force_user..."
66 af_expected=$(getent passwd force_user) || exit 1
67 af_expected=$(echo "$af_expected" | awk -F: '{print $3}')
71 test "$b4_expected != $af_expected" || exit 1
73 b4_actual=$($SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "getfacl $fname" 2>/dev/null) || exit 1
74 b4_actual=$(echo "$b4_actual" | sed -rn 's/^# owner: (.*)/\1/p')
75 $SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD -C force_user 2>/dev/null || exit 1
76 af_actual=$($SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "getfacl $fname" 2>/dev/null) || exit 1
77 af_actual=$(echo "$af_actual" | sed -rn 's/^# owner: (.*)/\1/p')
78 echo "before: $b4_actual"
79 echo "after: $af_actual"
80 test "$b4_expected" = "$b4_actual" && test "$af_expected" = "$af_actual"
89 local fname="$share.$$"
91 echo -n "determining gid of domusers..."
92 b4_expected=$(getent group domusers) || exit 1
93 b4_expected=$(echo "$b4_expected" | awk -F: '{print $3}')
96 echo -n "determining uid of domadmins..."
97 af_expected=$(getent passwd domadmins) || exit 1
98 af_expected=$(echo "$af_expected" | awk -F: '{print $3}')
102 test "$b4_expected != $af_expected" || exit 1
104 b4_actual=$($SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "getfacl $fname" 2>/dev/null) || exit 1
105 b4_actual=$(echo "$b4_actual" | sed -rn 's/^# group: (.*)/\1/p')
106 $SMBCACLS //$SERVER/$share $fname -U $USERNAME%$PASSWORD -G domadmins 2>/dev/null || exit 1
107 af_actual=$($SMBCLIENT //$SERVER/$share -U $USERNAME%$PASSWORD -c "getfacl $fname" 2>/dev/null) || exit 1
108 af_actual=$(echo "$af_actual" | sed -rn 's/^# group: (.*)/\1/p')
109 echo "before: $b4_actual"
110 echo "after: $af_actual"
111 test "$b4_expected" = "$b4_actual" && test "$af_expected" = "$af_actual"
114 testit "setup remote file tmp" setup_remote_file tmp
115 testit "setup remote file ign_sysacls" setup_remote_file ign_sysacls
116 testit "nt_affects_posix tmp" nt_affects_posix tmp "true"
117 testit "nt_affects_posix ign_sysacls" nt_affects_posix ign_sysacls "false"
118 testit "setup remote file tmp" setup_remote_file tmp
119 testit "setup remote file ign_sysacls" setup_remote_file ign_sysacls
120 testit "nt_affects_chown tmp" nt_affects_chown tmp
121 testit "nt_affects_chown ign_sysacls" nt_affects_chown ign_sysacls
122 testit "setup remote file tmp" setup_remote_file tmp
123 testit "setup remote file ign_sysacls" setup_remote_file ign_sysacls
124 testit "nt_affects_chgrp tmp" nt_affects_chown tmp
125 testit "nt_affects_chgrp ign_sysacls" nt_affects_chown ign_sysacls