summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/open.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 72f73deb84..b42c1bacc3 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -37,6 +37,12 @@ static int fd_open(struct connection_struct *conn, char *fname,
#ifdef O_NONBLOCK
flags |= O_NONBLOCK;
#endif
+
+#ifdef O_NOFOLLOW
+ if (!lp_symlinks(SNUM(conn)))
+ flags |= O_NOFOLLOW;
+#endif
+
fd = conn->vfs_ops.open(conn,fname,flags,mode);
/* Fix for files ending in '.' */