[SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0pre2-2928-g77a0d72

Jeremy Allison jra at samba.org
Sun Aug 17 02:29:10 GMT 2008


The branch, v3-2-test has been updated
       via  77a0d72ffe9764faa4accdf9240c1d482404d01d (commit)
       via  780a4ff80dfd03a2c422920dbd101e8f58f7136e (commit)
      from  7e05ff65a7907bf34e2d422f7c941002cfb86971 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 77a0d72ffe9764faa4accdf9240c1d482404d01d
Merge: 780a4ff80dfd03a2c422920dbd101e8f58f7136e 7e05ff65a7907bf34e2d422f7c941002cfb86971
Author: Jeremy Allison <jra at samba.org>
Date:   Sat Aug 16 19:27:25 2008 -0700

    Merge branch 'v3-2-test' of ssh://jra@git.samba.org/data/git/samba into v3-2-test

commit 780a4ff80dfd03a2c422920dbd101e8f58f7136e
Author: Jeremy Allison <jra at samba.org>
Date:   Sat Aug 16 19:25:22 2008 -0700

    Fix bug 5696. The problem was when smbd
    was asking for a winbindd name to SID lookup of
    "Unix Group\name" where "name" was also a valid username,
    the winbindd passdb lookup of that name was losing the
    domain string info before calling lookup name (ie. lookup_name()
    was being called with just the string "name", not the
    full string "Unix Group\name").
    
    The passdb backend of winbindd has to cope with
    not only names from it's own global SAM domain,
    but it does lookups for BUILTIN and "Unix User"
    and "Unix Group" also, so making it guess by
    losing the domain string is "A Bad Idea" (tm) :-).
    
    Note that as winbind globally calls winbind_off()
    at startup, it's safe for winbind to call sys_getgrnam()
    to do the "Unix Group" lookup from inside lookup_name().
    
    Jeremy.

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

Summary of changes:
 source/winbindd/winbindd_passdb.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/winbindd/winbindd_passdb.c b/source/winbindd/winbindd_passdb.c
index 8387565..5677c01 100644
--- a/source/winbindd/winbindd_passdb.c
+++ b/source/winbindd/winbindd_passdb.c
@@ -94,6 +94,7 @@ static NTSTATUS name_to_sid(struct winbindd_domain *domain,
 			    DOM_SID *sid,
 			    enum lsa_SidType *type)
 {
+	const char *fullname;
 	uint32 flags = LOOKUP_NAME_ALL;
 
 	switch ( original_cmd ) {
@@ -107,12 +108,27 @@ static NTSTATUS name_to_sid(struct winbindd_domain *domain,
 		break;
 	}
 	
-	DEBUG(10, ("Finding name %s\n", name));
+	if (domain_name && domain_name[0] && strchr_m(name, '\\') == NULL) {
+		fullname = talloc_asprintf(mem_ctx, "%s\\%s",
+				domain_name, name);
+		if (fullname == NULL) {
+			return NT_STATUS_NO_MEMORY;
+		}
+	} else {
+		fullname = name;
+	}
+
+	DEBUG(10, ("Finding fullname %s\n", fullname));
 
-	if ( !lookup_name( mem_ctx, name, flags, NULL, NULL, sid, type ) ) {
+	if ( !lookup_name( mem_ctx, fullname, flags, NULL, NULL, sid, type ) ) {
 		return NT_STATUS_NONE_MAPPED;
 	}
 
+	DEBUG(10, ("name_to_sid for %s returned %s (%s)\n",
+		fullname,
+		sid_string_dbg(sid),
+		sid_type_lookup((uint32)*type)));
+		
 	return NT_STATUS_OK;
 }
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list