diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-20 04:07:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-20 04:07:29 +0000 |
commit | 5f0615a601e014ed2da5c8117a9bc6df0bc6aad8 (patch) | |
tree | c271a7d4ed696305c1e34c72ce426f14f9ee6be4 /source3/modules/vfs_widelinks.c | |
parent | Releasing progress-linux version 2:4.20.1+dfsg-5~progress7.99u1. (diff) | |
download | samba-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 '')
-rw-r--r-- | source3/modules/vfs_widelinks.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/modules/vfs_widelinks.c b/source3/modules/vfs_widelinks.c index c5b5084..4339f6d 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; } |