Fix for bugid 51 from Dragan Krnic.
authorJeremy Allison <jra@samba.org>
Thu, 1 May 2003 17:48:07 +0000 (17:48 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 1 May 2003 17:48:07 +0000 (17:48 +0000)
Jeremy.
(This used to be commit aeba1fcab2fa61859fc1052af4752512a33bd801)

source3/smbd/open.c

index 5e4f3caca7411b6a939b6ec95783a012c05ee5a8..906c4b40d9f70a3fb74f97bb4288d193122e1a0c 100644 (file)
@@ -168,17 +168,17 @@ static BOOL open_file(files_struct *fsp,connection_struct *conn,
 
                /* 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));
                        check_for_pipe(fname);
                        return False;
                }
+
+               /* Inherit the ACL if the file was created. */
+               if ((local_flags & O_CREAT) && !VALID_STAT(*psbuf))
+                       inherit_access_acl(conn, fname, mode);
+
        } else
                fsp->fd = -1; /* What we used to call a stat open. */