[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Tue Feb 22 13:00:03 MST 2011


The branch, master has been updated
       via  56f02e8 s3: Fix filtering in pdb_ads_search_users
       via  ecb6533 s3: Fix some nonempty blank lines
       via  c85607d s3: Fix a typo
      from  c399c28 s3-waf: add replacetort binary.

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


- Log -----------------------------------------------------------------
commit 56f02e8520095e3ece5787b9f87eb1f222f96344
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Feb 22 15:30:14 2011 +0100

    s3: Fix filtering in pdb_ads_search_users
    
    Autobuild-User: Volker Lendecke <vlendec at samba.org>
    Autobuild-Date: Tue Feb 22 20:59:07 CET 2011 on sn-devel-104

commit ecb65332eabd87fa9d4befefada6a117892061ee
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Feb 21 20:51:21 2011 +0100

    s3: Fix some nonempty blank lines

commit c85607d8ecd97c242662ca391e24269df1686fb8
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Feb 21 12:45:14 2011 +0100

    s3: Fix a typo

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

Summary of changes:
 source3/passdb/lookup_sid.c |   20 ++++++++++----------
 source3/passdb/pdb_ads.c    |   25 +++++++++++++++++++------
 source3/printing/printing.c |    2 +-
 3 files changed, 30 insertions(+), 17 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c
index 5c6118f..0e1b8d6 100644
--- a/source3/passdb/lookup_sid.c
+++ b/source3/passdb/lookup_sid.c
@@ -4,17 +4,17 @@
    Copyright (C) Andrew Tridgell         1992-1998
    Copyright (C) Gerald (Jerry) Carter   2003
    Copyright (C) Volker Lendecke	 2005
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -261,7 +261,7 @@ bool lookup_name(TALLOC_CTX *mem_ctx,
 		struct dom_sid dom_sid;
 		uint32 tmp_rid;
 		enum lsa_SidType domain_type;
-		
+
 		if (type == SID_NAME_DOMAIN) {
 			/* Swap name and type */
 			tmp = name; name = domain; domain = tmp;
@@ -403,7 +403,7 @@ bool lookup_name_smbconf(TALLOC_CTX *mem_ctx,
 				ret_sid, ret_type)) {
 		return true;
 	}
-	
+
 	/* Finally try with "Unix Users" or "Unix Group" */
 	qualified_name = talloc_asprintf(mem_ctx, "%s\\%s",
 				flags & LOOKUP_NAME_GROUP ?
@@ -801,7 +801,7 @@ NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids,
 				result = NT_STATUS_NO_MEMORY;
 				goto fail;
 			}
-				
+
 			name_infos[i].rid = 0;
 			name_infos[i].type = SID_NAME_DOMAIN;
 			name_infos[i].name = NULL;
@@ -920,7 +920,7 @@ NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids,
 			result = NT_STATUS_NO_MEMORY;
 			goto fail;
 		}
-			
+
 		for (j=0; j<dom->num_idxs; j++) {
 			int idx = dom->idxs[j];
 			name_infos[idx].type = types[j];
@@ -1172,7 +1172,7 @@ static void legacy_gid_to_sid(struct dom_sid *psid, gid_t gid)
 		/* This is a mapped group */
 		goto done;
 	}
-	
+
 	/* This is an unmapped group */
 
 	gid_to_unix_groups_sid(gid, psid);
@@ -1273,14 +1273,14 @@ static bool legacy_sid_to_gid(const struct dom_sid *psid, gid_t *pgid)
 			*pgid = id.gid;
 			goto done;
 		}
-	
+
 		/* This was ours, but it was not mapped.  Fail */
 	}
 
 	DEBUG(10,("LEGACY: mapping failed for sid %s\n",
 		  sid_string_dbg(psid)));
 	return false;
-	
+
  done:
 	DEBUG(10,("LEGACY: sid %s -> gid %u\n", sid_string_dbg(psid),
 		  (unsigned int)*pgid ));
