The Samba-Bugzilla – Attachment 18333 Details for
Bug 15662
vfs_widelinks with DFS shares breaks case insensitivity.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 4.20.next
bug-15662-v4-20.patch (text/plain), 5.41 KB, created by
Jeremy Allison
on 2024-06-11 23:29:19 UTC
(
hide
)
Description:
git-am fix for 4.20.next
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2024-06-11 23:29:19 UTC
Size:
5.41 KB
patch
obsolete
>From 44572ab429eb8d66c5d6579c06d64ffeb48878c2 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Mon, 10 Jun 2024 15:14:19 -0700 >Subject: [PATCH 1/2] 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@samba.org> >Reviewed-by: Noel Power <noel.power@suse.com> >(cherry picked from commit e37e4f474935819c75c078e52715cf3212f77359) >--- > selftest/knownfail.d/widelinks_ci | 1 + > source3/script/tests/test_widelink_dfs_ci.sh | 72 ++++++++++++++++++++ > source3/selftest/tests.py | 11 +++ > 3 files changed, 84 insertions(+) > create mode 100644 selftest/knownfail.d/widelinks_ci > create mode 100755 source3/script/tests/test_widelink_dfs_ci.sh > >diff --git a/selftest/knownfail.d/widelinks_ci b/selftest/knownfail.d/widelinks_ci >new file mode 100644 >index 00000000000..387ca4498c6 >--- /dev/null >+++ b/selftest/knownfail.d/widelinks_ci >@@ -0,0 +1 @@ >+^samba3.blackbox.widelink_dfs_ci.creating\ a\ directory\ x\ and\ chdir\ into\ it\(fileserver\) >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" >-- >2.40.1 > > >From 5e9585c43fed546104609c099fb05542a5883f78 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Mon, 10 Jun 2024 17:25:32 -0700 >Subject: [PATCH 2/2] 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@samba.org> >Reviewed-by: Noel Power <noel.power@suse.com> > >Autobuild-User(master): Jeremy Allison <jra@samba.org> >Autobuild-Date(master): Tue Jun 11 17:00:38 UTC 2024 on atb-devel-224 > >(cherry picked from commit e535bcc698bd5eb31f5c5e0c144692988a044e79) >--- > selftest/knownfail.d/widelinks_ci | 1 - > source3/modules/vfs_widelinks.c | 13 +++++++++++-- > 2 files changed, 11 insertions(+), 3 deletions(-) > delete mode 100644 selftest/knownfail.d/widelinks_ci > >diff --git a/selftest/knownfail.d/widelinks_ci b/selftest/knownfail.d/widelinks_ci >deleted file mode 100644 >index 387ca4498c6..00000000000 >--- a/selftest/knownfail.d/widelinks_ci >+++ /dev/null >@@ -1 +0,0 @@ >-^samba3.blackbox.widelink_dfs_ci.creating\ a\ directory\ x\ and\ chdir\ into\ it\(fileserver\) >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; > } >-- >2.40.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
npower
:
review+
Actions:
View
Attachments on
bug 15662
: 18333