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

vlendec at samba.org vlendec at samba.org
Sun Dec 24 14:29:19 GMT 2006


Author: vlendec
Date: 2006-12-24 14:29:19 +0000 (Sun, 24 Dec 2006)
New Revision: 20340

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

Log:
Join vfs_MkDir to its only caller
Modified:
   branches/SAMBA_3_0/source/smbd/open.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-24 11:45:55 UTC (rev 20339)
+++ branches/SAMBA_3_0/source/smbd/open.c	2006-12-24 14:29:19 UTC (rev 20340)
@@ -1851,27 +1851,45 @@
 	return ret;
 }
 
-static NTSTATUS mkdir_internal(connection_struct *conn,
-			       const pstring directory)
+static NTSTATUS mkdir_internal(connection_struct *conn, const char *name)
 {
+	SMB_STRUCT_STAT sbuf;
 	int ret= -1;
-	
+	mode_t mode;
+
 	if(!CAN_WRITE(conn)) {
 		DEBUG(5,("mkdir_internal: failing create on read-only share "
 			 "%s\n", lp_servicename(SNUM(conn))));
 		return NT_STATUS_ACCESS_DENIED;
 	}
 
-	if (!check_name(directory, conn)) {
+	if (!check_name(name, conn)) {
 		return map_nt_error_from_unix(errno);
 	}
 
-	ret = vfs_MkDir(conn,directory,unix_mode(conn,aDIR,directory,True));
+	mode = unix_mode(conn, aDIR, name, True);
 
-	if (ret == -1) {
+	if ((ret=SMB_VFS_MKDIR(conn, name, mode)) != 0) {
 		return map_nt_error_from_unix(errno);
 	}
-	
+
+	if (lp_inherit_perms(SNUM(conn))) {
+		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) == 0)
+	    && (mode & ~sbuf.st_mode)) {
+		SMB_VFS_CHMOD(conn, name,
+			      sbuf.st_mode | (mode & ~sbuf.st_mode));
+	}
+
 	return NT_STATUS_OK;
 }
 

Modified: branches/SAMBA_3_0/source/smbd/vfs.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/vfs.c	2006-12-24 11:45:55 UTC (rev 20339)
+++ branches/SAMBA_3_0/source/smbd/vfs.c	2006-12-24 14:29:19 UTC (rev 20340)
@@ -307,37 +307,6 @@
 }
 
 /*******************************************************************
- vfs mkdir wrapper 
-********************************************************************/
-
-int vfs_MkDir(connection_struct *conn, const char *name, mode_t mode)
-{
-	int ret;
-	SMB_STRUCT_STAT sbuf;
-
-	if ((ret=SMB_VFS_MKDIR(conn, name, mode)) != 0) {
-		return ret;
-	}
-
-	if (lp_inherit_perms(SNUM(conn))) {
-		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) == 0)
-	    && (mode & ~sbuf.st_mode)) {
-		SMB_VFS_CHMOD(conn,name,sbuf.st_mode | (mode & ~sbuf.st_mode));
-	}
-	return 0;
-}
-
-/*******************************************************************
  Check if an object exists in the vfs.
 ********************************************************************/
 



More information about the samba-cvs mailing list