diff --git a/source3/passdb/pdb_ads.c b/source3/passdb/pdb_ads.c
index f74fb12..48def7e 100644
--- a/source3/passdb/pdb_ads.c
+++ b/source3/passdb/pdb_ads.c
@@ -1985,6 +1985,7 @@ static void pdb_ads_search_end(struct pdb_search *search)
 static bool pdb_ads_search_filter(struct pdb_methods *m,
 				  struct pdb_search *search,
 				  const char *filter,
+				  uint32_t acct_flags,
 				  struct pdb_ads_search_state **pstate)
 {
 	struct pdb_ads_state *state = talloc_get_type_abort(
@@ -1999,6 +2000,7 @@ static bool pdb_ads_search_filter(struct pdb_methods *m,
 	if (sstate == NULL) {
 		return false;
 	}
+	sstate->acct_flags = acct_flags;
 
 	rc = pdb_ads_search_fmt(
 		state, state->domaindn, TLDAP_SCOPE_SUB,
@@ -2036,7 +2038,19 @@ static bool pdb_ads_search_filter(struct pdb_methods *m,
 		sid_peek_rid(&sid, &e->rid);
 
 		if (tldap_pull_uint32(users[i], "userAccountControl", &ctrl)) {
+
 			e->acct_flags = ds_uf2acb(ctrl);
+
+			DEBUG(10, ("pdb_ads_search_filter: Found %x, "
+				   "filter %x\n", (int)e->acct_flags,
+				   (int)sstate->acct_flags));
+
+
+			if ((sstate->acct_flags != 0) &&
+			    ((sstate->acct_flags & e->acct_flags) == 0)) {
+				continue;
+			}
+
 			if (e->acct_flags & (ACB_WSTRUST|ACB_SVRTRUST)) {
 				e->acct_flags |= ACB_NORMAL;
 			}
@@ -2092,6 +2106,8 @@ static bool pdb_ads_search_users(struct pdb_methods *m,
 	char *filter;
 	bool ret;
 
+	DEBUG(10, ("pdb_ads_search_users got flags %x\n", acct_flags));
+
 	if (acct_flags & ACB_NORMAL) {
 		filter = talloc_asprintf(
 			talloc_tos(),
@@ -2109,12 +2125,11 @@ static bool pdb_ads_search_users(struct pdb_methods *m,
 		return false;
 	}
 
-	ret = pdb_ads_search_filter(m, search, filter, &sstate);
+	ret = pdb_ads_search_filter(m, search, filter, acct_flags, &sstate);
 	TALLOC_FREE(filter);
 	if (!ret) {
 		return false;
 	}
-	sstate->acct_flags = acct_flags;
 	return true;
 }
 
@@ -2131,12 +2146,11 @@ static bool pdb_ads_search_groups(struct pdb_methods *m,
 	if (filter == NULL) {
 		return false;
 	}
-	ret = pdb_ads_search_filter(m, search, filter, &sstate);
+	ret = pdb_ads_search_filter(m, search, filter, 0, &sstate);
 	TALLOC_FREE(filter);
 	if (!ret) {
 		return false;
 	}
-	sstate->acct_flags = 0;
 	return true;
 }
 
@@ -2157,12 +2171,11 @@ static bool pdb_ads_search_aliases(struct pdb_methods *m,
 	if (filter == NULL) {
 		return false;
 	}
-	ret = pdb_ads_search_filter(m, search, filter, &sstate);
+	ret = pdb_ads_search_filter(m, search, filter, 0, &sstate);
 	TALLOC_FREE(filter);
 	if (!ret) {
 		return false;
 	}
-	sstate->acct_flags = 0;
 	return true;
 }
 
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 1c2817d..ee0a100 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -1306,7 +1306,7 @@ done:
 }
 
 /****************************************************************************
- main work for updating the lpq cahe for a printer queue
+ main work for updating the lpq cache for a printer queue
 ****************************************************************************/
 
 static void print_queue_update_internal( struct tevent_context *ev,


-- 
Samba Shared Repository


More information about the samba-cvs mailing list