[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Thu Sep 15 22:35:05 UTC 2016


The branch, master has been updated
       via  2a2ac63 s3/smbd: set FILE_ATTRIBUTE_DIRECTORY as necessary
       via  5d4f7bf nfs4acl: Fix owner mapping with ID_TYPE_BOTH
       via  a9a1a16 s3-spoolss: fix winreg_printer_ver_to_qword
      from  e69b17d smbd: Reset O_NONBLOCK on open files

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


- Log -----------------------------------------------------------------
commit 2a2ac63975b8ff41ede8e93ef2b33148c89f185f
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Sep 14 12:52:48 2016 +0200

    s3/smbd: set FILE_ATTRIBUTE_DIRECTORY as necessary
    
    Some VFS modules like GPFS will always return success from
    SMB_VFS_GET_DOS_ATTRIBUTES() but only set a subset of the attributes. It
    neither sets FILE_ATTRIBUTE_NORMAL nor FILE_ATTRIBUTE_DIRECTORY.
    
    We already handle the case that the VFS stack returns with result==0 and
    then add the FILE_ATTRIBUTE_NORMAL, regardless of the type of the
    filesystem object. If we want to handle result==0 situation in the
    SMB_VFS_GET_DOS_ATTRIBUTES() caller, then do it right by either setting
    FILE_ATTRIBUTE_NORMAL or FILE_ATTRIBUTE_DIRECTORY.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12261
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Fri Sep 16 00:34:43 CEST 2016 on sn-devel-144

commit 5d4f7bfda579cecb123cfb1d7130688f1d1c98b7
Author: Christof Schmitt <cs at samba.org>
Date:   Mon Sep 12 16:22:16 2016 -0700

    nfs4acl: Fix owner mapping with ID_TYPE_BOTH
    
    This fixes a corner case when using NFS4 ACLs with ID_TYPE_BOTH.  Before
    this patch, the owner entry in the ACL would be mapped to a gid entry in
    the NFSv4 ACL, and not the expected special owner entry. This is caused
    by the id mapping returning a valid gid and the nfs4 mapping assumed
    that this was actually a group.
    
    Fix this by asking for the uid first, and explicitly checking if the
    mapped uid matches the owner. That creates a uid entry in the NFSv4 ACL
    that can be changed later in smbacl4_substitute_{simple,special} to the
    expected special owner entry.
    
    Signed-off-by: Christof Schmitt <cs at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit a9a1a16cc8b87a84cdfa049ebd26bf4eac1b3618
Author: Günther Deschner <gd at samba.org>
Date:   Mon Sep 12 17:55:37 2016 +0200

    s3-spoolss: fix winreg_printer_ver_to_qword
    
    We were reporting the OS minor number as the driver version number in all
    GetDriver/EnumDriver calls.
    
    Guenther
    
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 source3/modules/nfs4_acls.c             | 9 ++++++++-
 source3/rpc_client/cli_winreg_spoolss.c | 7 ++++---
 source3/smbd/dosmode.c                  | 6 +++++-
 3 files changed, 17 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c
index 71f4d8d..6fe3b11 100644
--- a/source3/modules/nfs4_acls.c
+++ b/source3/modules/nfs4_acls.c
@@ -715,7 +715,14 @@ static bool smbacl4_fill_ace4(
 		uid_t uid;
 		gid_t gid;
 
-		if (sid_to_gid(&ace_nt->trustee, &gid)) {
+		/*
+		 * ID_TYPE_BOTH returns both uid and gid. Explicitly
+		 * check for ownerUID to allow the mapping of the
+		 * owner to a special entry in this idmap config.
+		 */
+		if (sid_to_uid(&ace_nt->trustee, &uid) && uid == ownerUID) {
+			ace_v4->who.uid = uid;
+		} else if (sid_to_gid(&ace_nt->trustee, &gid)) {
 			ace_v4->aceFlags |= SMB_ACE4_IDENTIFIER_GROUP;
 			ace_v4->who.gid = gid;
 		} else if (sid_to_uid(&ace_nt->trustee, &uid)) {
diff --git a/source3/rpc_client/cli_winreg_spoolss.c b/source3/rpc_client/cli_winreg_spoolss.c
index 8014e41..f1df336 100644
--- a/source3/rpc_client/cli_winreg_spoolss.c
+++ b/source3/rpc_client/cli_winreg_spoolss.c
@@ -529,8 +529,9 @@ static WERROR winreg_printer_write_ver(TALLOC_CTX *mem_ctx,
 	NTSTATUS status;
 	char *str;
 
-	/* FIXME: check format is right,
-	 *	this needs to be something like: 6.1.7600.16385 */
+	/*
+	 * this needs to be something like: 6.1.7600.16385
+	 */
 	str = talloc_asprintf(mem_ctx, "%u.%u.%u.%u",
 			      (unsigned)((data >> 48) & 0xFFFF),
 			      (unsigned)((data >> 32) & 0xFFFF),
@@ -574,7 +575,7 @@ static WERROR winreg_printer_ver_to_qword(const char *str, uint64_t *data)
 	*data = ((uint64_t)(v1 & 0xFFFF) << 48) +
 		((uint64_t)(v2 & 0xFFFF) << 32) +
 		((uint64_t)(v3 & 0xFFFF) << 16) +
-		(uint64_t)(v2 & 0xFFFF);
+		(uint64_t)(v4 & 0xFFFF);
 
 	return WERR_OK;
 }
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index ef880e5..a376cbc 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -637,7 +637,11 @@ uint32_t dos_mode(connection_struct *conn, struct smb_filename *smb_fname)
 	result |= dos_mode_from_name(conn, smb_fname, result);
 
 	if (result == 0) {
-		result = FILE_ATTRIBUTE_NORMAL;
+		if (S_ISDIR(smb_fname->st.st_ex_mode)) {
+			result = FILE_ATTRIBUTE_DIRECTORY;
+		} else {
+			result = FILE_ATTRIBUTE_NORMAL;
+		}
 	}
 
 	result = filter_mode_by_protocol(result);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list