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

vlendec at samba.org vlendec at samba.org
Sun Dec 17 18:30:45 GMT 2006


Author: vlendec
Date: 2006-12-17 18:30:44 +0000 (Sun, 17 Dec 2006)
New Revision: 20228

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

Log:
Bring the calling conventions of inherit_access_acl and change_owner_to_parent
a bit closer together: Move the lp_inherit_perms() check into the callers.

Volker

Modified:
   branches/SAMBA_3_0/source/smbd/open.c
   branches/SAMBA_3_0/source/smbd/posix_acls.c
   branches/SAMBA_3_0/source/smbd/trans2.c
   branches/SAMBA_3_0/source/smbd/vfs.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/open.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/open.c	2006-12-17 18:10:15 UTC (rev 20227)
+++ branches/SAMBA_3_0/source/smbd/open.c	2006-12-17 18:30:44 UTC (rev 20228)
@@ -283,7 +283,9 @@
 		}
 
 		/* Inherit the ACL if the file was created. */
-		if ((local_flags & O_CREAT) && !file_existed) {
+		if ((local_flags & O_CREAT)
+		    && !file_existed
+		    && lp_inherit_perms(SNUM(conn))) {
 			inherit_access_acl(conn, fname, unx_mode);
 		}
 

Modified: branches/SAMBA_3_0/source/smbd/posix_acls.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/posix_acls.c	2006-12-17 18:10:15 UTC (rev 20227)
+++ branches/SAMBA_3_0/source/smbd/posix_acls.c	2006-12-17 18:30:44 UTC (rev 20228)
@@ -3457,8 +3457,8 @@
 }
 
 /****************************************************************************
- If "inherit permissions" is set and the parent directory has no default
- ACL but it does have an Access ACL, inherit this Access ACL to file name.
+ If the parent directory has no default ACL but it does have an Access ACL,
+ inherit this Access ACL to file name.
 ****************************************************************************/
 
 int inherit_access_acl(connection_struct *conn, const char *name, mode_t mode)
@@ -3466,7 +3466,7 @@
 	pstring dirname;
 	pstrcpy(dirname, parent_dirname(name));
 
-	if (!lp_inherit_perms(SNUM(conn)) || directory_has_default_acl(conn, dirname))
+	if (directory_has_default_acl(conn, dirname))
 		return 0;
 
 	return copy_access_acl(conn, dirname, name, mode);

Modified: branches/SAMBA_3_0/source/smbd/trans2.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/trans2.c	2006-12-17 18:10:15 UTC (rev 20227)
+++ branches/SAMBA_3_0/source/smbd/trans2.c	2006-12-17 18:30:44 UTC (rev 20228)
@@ -4307,7 +4307,10 @@
 				if (SMB_VFS_MKNOD(conn,fname, unixmode, dev) != 0)
 					return(UNIXERROR(ERRDOS,ERRnoaccess));
 
-				inherit_access_acl(conn, fname, unixmode);
+				if (lp_inherit_perms(SNUM(conn))) {
+					inherit_access_acl(conn, fname,
+							   unixmode);
+				}
 
 				SSVAL(params,0,0);
 				send_trans2_replies(outbuf, bufsize, params, 2, *ppdata, 0, max_data_bytes);

Modified: branches/SAMBA_3_0/source/smbd/vfs.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/vfs.c	2006-12-17 18:10:15 UTC (rev 20227)
+++ branches/SAMBA_3_0/source/smbd/vfs.c	2006-12-17 18:30:44 UTC (rev 20228)
@@ -319,7 +319,9 @@
 		return ret;
 	}
 
-	inherit_access_acl(conn, name, mode);
+	if (lp_inherit_perms(SNUM(conn))) {
+		inherit_access_acl(conn, name, mode);
+	}
 
 	/*
 	 * Check if high bits should have been set,



More information about the samba-cvs mailing list