mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
selftest: test access based share enum parameter
BUG: https://bugzilla.samba.org/show_bug.cgi?id=8093 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Uri Simchoni <uri@samba.org> Autobuild-Date(master): Wed Mar 2 23:51:56 CET 2016 on sn-devel-144
This commit is contained in:
parent
5036a0922b
commit
9c67ff461d
@ -185,3 +185,4 @@ dbwrap_tool = binpath('dbwrap_tool')
|
||||
vfstest = binpath('vfstest')
|
||||
smbcquotas = binpath('smbcquotas')
|
||||
smbget = binpath('smbget')
|
||||
rpcclient = binpath('rpcclient')
|
||||
|
@ -1512,6 +1512,7 @@ sub provision($$$$$$$$)
|
||||
[valid-users-tmp]
|
||||
path = $shrdir
|
||||
valid users = $unix_name
|
||||
access based share enum = yes
|
||||
[msdfs-share]
|
||||
path = $msdfs_shrdir
|
||||
msdfs root = yes
|
||||
|
30
source3/script/tests/test_shareenum.sh
Executable file
30
source3/script/tests/test_shareenum.sh
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
# this tests share enumeration with "access based share enum"
|
||||
|
||||
if [ $# -lt 4 ]; then
|
||||
cat <<EOF
|
||||
Usage: $0 SERVER USERNAME PASSWORD RPCCLIENT
|
||||
EOF
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
SERVER="$1"
|
||||
USERNAME="$2"
|
||||
PASSWORD="$3"
|
||||
RPCCLIENT="$4"
|
||||
RPCCLIENT="$VALGRIND ${RPCCLIENT}"
|
||||
|
||||
incdir=`dirname $0`/../../../testprogs/blackbox
|
||||
. $incdir/subunit.sh
|
||||
|
||||
user_see_share() {
|
||||
local user=$1
|
||||
local share=$2
|
||||
$RPCCLIENT //$SERVER -U$user%$PASSWORD -c "netshareenumall" | grep $share > /dev/null 2>&1
|
||||
}
|
||||
|
||||
testit "$USERNAME sees tmp" user_see_share $USERNAME tmp
|
||||
testit "$USERNAME sees valid-users-tmp" user_see_share $USERNAME valid-users-tmp
|
||||
testit "force_user sees tmp" user_see_share force_user tmp
|
||||
testit_expect_failure "force_user does not see valid-users-tmp" user_see_share force_user valid-users-tmp
|
@ -183,6 +183,7 @@ for env in ["fileserver"]:
|
||||
plantestsuite("samba3.blackbox.shadow_copy2 (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_shadow_copy.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/shadow', smbclient3])
|
||||
plantestsuite("samba3.blackbox.smbclient.forceuser_validusers (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_forceuser_validusers.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbclient3])
|
||||
plantestsuite("samba3.blackbox.smbget (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbget.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', 'smbget_user', '$PASSWORD', '$LOCAL_PATH/smbget', smbget])
|
||||
plantestsuite("samba3.blackbox.netshareenum (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_shareenum.sh"), '$SERVER', '$USERNAME', '$PASSWORD', rpcclient])
|
||||
|
||||
#
|
||||
# tar command tests
|
||||
|
Loading…
Reference in New Issue
Block a user