First cut of new ACL mapping code from Andreas Gruenbacher <agruen@suse.de>.
[samba.git] / source3 / smbd / open.c
index a95793a0505a9cb221d3a9c38f36ffc533ca8307..417a9dd039043950f2a2f1e3c58d27a0d3e470e9 100644 (file)
@@ -165,9 +165,13 @@ static BOOL open_file(files_struct *fsp,connection_struct *conn,
                        local_flags |= O_NONBLOCK;
 #endif
 
-               /* actually do the open */
+               /* Actually do the open */
                fsp->fd = fd_open(conn, fname, local_flags, mode);
 
+               /* Inherit the ACL if the file was created. */
+               if ((local_flags & O_CREAT) && !VALID_STAT(*psbuf))
+                       inherit_access_acl(conn, fname, mode);
+
                if (fsp->fd == -1)  {
                        DEBUG(3,("Error opening file %s (%s) (local_flags=%d) (flags=%d)\n",
                                 fname,strerror(errno),local_flags,flags));