Added the O_NOFOLLOW flag if follow symlinks is set off.
authorJeremy Allison <jra@samba.org>
Sat, 12 Jan 2002 00:50:01 +0000 (00:50 +0000)
committerJeremy Allison <jra@samba.org>
Sat, 12 Jan 2002 00:50:01 +0000 (00:50 +0000)
Jeremy.
(This used to be commit 4f1f5f28b514dda86f6f49465bd5887357e37bc6)

source3/smbd/open.c

index 72f73deb84bb7a22aeee38b047127df1ab6ca8e4..b42c1bacc34dba2c96fae3a4284eea4494a7cfa7 100644 (file)
@@ -37,6 +37,12 @@ static int fd_open(struct connection_struct *conn, char *fname,
 #ifdef O_NONBLOCK
        flags |= O_NONBLOCK;
 #endif
 #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 '.' */
        fd = conn->vfs_ops.open(conn,fname,flags,mode);
 
        /* Fix for files ending in '.' */