mirror of
https://github.com/samba-team/samba.git
synced 2025-02-28 01:58:17 +03:00
s3:tests: Reformat test_smb1_system_security.sh
shfmt -f source3/script/| xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
parent
d637255f6b
commit
13795515eb
@ -5,8 +5,8 @@
|
||||
#
|
||||
|
||||
if [ $# -lt 7 ]; then
|
||||
echo "Usage: $0 SERVER SERVER_IP USERNAME PASSWORD SMBTORTURE3 NET SHARE"
|
||||
exit 1
|
||||
echo "Usage: $0 SERVER SERVER_IP USERNAME PASSWORD SMBTORTURE3 NET SHARE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SERVER="$1"
|
||||
@ -19,25 +19,26 @@ SHARE="$7"
|
||||
|
||||
failed=0
|
||||
|
||||
incdir=`dirname $0`/../../../testprogs/blackbox
|
||||
incdir=$(dirname $0)/../../../testprogs/blackbox
|
||||
. $incdir/subunit.sh
|
||||
|
||||
smb1_system_security() {
|
||||
out=$($SMBTORTURE3 //$SERVER_IP/$SHARE -U $USERNAME%$PASSWORD -mNT1 SMB1-SYSTEM-SECURITY)
|
||||
if [ $? -ne 0 ] ; then
|
||||
echo "SMB1-SYSTEM-SECURITY failed"
|
||||
echo "$out"
|
||||
return 1
|
||||
fi
|
||||
smb1_system_security()
|
||||
{
|
||||
out=$($SMBTORTURE3 //$SERVER_IP/$SHARE -U $USERNAME%$PASSWORD -mNT1 SMB1-SYSTEM-SECURITY)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "SMB1-SYSTEM-SECURITY failed"
|
||||
echo "$out"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Grant SeSecurityPrivilege to the user
|
||||
testit "grant SeSecurityPrivilege" $NET rpc rights grant $USERNAME SeSecurityPrivilege -U $USERNAME%$PASSWORD -I $SERVER_IP || failed=`expr $failed + 1`
|
||||
testit "grant SeSecurityPrivilege" $NET rpc rights grant $USERNAME SeSecurityPrivilege -U $USERNAME%$PASSWORD -I $SERVER_IP || failed=$(expr $failed + 1)
|
||||
|
||||
# Run the test.
|
||||
testit "smb1-system-security" smb1_system_security || failed=`expr $failed + 1`
|
||||
testit "smb1-system-security" smb1_system_security || failed=$(expr $failed + 1)
|
||||
|
||||
# Revoke SeSecurityPrivilege
|
||||
testit "revoke SeSecurityPrivilege" $NET rpc rights revoke $USERNAME SeSecurityPrivilege -U $USERNAME%$PASSWORD -I $SERVER_IP || failed=`expr $failed + 1`
|
||||
testit "revoke SeSecurityPrivilege" $NET rpc rights revoke $USERNAME SeSecurityPrivilege -U $USERNAME%$PASSWORD -I $SERVER_IP || failed=$(expr $failed + 1)
|
||||
|
||||
exit $failed
|
||||
|
Loading…
x
Reference in New Issue
Block a user