summaryrefslogtreecommitdiffstats
path: root/source/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-01-12 00:50:01 +0000
committerJeremy Allison <jra@samba.org>2002-01-12 00:50:01 +0000
commit4f1f5f28b514dda86f6f49465bd5887357e37bc6 (patch)
tree74895e741f090186c823e383f1e33b741361192d /source/smbd
parent2603ab3c6870f3697751b887e940910713f08985 (diff)
downloadsamba-4f1f5f28b514dda86f6f49465bd5887357e37bc6.tar.gz
samba-4f1f5f28b514dda86f6f49465bd5887357e37bc6.tar.xz
samba-4f1f5f28b514dda86f6f49465bd5887357e37bc6.zip
Added the O_NOFOLLOW flag if follow symlinks is set off.
Jeremy.
Diffstat (limited to 'source/smbd')
-rw-r--r--source/smbd/open.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/smbd/open.c b/source/smbd/open.c
index 72f73deb84b..b42c1bacc34 100644
--- a/source/smbd/open.c
+++ b/source/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 '.' */