[SCM] Samba Shared Repository - branch master updated

Matthias Dieter Wallnöfer mdw at samba.org
Fri Dec 3 02:27:02 MST 2010


The branch, master has been updated
       via  e2a89d6 s4:auth/sam.c - when printing out a string buffer we don't strictly need the width
       via  4ae9aec s4:auth/sam.c - the check for the SAMDB needs to be on the top of the call
       via  5e1c9b5 s4:auth/sam.c - fix the free of memory contexts
       via  07e18e8 s4:auth/sam.c - specify the SID ignore case better
      from  6bfa21f wintest: autodetect if named supports tkey-gssapi-keytab

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


- Log -----------------------------------------------------------------
commit e2a89d6ba76d632fe3319aac4575cebe0c060d6b
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Fri Dec 3 09:33:57 2010 +0100

    s4:auth/sam.c - when printing out a string buffer we don't strictly need the width
    
    The precision (maximum numbers of characters) should be enough.
    
    Autobuild-User: Matthias Dieter Wallnöfer <mdw at samba.org>
    Autobuild-Date: Fri Dec  3 10:26:39 CET 2010 on sn-devel-104

commit 4ae9aec17cc75685381fff86e1b90f99b4ae51c8
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Fri Dec 3 09:19:42 2010 +0100

    s4:auth/sam.c - the check for the SAMDB needs to be on the top of the call
    
    Otherwise it's really useless.

commit 5e1c9b562c4bf89d0d2e9a423a6fa0bf48b6da6b
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Fri Dec 3 09:18:23 2010 +0100

    s4:auth/sam.c - fix the free of memory contexts
    
    "tmp_ctx" needs always to be freed ("res" is freed implicitly)

commit 07e18e8f7c5687d00160a1760411099736444c7c
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Fri Dec 3 09:17:01 2010 +0100

    s4:auth/sam.c - specify the SID ignore case better
    
    As per suggestion by metze.

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

Summary of changes:
 source4/auth/sam.c |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/auth/sam.c b/source4/auth/sam.c
index 6203b96..2b3ed91 100644
--- a/source4/auth/sam.c
+++ b/source4/auth/sam.c
@@ -314,29 +314,34 @@ NTSTATUS authsam_expand_nested_groups(struct ldb_context *sam_ctx,
 		*num_res_sids = 0;
 	}
 
+	if (!sam_ctx) {
+		DEBUG(0, ("No SAM available, cannot determine local groups\n"));
+		return NT_STATUS_INVALID_SYSTEM_SERVICE;
+	}
+
 	tmp_ctx = talloc_new(res_sids_ctx);
 
 	dn = ldb_dn_from_ldb_val(tmp_ctx, sam_ctx, dn_val);
 	if (dn == NULL) {
 		talloc_free(tmp_ctx);
-		DEBUG(0, (__location__ ": we failed parsing DN %*.*s, so we cannot calculate the group token\n",
-			  (int)dn_val->length, (int)dn_val->length, dn_val->data));
+		DEBUG(0, (__location__ ": we failed parsing DN %.*s, so we cannot calculate the group token\n",
+			  (int)dn_val->length, dn_val->data));
 		return NT_STATUS_INTERNAL_DB_CORRUPTION;
 	}
 
 	status = dsdb_get_extended_dn_sid(dn, &sid, "SID");
-	if (!NT_STATUS_IS_OK(status)) {
+	if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
 		/* If we fail finding a SID then this is no error since it could
 		 * be a non SAM object - e.g. a group with object class
 		 * "groupOfNames" */
 		talloc_free(tmp_ctx);
 		return NT_STATUS_OK;
-	}
-
-	if (!sam_ctx) {
-		DEBUG(0, ("No SAM available, cannot determine local groups\n"));
+	} else if (!NT_STATUS_IS_OK(status)) {
+		DEBUG(0, (__location__ ": when parsing DN %s we failed to parse our SID component, so we cannot calculate the group token: %s\n",
+			  ldb_dn_get_extended_linearized(tmp_ctx, dn, 1),
+			  nt_errstr(status)));
 		talloc_free(tmp_ctx);
-		return NT_STATUS_INVALID_SYSTEM_SERVICE;
+		return status;
 	}
 
 	if (only_childs) {
@@ -347,6 +352,7 @@ NTSTATUS authsam_expand_nested_groups(struct ldb_context *sam_ctx,
 		already_there = sids_contains_sid((const struct dom_sid**) *res_sids,
 						  *num_res_sids, &sid);
 		if (already_there) {
+			talloc_free(tmp_ctx);
 			return NT_STATUS_OK;
 		}
 
@@ -390,7 +396,6 @@ NTSTATUS authsam_expand_nested_groups(struct ldb_context *sam_ctx,
 		status = authsam_expand_nested_groups(sam_ctx, &el->values[i],
 						      false, filter, res_sids_ctx, res_sids, num_res_sids);
 		if (!NT_STATUS_IS_OK(status)) {
-			talloc_free(res);
 			talloc_free(tmp_ctx);
 			return status;
 		}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list