[SCM] Samba Shared Repository - branch v3-5-test updated

Volker Lendecke vlendec at samba.org
Mon Dec 28 15:36:07 MST 2009


The branch, v3-5-test has been updated
       via  10ae5a1... s3: Check for lp_winbind_trusted_domains_only in wb_gettoken()
      from  7929e78... s3: Move a lp_winbind_trusted_domains_only() check to wb_getgrsid()

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


- Log -----------------------------------------------------------------
commit 10ae5a1a20852a3ebd582eb051f92ee08f61c50f
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Dec 28 23:35:25 2009 +0100

    s3: Check for lp_winbind_trusted_domains_only in wb_gettoken()
    
    This avoids one walk of the domain list

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

Summary of changes:
 source3/winbindd/wb_gettoken.c        |    7 +++++++
 source3/winbindd/winbindd_getgroups.c |   24 ------------------------
 2 files changed, 7 insertions(+), 24 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/wb_gettoken.c b/source3/winbindd/wb_gettoken.c
index 26189e5..ca407b2 100644
--- a/source3/winbindd/wb_gettoken.c
+++ b/source3/winbindd/wb_gettoken.c
@@ -60,6 +60,13 @@ struct tevent_req *wb_gettoken_send(TALLOC_CTX *mem_ctx,
 		return tevent_req_post(req, ev);
 	}
 
+	if (lp_winbind_trusted_domains_only() && domain->primary) {
+		DEBUG(7, ("wb_gettoken: My domain -- rejecting getgroups() "
+			  "for %s.\n", sid_string_tos(sid)));
+		tevent_req_nterror(req, NT_STATUS_NO_SUCH_USER);
+		return tevent_req_post(req, ev);
+	}
+
 	subreq = wb_lookupusergroups_send(state, ev, domain, &state->usersid);
 	if (tevent_req_nomem(subreq, req)) {
 		return tevent_req_post(req, ev);
diff --git a/source3/winbindd/winbindd_getgroups.c b/source3/winbindd/winbindd_getgroups.c
index 3bdf762..736eba6 100644
--- a/source3/winbindd/winbindd_getgroups.c
+++ b/source3/winbindd/winbindd_getgroups.c
@@ -45,7 +45,6 @@ struct tevent_req *winbindd_getgroups_send(TALLOC_CTX *mem_ctx,
 	struct tevent_req *req, *subreq;
 	struct winbindd_getgroups_state *state;
 	char *domuser, *mapped_user;
-	struct winbindd_domain *domain;
 	NTSTATUS status;
 
 	req = tevent_req_create(mem_ctx, &state,
@@ -76,29 +75,6 @@ struct tevent_req *winbindd_getgroups_send(TALLOC_CTX *mem_ctx,
 		return tevent_req_post(req, ev);
 	}
 
-	domain = find_domain_from_name_noinit(state->domname);
-	if (domain == NULL) {
-		/* Retry with DNS name */
-		char *p = strchr(domuser, '@');
-		if (p != NULL) {
-			domain = find_domain_from_name_noinit(p+1);
-		}
-	}
-	if (domain == NULL) {
-		DEBUG(7, ("could not find domain entry for domain %s\n",
-			  state->domname));
-		tevent_req_nterror(req, NT_STATUS_NO_SUCH_USER);
-		return tevent_req_post(req, ev);
-	}
-
-	if (lp_winbind_trusted_domains_only() && domain->primary) {
-		DEBUG(7,("winbindd_getgroups: My domain -- "
-			 "rejecting getgroups() for %s\\%s.\n",
-			 state->domname, state->username));
-		tevent_req_nterror(req, NT_STATUS_NO_SUCH_USER);
-		return tevent_req_post(req, ev);
-	}
-
 	subreq = wb_lookupname_send(state, ev, state->domname, state->username,
 				    LOOKUP_NAME_NO_NSS);
 	if (tevent_req_nomem(subreq, req)) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list