This patch also removes known fail for existing test
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15435
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jun 11 19:31:40 UTC 2024 on atb-devel-224
(cherry picked from commit
788ef8f07c75d5e6eca5b8f18d93d96f31574267)
[noel.power@suse.com backported to Samba 4.19 changed test of errno
after return from widelink_openat to ENOENT because ELOOP isn't set
for msdfs links in 4.19, ENOENT is set instead. Also minor change
to use 4.19 create_open_symlink_err fn instead of read_symlink_reparse]
+++ /dev/null
-^samba.tests.blackbox.misc_dfs_widelink.samba.tests.blackbox.misc_dfs_widelink.DfsWidelinkBlockboxTestBase.test_nested_chdir\(fileserver\)
-^samba.tests.blackbox.misc_dfs_widelink.samba.tests.blackbox.misc_dfs_widelink.DfsWidelinkBlockboxTestBase.test_enumerate_dfs_link
}
if (fd == -1) {
+ /*
+ * vfs_widelink widelink_openat will update stat for fsp
+ * and return ENOENT for non-existing link, we can report
+ * the link here and let calling code decide what to do.
+ */
+ if ((errno == ENOENT) && S_ISLNK(fsp->fsp_name->st.st_ex_mode)) {
+ status = create_open_symlink_err(mem_ctx,
+ dirfsp,
+ &rel_fname,
+ &symlink_err);
+ if (NT_STATUS_IS_OK(status)) {
+ status = NT_STATUS_STOPPED_ON_SYMLINK;
+ } else {
+ DBG_ERR("read_symlink_reparse failed: %s\n",
+ nt_errstr(status));
+ }
+ goto fail;
+ }
status = map_nt_error_from_unix(errno);
DBG_DEBUG("SMB_VFS_OPENAT() failed: %s\n",
strerror(errno));