widelinks-nofollow
authorVolker Lendecke <vl@samba.org>
Wed, 2 Apr 2025 11:34:31 +0000 (14:34 +0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 2 Apr 2025 11:34:31 +0000 (14:34 +0300)
Origin: upstream, https://bugzilla.samba.org/show_bug.cgi?id=15841
Forwarded: yes, https://bugzilla.samba.org/show_bug.cgi?id=15841
Bug-Debian: https://bugs.debian.org/1101581
Bug: https://bugzilla.samba.org/show_bug.cgi?id=15841

 source3/modules/vfs_widelinks.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Gbp-Pq: Name widelinks-nofollow.patch

source3/modules/vfs_widelinks.c

index 4339f6de9e00a55502bad1b8d90f408aa991e0a8..80620a31f93637d12f25db879e5f130b00be0d0d 100644 (file)
@@ -354,15 +354,14 @@ static int widelinks_openat(vfs_handle_struct *handle,
                                struct widelinks_config,
                                return -1);
 
-       if (config->active &&
-           (config->cwd != NULL) &&
-           !(smb_fname->flags & SMB_FILENAME_POSIX_PATH))
-       {
+       if (config->active && (config->cwd != NULL)) {
                /*
                 * Module active, openat after chdir (see note 1b above) and not
                 * a POSIX open (POSIX sees symlinks), so remove O_NOFOLLOW.
                 */
-               how.flags = (how.flags & ~O_NOFOLLOW);
+               how.flags = (how.flags & ~(O_NOFOLLOW | O_PATH));
+               how.resolve = (how.resolve &
+                              ~(VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS));
        }
 
        ret = SMB_VFS_NEXT_OPENAT(handle,