svn commit: samba r20344 - in branches/SAMBA_3_0/source/smbd: .

vlendec at samba.org vlendec at samba.org
Sun Dec 24 16:37:22 GMT 2006


Author: vlendec
Date: 2006-12-24 16:37:22 +0000 (Sun, 24 Dec 2006)
New Revision: 20344

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20344

Log:
Move the calls to inherit_access_acls and change_owner_to_parent together.

Jeremy, I'm 100% sure you watch me closely here, I count on you :-)

Volker

Modified:
   branches/SAMBA_3_0/source/smbd/open.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/open.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/open.c	2006-12-24 15:29:09 UTC (rev 20343)
+++ branches/SAMBA_3_0/source/smbd/open.c	2006-12-24 16:37:22 UTC (rev 20344)
@@ -293,11 +293,17 @@
 			return map_nt_error_from_unix(errno);
 		}
 
-		/* Inherit the ACL if the file was created. */
-		if ((local_flags & O_CREAT)
-		    && !file_existed
-		    && lp_inherit_perms(SNUM(conn))) {
-			inherit_access_acl(conn, fname, unx_mode);
+		if ((local_flags & O_CREAT) && !file_existed) {
+
+			/* Inherit the ACL if required */
+			if (lp_inherit_perms(SNUM(conn))) {
+				inherit_access_acl(conn, fname, unx_mode);
+			}
+
+			/* Change the owner if required. */
+			if (lp_inherit_owner(SNUM(conn))) {
+				change_fd_owner_to_parent(conn, fsp);
+			}
 		}
 
 	} else {
@@ -1702,10 +1708,6 @@
 		}
 	} else {
 		info = FILE_WAS_CREATED;
-		/* Change the owner if required. */
-		if (lp_inherit_owner(SNUM(conn))) {
-			change_fd_owner_to_parent(conn, fsp);
-		}
 	}
 
 	if (pinfo) {
@@ -1913,6 +1915,11 @@
 			      psbuf->st_mode | (mode & ~psbuf->st_mode));
 	}
 
+	/* Change the owner if required. */
+	if (lp_inherit_owner(SNUM(conn))) {
+		change_owner_to_parent(conn, name, psbuf);
+	}
+
 	return NT_STATUS_OK;
 }
 
@@ -2086,11 +2093,6 @@
 
 	TALLOC_FREE(lck);
 
-	/* Change the owner if required. */
-	if ((info == FILE_WAS_CREATED) && lp_inherit_owner(SNUM(conn))) {
-		change_owner_to_parent(conn, fsp->fsp_name, psbuf);
-	}
-
 	if (pinfo) {
 		*pinfo = info;
 	}



More information about the samba-cvs mailing list