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

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


Author: vlendec
Date: 2006-12-17 18:10:15 +0000 (Sun, 17 Dec 2006)
New Revision: 20227

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

Log:
Simplify logic in vfs_MkDir() a bit
Modified:
   branches/SAMBA_3_0/source/smbd/vfs.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/vfs.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/vfs.c	2006-12-17 13:34:56 UTC (rev 20226)
+++ branches/SAMBA_3_0/source/smbd/vfs.c	2006-12-17 18:10:15 UTC (rev 20227)
@@ -315,20 +315,24 @@
 	int ret;
 	SMB_STRUCT_STAT sbuf;
 
-	if(!(ret=SMB_VFS_MKDIR(conn, name, mode))) {
+	if ((ret=SMB_VFS_MKDIR(conn, name, mode)) != 0) {
+		return ret;
+	}
 
-		inherit_access_acl(conn, name, mode);
+	inherit_access_acl(conn, name, mode);
 
-		/*
-		 * Check if high bits should have been set,
-		 * then (if bits are missing): add them.
-		 * Consider bits automagically set by UNIX, i.e. SGID bit from parent dir.
-		 */
-		if(mode & ~(S_IRWXU|S_IRWXG|S_IRWXO) &&
-				!SMB_VFS_STAT(conn,name,&sbuf) && (mode & ~sbuf.st_mode))
-			SMB_VFS_CHMOD(conn,name,sbuf.st_mode | (mode & ~sbuf.st_mode));
+	/*
+	 * Check if high bits should have been set,
+	 * then (if bits are missing): add them.
+	 * Consider bits automagically set by UNIX, i.e. SGID bit from parent
+	 * dir.
+	 */
+	if (mode & ~(S_IRWXU|S_IRWXG|S_IRWXO)
+	    && (SMB_VFS_STAT(conn,name,&sbuf) == 0)
+	    && (mode & ~sbuf.st_mode)) {
+		SMB_VFS_CHMOD(conn,name,sbuf.st_mode | (mode & ~sbuf.st_mode));
 	}
-	return ret;
+	return 0;
 }
 
 /*******************************************************************



More information about the samba-cvs mailing list