From: Volker Lendecke Date: Wed, 26 Jun 2019 15:42:54 +0000 (+0200) Subject: vfs_preopen: Fix for O_NOFOLLOW X-Git-Tag: ldb-2.0.5~150 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6bc70dcde2685e13f2f4cd6d9876e022629004de;p=thirdparty%2Fsamba.git vfs_preopen: Fix for O_NOFOLLOW Since 4301505d977449d core smbd code passes O_NOFOLLOW together with [O_RDONLY|O_RDWR] as flags. This breaks activating vfs_preopen, we need to look at *just* the access mode. Signed-off-by: Volker Lendecke Reviewed-by: Michael Adam --- diff --git a/source3/modules/vfs_preopen.c b/source3/modules/vfs_preopen.c index 24d33fafacd..27d218e1b87 100644 --- a/source3/modules/vfs_preopen.c +++ b/source3/modules/vfs_preopen.c @@ -400,7 +400,7 @@ static int preopen_open(vfs_handle_struct *handle, return -1; } - if (flags != O_RDONLY) { + if ((flags & O_ACCMODE) != O_RDONLY) { return res; }