[SCM] Samba Shared Repository - branch v4-20-test updated

Jule Anger janger at samba.org
Wed Jun 12 10:23:01 UTC 2024


The branch, v4-20-test has been updated
       via  e57e35908d5 s3: vfs_widelinks: Allow case insensitivity to work on DFS widelinks shares.
       via  f681ee3bac0 s3/torture: Add test for widelink case insensitivity on a MSDFS share.
      from  50d4451bd4b s3:smbcacls: fix ace_compare

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-20-test


- Log -----------------------------------------------------------------
commit e57e35908d53124d44d4c275a9f6b248516204ae
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jun 10 17:25:32 2024 -0700

    s3: vfs_widelinks: Allow case insensitivity to work on DFS widelinks shares.
    
    Remove knownfail.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15662
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Noel Power <noel.power at suse.com>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Tue Jun 11 17:00:38 UTC 2024 on atb-devel-224
    
    (cherry picked from commit e535bcc698bd5eb31f5c5e0c144692988a044e79)
    
    Autobuild-User(v4-20-test): Jule Anger <janger at samba.org>
    Autobuild-Date(v4-20-test): Wed Jun 12 10:22:36 UTC 2024 on atb-devel-224

commit f681ee3bac0ebe86ea1e810aca13e0b5738c58e0
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jun 10 15:14:19 2024 -0700

    s3/torture: Add test for widelink case insensitivity on a MSDFS share.
    
    Add knownfail.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15662
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Noel Power <noel.power at suse.com>
    (cherry picked from commit e37e4f474935819c75c078e52715cf3212f77359)

-----------------------------------------------------------------------

Summary of changes:
 source3/modules/vfs_widelinks.c              | 13 ++++-
 source3/script/tests/test_widelink_dfs_ci.sh | 72 ++++++++++++++++++++++++++++
 source3/selftest/tests.py                    | 11 +++++
 3 files changed, 94 insertions(+), 2 deletions(-)
 create mode 100755 source3/script/tests/test_widelink_dfs_ci.sh


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_widelinks.c b/source3/modules/vfs_widelinks.c
index c5b5084e108..4339f6de9e0 100644
--- a/source3/modules/vfs_widelinks.c
+++ b/source3/modules/vfs_widelinks.c
@@ -383,8 +383,17 @@ static int widelinks_openat(vfs_handle_struct *handle,
 		}
 		lstat_ret = SMB_VFS_NEXT_LSTAT(handle,
 				full_fname);
-		if (lstat_ret != -1 &&
-		    VALID_STAT(full_fname->st) &&
+		if (lstat_ret == -1) {
+			/*
+			 * Path doesn't exist. We must
+			 * return errno from LSTAT.
+			 */
+			int saved_errno = errno;
+			TALLOC_FREE(full_fname);
+			errno = saved_errno;
+			return -1;
+		}
+		if (VALID_STAT(full_fname->st) &&
 		    S_ISLNK(full_fname->st.st_ex_mode)) {
 			fsp->fsp_name->st = full_fname->st;
 		}
diff --git a/source3/script/tests/test_widelink_dfs_ci.sh b/source3/script/tests/test_widelink_dfs_ci.sh
new file mode 100755
index 00000000000..6ae5cf5bd7f
--- /dev/null
+++ b/source3/script/tests/test_widelink_dfs_ci.sh
@@ -0,0 +1,72 @@
+#!/bin/sh
+
+# regression test for dfs access with wide links enabled on dfs share
+# Ensure we still maintain case insensitivity.
+
+if [ $# -lt 7 ]; then
+	cat <<EOF
+Usage: test_widelink_dfs_ci.sh SERVER SERVER_IP SHARE USERNAME PASSWORD PREFIX SMBCLIENT <smbclient arguments>
+EOF
+	exit 1
+fi
+
+SERVER="$1"
+SERVER_IP="$2"
+SHARE="$3"
+USERNAME="$4"
+PASSWORD="$5"
+PREFIX="$6"
+SMBCLIENT="$7"
+shift 7
+ADDARGS="$@"
+
+incdir=$(dirname "$0")"/../../../testprogs/blackbox"
+. "$incdir/subunit.sh"
+. "$incdir/common_test_fns.inc"
+
+failed=0
+
+# Do not let deprecated option warnings muck this up
+SAMBA_DEPRECATED_SUPPRESS=1
+export SAMBA_DEPRECATED_SUPPRESS
+
+# Test chdir'ing into a lowercase directory with upper case.
+test_ci()
+{
+        tmpfile="$PREFIX/smbclient_ci_commands"
+
+        cat >"$tmpfile" <<EOF
+mkdir x
+cd X
+cd ..
+rmdir x
+quit
+EOF
+
+        cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/msdfs-share-wl -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
+        eval echo "$cmd"
+        out=$(eval "$cmd")
+        ret=$?
+        rm -f "$tmpfile"
+
+        if [ $ret != 0 ]; then
+                echo "$out"
+                echo "failed create x then chdir into X with error $ret"
+                return 1
+        fi
+
+	echo "$out" | grep 'NT_STATUS_'
+	ret="$?"
+	if [ "$ret" -eq 0 ]; then
+		echo "$out"
+		echo "Error create x then chdir into X"
+		return 1
+        fi
+	return 0
+}
+
+testit "creating a directory x and chdir into it" \
+        test_ci ||
+	failed=$((failed + 1))
+
+testok "$0" "$failed"
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 0901c2480c8..0648797df16 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -1808,6 +1808,17 @@ plantestsuite("samba3.blackbox.smbclient-bug15435",
                smbclient3,
                configuration])
 
+plantestsuite("samba3.blackbox.widelink_dfs_ci",
+              "fileserver",
+              [os.path.join(samba3srcdir, "script/tests/test_widelink_dfs_ci.sh"),
+               "$SERVER",
+               "$SERVER_IP",
+               "msdfs-share-wl",
+               "$USERNAME",
+               "$PASSWORD",
+               "$PREFIX",
+               smbclient3])
+
 
 if have_cluster_support:
     t = "readdir-timestamp"


-- 
Samba Shared Repository



More information about the samba-cvs mailing list