]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: test: Add tests to show we still connect to a full_audit share with a bad success...
authorJeremy Allison <jra@samba.org>
Thu, 16 Jun 2022 18:57:58 +0000 (11:57 -0700)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 17 Jun 2022 01:28:29 +0000 (01:28 +0000)
Add knownfail.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15098

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/knownfail.d/full_audit_badname [new file with mode: 0644]
selftest/target/Samba3.pm
source3/script/tests/test_bad_auditnames.sh [new file with mode: 0755]
source3/selftest/tests.py

diff --git a/selftest/knownfail.d/full_audit_badname b/selftest/knownfail.d/full_audit_badname
new file mode 100644 (file)
index 0000000..b353875
--- /dev/null
@@ -0,0 +1,2 @@
+^samba3.blackbox.test_full_audit_success_badname.Cannot\ connect\ to\ share\ full_audit_success_bad_name\(fileserver\)
+^samba3.blackbox.test_full_audit_fail_badname.Cannot\ connect\ to\ share\ full_audit_fail_bad_name\(fileserver\)
index 8c3e840ededdf202238d49789e59816493a3bf2a..c080c23f2ba8b89ced73d1f69f5d66a675c94c42 100755 (executable)
@@ -3396,6 +3396,14 @@ sub provision($$)
 [acls_non_canonical]
        copy = tmp
        acl flag inherited canonicalization = no
+
+[full_audit_success_bad_name]
+       copy = tmp
+       full_audit:success = badname
+
+[full_audit_fail_bad_name]
+       copy = tmp
+       full_audit:failure = badname
        ";
 
        close(CONF);
diff --git a/source3/script/tests/test_bad_auditnames.sh b/source3/script/tests/test_bad_auditnames.sh
new file mode 100755 (executable)
index 0000000..69ddf14
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+# this tests a full audit share with bad VFS
+# names will not allow connection.
+# BUG: https://bugzilla.samba.org/show_bug.cgi?id=15098
+
+if [ $# -lt 5 ]; then
+       cat <<EOF
+Usage: $0 SERVER SHARE USERNAME PASSWORD SMBCLIENT
+EOF
+       exit 1
+fi
+
+SERVER="$1"
+SHARE="$2"
+USERNAME="$3"
+PASSWORD="$4"
+SMBCLIENT="$5"
+SMBCLIENT="$VALGRIND ${SMBCLIENT}"
+
+incdir=$(dirname "$0")/../../../testprogs/blackbox
+. "$incdir/subunit.sh"
+
+can_connect()
+{
+       $SMBCLIENT //"$SERVER"/"$SHARE" -U"$USERNAME"%"$PASSWORD" -c "ls" | grep "tree connect failed: NT_STATUS_UNSUCCESSFUL" >/dev/null 2>&1
+}
+
+testit "Cannot connect to share $SHARE" can_connect || failed=$((failed + 1))
index ff149aade4e9093229dc987fcad3678256e855f4..2e62696cb82397c046f89d10f63408884378a80b 100755 (executable)
@@ -670,6 +670,12 @@ for env in ["fileserver"]:
     plantestsuite("samba3.blackbox.fifo", env,
                   [os.path.join(samba3srcdir, "script/tests/test_fifo.sh"),
                   '$SERVER', '$DOMAIN', 'gooduser', '$PASSWORD', '$PREFIX', env, smbclient3])
+    plantestsuite("samba3.blackbox.test_full_audit_success_badname", env,
+                  [os.path.join(samba3srcdir, "script/tests/test_bad_auditnames.sh"),
+                  '$SERVER', 'full_audit_success_bad_name', '$USERNAME', '$PASSWORD', smbclient3])
+    plantestsuite("samba3.blackbox.test_full_audit_fail_badname", env,
+                  [os.path.join(samba3srcdir, "script/tests/test_bad_auditnames.sh"),
+                  '$SERVER', 'full_audit_fail_bad_name', '$USERNAME', '$PASSWORD', smbclient3])
 
 for env in ["fileserver:local"]:
     plantestsuite("samba3.blackbox.net_usershare", env, [os.path.join(samba3srcdir, "script/tests/test_net_usershare.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', smbclient3])