libsmb: Use clistr_smb2_extract_snapshot_token() in cli_smb2_create_fnum_send()
[Samba.git] / source3 / script / tests / test_sacl_set_get.sh
blob3d36f57d2e288b24b2bfa0c328ac8cfa2d234f40
1 #!/bin/sh
3 # Runs the smbtorture3 SMB2-SACL test
4 # that requres SeSecurityPrivilege
5 # against Samba.
8 if [ $# -lt 7 ]; then
9 echo "Usage: $0 SERVER SERVER_IP USERNAME PASSWORD SMBTORTURE3 NET SHARE"
10 exit 1
13 SERVER="$1"
14 SERVER_IP="$2"
15 USERNAME="$3"
16 PASSWORD="$4"
17 SMBTORTURE3="$5"
18 NET="$6"
19 SHARE="$7"
21 failed=0
23 incdir=$(dirname $0)/../../../testprogs/blackbox
24 . $incdir/subunit.sh
26 sacl_set_get()
28 out=$($SMBTORTURE3 //$SERVER_IP/$SHARE -U $USERNAME%$PASSWORD SMB2-SACL)
29 if [ $? -ne 0 ]; then
30 echo "SMB2-SACL failed"
31 echo "$out"
32 return 1
36 # Grant SeSecurityPrivilege to the user
37 testit "grant SeSecurityPrivilege" $NET rpc rights grant $USERNAME SeSecurityPrivilege -U $USERNAME%$PASSWORD -I $SERVER_IP || failed=$(expr $failed + 1)
39 # Run the tests.
40 testit "SACL set_get" sacl_set_get || failed=$(expr $failed + 1)
42 # Revoke SeSecurityPrivilege
43 testit "revoke SeSecurityPrivilege" $NET rpc rights revoke $USERNAME SeSecurityPrivilege -U $USERNAME%$PASSWORD -I $SERVER_IP || failed=$(expr $failed + 1)
45 exit $failed