[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Sat Aug 24 21:45:03 MDT 2013


The branch, master has been updated
       via  84b8bdd Revert "Fix the erroneous masking of chmod requests via the UNIX extensions."
       via  8e29963 Revert "Allow UNIX extensions client to act on open fsp instead of pathname if available."
       via  9cbd4fc Pushed from the wrong branch - this is the version without Simo's review changes. Apologies to all and I'll re-submit in less of a haste after the weekend.
      from  cf86adc Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 84b8bddd7d6845f389444e57d2029f2a954dfcd5
Author: Jeremy Allison <jra at samba.org>
Date:   Sat Aug 24 18:44:28 2013 -0700

    Revert "Fix the erroneous masking of chmod requests via the UNIX extensions."
    
    Pushed from the wrong branch - this is the version
    without Simo's review changes. Apologies to all
    and I'll re-submit in less of a haste after the
    weekend.
    
    This reverts commit f124d6fbcd0a03bbd95d69477c144f475546de66.
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Sun Aug 25 05:44:11 CEST 2013 on sn-devel-104

commit 8e299634d9ad3d4facdefd39e8d9442bacb22ba0
Author: Jeremy Allison <jra at samba.org>
Date:   Sat Aug 24 18:44:20 2013 -0700

    Revert "Allow UNIX extensions client to act on open fsp instead of pathname if available."
    
    Pushed from the wrong branch - this is the version
    without Simo's review changes. Apologies to all
    and I'll re-submit in less of a haste after the
    weekend.
    
    This reverts commit ce776551abb07f18cf302ee7c0c437ee27952099.

commit 9cbd4fcd1e7ef87e564a0ffa07940af6f26f4e2b
Author: Jeremy Allison <jra at samba.org>
Date:   Sat Aug 24 18:43:29 2013 -0700

    Pushed from the wrong branch - this is the version
    without Simo's review changes. Apologies to all
    and I'll re-submit in less of a haste after the
    weekend.
    
    Revert "Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN."
    
    This reverts commit cf86adc4419f2636a0b24824ab04ebfcd5bb074d.

-----------------------------------------------------------------------

Summary of changes:
 source3/smbd/trans2.c |   38 ++++++++++++++------------------------
 1 files changed, 14 insertions(+), 24 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 04947d3..e7c0da1 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1392,15 +1392,20 @@ static NTSTATUS unix_perms_from_wire( connection_struct *conn,
 	ret |= ((perms & UNIX_SET_UID ) ? S_ISUID : 0);
 #endif
 
-	if (ptype == PERM_NEW_FILE) {
+	switch (ptype) {
+	case PERM_NEW_FILE:
+	case PERM_EXISTING_FILE:
 		/* Apply mode mask */
 		ret &= lp_create_mask(SNUM(conn));
 		/* Add in force bits */
 		ret |= lp_force_create_mode(SNUM(conn));
-	} else if (ptype == PERM_NEW_DIR) {
+		break;
+	case PERM_NEW_DIR:
+	case PERM_EXISTING_DIR:
 		ret &= lp_dir_mask(SNUM(conn));
 		/* Add in force bits */
 		ret |= lp_force_dir_mode(SNUM(conn));
+		break;
 	}
 
 	*ret_perms = ret;
@@ -7119,18 +7124,11 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn,
 	 */
 
 	if (raw_unixmode != SMB_MODE_NO_CHANGE) {
-		int ret;
-
 		DEBUG(10,("smb_set_file_unix_basic: SMB_SET_FILE_UNIX_BASIC "
 			  "setting mode 0%o for file %s\n",
 			  (unsigned int)unixmode,
 			  smb_fname_str_dbg(smb_fname)));
-		if (fsp && fsp->fh->fd != -1) {
-			ret = SMB_VFS_FCHMOD(fsp, unixmode);
-		} else {
-			ret = SMB_VFS_CHMOD(conn, smb_fname->base_name, unixmode);
-		}
-		if (ret != 0) {
+		if (SMB_VFS_CHMOD(conn, smb_fname->base_name, unixmode) != 0) {
 			return map_nt_error_from_unix(errno);
 		}
 	}
@@ -7148,12 +7146,12 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn,
 			  (unsigned int)set_owner,
 			  smb_fname_str_dbg(smb_fname)));
 
-		if (fsp && fsp->fh->fd != -1) {
-			ret = SMB_VFS_FCHOWN(fsp, set_owner, (gid_t)-1);
-		} else {
-			/* UNIX calls always operate on symlinks. */
+		if (S_ISLNK(sbuf.st_ex_mode)) {
 			ret = SMB_VFS_LCHOWN(conn, smb_fname->base_name,
 					     set_owner, (gid_t)-1);
+		} else {
+			ret = SMB_VFS_CHOWN(conn, smb_fname->base_name,
+					    set_owner, (gid_t)-1);
 		}
 
 		if (ret != 0) {
@@ -7171,20 +7169,12 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn,
 
 	if ((set_grp != (uid_t)SMB_GID_NO_CHANGE) &&
 	    (sbuf.st_ex_gid != set_grp)) {
-		int ret;
-
 		DEBUG(10,("smb_set_file_unix_basic: SMB_SET_FILE_UNIX_BASIC "
 			  "changing group %u for file %s\n",
 			  (unsigned int)set_owner,
 			  smb_fname_str_dbg(smb_fname)));
-		if (fsp && fsp->fh->fd != -1) {
-			ret = SMB_VFS_FCHOWN(fsp, set_owner, (gid_t)-1);
-		} else {
-			/* UNIX calls always operate on symlinks. */
-			ret = SMB_VFS_LCHOWN(conn, smb_fname->base_name, (uid_t)-1,
-				  set_grp);
-		}
-		if (ret != 0) {
+		if (SMB_VFS_CHOWN(conn, smb_fname->base_name, (uid_t)-1,
+				  set_grp) != 0) {
 			status = map_nt_error_from_unix(errno);
 			if (delete_on_fail) {
 				SMB_VFS_UNLINK(conn, smb_fname);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list