git.samba.org
/
ira
/
wip.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Added the O_NOFOLLOW flag if follow symlinks is set off.
[ira/wip.git]
/
source
/
smbd
/
open.c
diff --git
a/source/smbd/open.c
b/source/smbd/open.c
index 72f73deb84bb7a22aeee38b047127df1ab6ca8e4..b42c1bacc34dba2c96fae3a4284eea4494a7cfa7 100644
(file)
--- 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 '.' */