From 67530167dbea3f08e41e921731cd6c3618183e17 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 2 Apr 2025 14:34:31 +0300 Subject: [PATCH] widelinks-nofollow 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 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source3/modules/vfs_widelinks.c b/source3/modules/vfs_widelinks.c index 4339f6de..80620a31 100644 --- a/source3/modules/vfs_widelinks.c +++ b/source3/modules/vfs_widelinks.c @@ -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, -- 2.30.2