summaryrefslogtreecommitdiffstats
path: root/source3/smbd/files.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-20 04:07:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-20 04:07:29 +0000
commit5f0615a601e014ed2da5c8117a9bc6df0bc6aad8 (patch)
treec271a7d4ed696305c1e34c72ce426f14f9ee6be4 /source3/smbd/files.c
parentReleasing progress-linux version 2:4.20.1+dfsg-5~progress7.99u1. (diff)
downloadsamba-5f0615a601e014ed2da5c8117a9bc6df0bc6aad8.tar.xz
samba-5f0615a601e014ed2da5c8117a9bc6df0bc6aad8.zip
Merging upstream version 2:4.20.2+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'source3/smbd/files.c')
-rw-r--r--source3/smbd/files.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index 6aad76a..42bb323 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -1312,6 +1312,24 @@ next:
}
if (fd == -1) {
+ /*
+ * vfs_widelink widelink_openat will update stat for fsp
+ * and return ELOOP for non-existing link, we can report
+ * the link here and let calling code decide what to do.
+ */
+ if ((errno == ELOOP) && 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));