From: Jeremy Allison Date: Tue, 11 Jun 2024 00:25:32 +0000 (-0700) Subject: s3: vfs_widelinks: Allow case insensitivity to work on DFS widelinks shares. X-Git-Tag: tdb-1.4.11~385 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e535bcc698bd5eb31f5c5e0c144692988a044e79;p=thirdparty%2Fsamba.git 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 Reviewed-by: Noel Power Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Tue Jun 11 17:00:38 UTC 2024 on atb-devel-224 --- 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; }