From 59e9661de2dd19808295002f1329b27d5dca09e6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 29 Oct 2012 14:49:36 -0700 Subject: Add regression test for bug #9329 - Directory listing with SeBackup can crash smbd. Ensure we exercise the SeBackup code path on directory listings. Signed-off-by: Jeremy Allison Reviewed-by: Michael Adam Autobuild-User(master): Michael Adam Autobuild-Date(master): Wed Oct 31 03:21:38 CET 2012 on sn-devel-104 --- source3/script/tests/test_smbclient_s3.sh | 62 +++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 3 deletions(-) (limited to 'source3/script') diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh index 3341c62f4b..fb518c58c7 100755 --- a/source3/script/tests/test_smbclient_s3.sh +++ b/source3/script/tests/test_smbclient_s3.sh @@ -2,9 +2,9 @@ # this runs the file serving tests that are expected to pass with samba3 -if [ $# -lt 7 ]; then +if [ $# -lt 11 ]; then cat <&1 + ret=$? + if [ $ret != 0 ] ; then + priv_username="$DOMAIN\\$USERNAME" + else + priv_username=$USERNAME + fi + + $NET sam rights grant $priv_username SeBackupPrivilege 2>&1 + ret=$? + if [ $ret != 0 ] ; then + echo "Failed to add SeBackupPrivilege to user $priv_username - $ret" + false + return + fi + + cat > $tmpfile <&1 + ret=$? + if [ $ret != 0 ] ; then + echo "failed to remove SeBackupPrivilege from user $priv_username - $ret" + false + return + fi +} + LOGDIR_PREFIX=test_smbclient_s3 # possibly remove old logdirs: @@ -552,6 +604,10 @@ testit "using an authentication file" \ test_auth_file || \ failed=`expr $failed + 1` +testit "list with backup privilege" \ + test_backup_privilege_list || \ + failed=`expr $failed + 1` + testit "rm -rf $LOGDIR" \ rm -rf $LOGDIR || \ failed=`expr $failed + 1` -- cgit