svn commit: samba r6784 - in trunk/source/nsswitch: .

jerry at samba.org jerry at samba.org
Sat May 14 15:48:22 GMT 2005


Author: jerry
Date: 2005-05-14 15:48:22 +0000 (Sat, 14 May 2005)
New Revision: 6784

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6784

Log:
merge removal of domain_sid() from SAMBA_3_0
Modified:
   trunk/source/nsswitch/winbindd.h
   trunk/source/nsswitch/winbindd_ads.c
   trunk/source/nsswitch/winbindd_cache.c
   trunk/source/nsswitch/winbindd_passdb.c
   trunk/source/nsswitch/winbindd_reconnect.c
   trunk/source/nsswitch/winbindd_rpc.c


Changeset:
Modified: trunk/source/nsswitch/winbindd.h
===================================================================
--- trunk/source/nsswitch/winbindd.h	2005-05-14 01:21:18 UTC (rev 6783)
+++ trunk/source/nsswitch/winbindd.h	2005-05-14 15:48:22 UTC (rev 6784)
@@ -272,10 +272,6 @@
 				    char ***alt_names,
 				    DOM_SID **dom_sids);
 
-	/* find the domain sid */
-	NTSTATUS (*domain_sid)(struct winbindd_domain *domain,
-			       DOM_SID *sid);
-
 	/* setup the list of alternate names for the domain, if any */
 	NTSTATUS (*alternate_name)(struct winbindd_domain *domain);
 };

Modified: trunk/source/nsswitch/winbindd_ads.c
===================================================================
--- trunk/source/nsswitch/winbindd_ads.c	2005-05-14 01:21:18 UTC (rev 6783)
+++ trunk/source/nsswitch/winbindd_ads.c	2005-05-14 15:48:22 UTC (rev 6784)
@@ -850,36 +850,6 @@
 	return result;
 }
 
-/* find the domain sid for a domain */
-static NTSTATUS domain_sid(struct winbindd_domain *domain, DOM_SID *sid)
-{
-	ADS_STRUCT *ads;
-	ADS_STATUS rc;
-
-	DEBUG(3,("ads: domain_sid\n"));
-
-	ads = ads_cached_connection(domain);
-
-	if (!ads) {
-		domain->last_status = NT_STATUS_SERVER_DISABLED;
-		return NT_STATUS_UNSUCCESSFUL;
-	}
-
-	rc = ads_domain_sid(ads, sid);
-
-	if (!ADS_ERR_OK(rc)) {
-	
-		/* its a dead connection; don't destroy it though
-		   since that has already been done indirectly 
-		   by ads_domain_sid() */
-
-		domain->private = NULL;
-	}
-
-	return ads_ntstatus(rc);
-}
-
-
 /* find alternate names list for the domain - for ADS this is the
    netbios name */
 static NTSTATUS alternate_name(struct winbindd_domain *domain)
@@ -930,7 +900,6 @@
 	lookup_groupmem,
 	sequence_number,
 	trusted_domains,
-	domain_sid,
 	alternate_name
 };
 

Modified: trunk/source/nsswitch/winbindd_cache.c
===================================================================
--- trunk/source/nsswitch/winbindd_cache.c	2005-05-14 01:21:18 UTC (rev 6783)
+++ trunk/source/nsswitch/winbindd_cache.c	2005-05-14 15:48:22 UTC (rev 6784)
@@ -1391,18 +1391,6 @@
 					       names, alt_names, dom_sids);
 }
 
-/* find the domain sid */
-static NTSTATUS domain_sid(struct winbindd_domain *domain, DOM_SID *sid)
-{
-	get_cache(domain);
-
-	DEBUG(10,("domain_sid: [Cached] - doing backend query for info for domain %s\n",
-		domain->name ));
-
-	/* we don't cache this call */
-	return domain->backend->domain_sid(domain, sid);
-}
-
 /* find the alternate names for the domain, if any */
 static NTSTATUS alternate_name(struct winbindd_domain *domain)
 {
@@ -1469,7 +1457,6 @@
 	lookup_groupmem,
 	sequence_number,
 	trusted_domains,
-	domain_sid,
 	alternate_name
 };
 

Modified: trunk/source/nsswitch/winbindd_passdb.c
===================================================================
--- trunk/source/nsswitch/winbindd_passdb.c	2005-05-14 01:21:18 UTC (rev 6783)
+++ trunk/source/nsswitch/winbindd_passdb.c	2005-05-14 15:48:22 UTC (rev 6784)
@@ -378,13 +378,6 @@
 	return nt_status;
 }
 
-/* find the domain sid for a domain */
-static NTSTATUS domain_sid(struct winbindd_domain *domain, DOM_SID *sid)
-{
-	sid_copy(sid, &domain->sid);
-	return NT_STATUS_OK;
-}
-
 /* find alternate names list for the domain 
  * should we look for netbios aliases?? 
 				SSS	*/
@@ -410,6 +403,5 @@
 	lookup_groupmem,
 	sequence_number,
 	trusted_domains,
-	domain_sid,
 	alternate_name
 };

Modified: trunk/source/nsswitch/winbindd_reconnect.c
===================================================================
--- trunk/source/nsswitch/winbindd_reconnect.c	2005-05-14 01:21:18 UTC (rev 6783)
+++ trunk/source/nsswitch/winbindd_reconnect.c	2005-05-14 15:48:22 UTC (rev 6784)
@@ -242,19 +242,6 @@
 	return result;
 }
 
-/* find the domain sid for a domain */
-static NTSTATUS domain_sid(struct winbindd_domain *domain, DOM_SID *sid)
-{
-	NTSTATUS result;
-
-	result = msrpc_methods.domain_sid(domain, sid);
-
-	if (NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL))
-		result = msrpc_methods.domain_sid(domain, sid);
-
-	return result;
-}
-
 static NTSTATUS alternate_name(struct winbindd_domain *domain)
 {
 	NTSTATUS result;
@@ -282,6 +269,5 @@
 	lookup_groupmem,
 	sequence_number,
 	trusted_domains,
-	domain_sid,
 	alternate_name
 };

Modified: trunk/source/nsswitch/winbindd_rpc.c
===================================================================
--- trunk/source/nsswitch/winbindd_rpc.c	2005-05-14 01:21:18 UTC (rev 6783)
+++ trunk/source/nsswitch/winbindd_rpc.c	2005-05-14 15:48:22 UTC (rev 6784)
@@ -248,16 +248,19 @@
 	struct rpc_pipe_client *cli;
 	POLICY_HND lsa_policy;
 
-	DEBUG(3,("rpc: name_to_sid name=%s\n", name));
-
-	full_name = talloc_asprintf(mem_ctx, "%s\\%s", domain_name, name);
-	
+        if(name == NULL || *name=='\0') {
+                DEBUG(3,("rpc: name_to_sid name=%s\n", domain_name));
+                full_name = talloc_asprintf(mem_ctx, "%s", domain_name);
+        } else {
+                DEBUG(3,("rpc: name_to_sid name=%s\\%s\n", domain_name, name));
+                full_name = talloc_asprintf(mem_ctx, "%s\\%s", domain_name, name);
+        }
 	if (!full_name) {
 		DEBUG(0, ("talloc_asprintf failed!\n"));
 		return NT_STATUS_NO_MEMORY;
 	}
 
-	DEBUG(3,("name_to_sid [rpc] %s for domain %s\n", name, domain_name ));
+	DEBUG(3,("name_to_sid [rpc] %s for domain %s\n", name?name:"", domain_name ));
 
 	result = cm_connect_lsa(domain, mem_ctx, &cli, &lsa_policy);
 	if (!NT_STATUS_IS_OK(result))
@@ -872,40 +875,6 @@
 	return result;
 }
 
-/* find the domain sid for a domain */
-static NTSTATUS domain_sid(struct winbindd_domain *domain, DOM_SID *sid)
-{
-	NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-	TALLOC_CTX *mem_ctx;
-	char *level5_dom;
-	DOM_SID *alloc_sid;
-	struct rpc_pipe_client *cli;
-	POLICY_HND lsa_policy;
-
-	DEBUG(3,("rpc: domain_sid\n"));
-
-	if (!(mem_ctx = talloc_init("domain_sid[rpc]")))
-		return NT_STATUS_NO_MEMORY;
-
-	result = cm_connect_lsa(domain, mem_ctx, &cli, &lsa_policy);
-	if (!NT_STATUS_IS_OK(result))
-		return result;
-
-	result = rpccli_lsa_query_info_policy(cli, mem_ctx, &lsa_policy, 0x05,
-					      &level5_dom, &alloc_sid);
-
-	if (NT_STATUS_IS_OK(result)) {
-		if (alloc_sid) {
-			sid_copy(sid, alloc_sid);
-		} else {
-			result = NT_STATUS_NO_MEMORY;
-		}
-	}
-
-	talloc_destroy(mem_ctx);
-	return result;
-}
-
 /* find alternate names list for the domain - none for rpc */
 static NTSTATUS alternate_name(struct winbindd_domain *domain)
 {
@@ -927,6 +896,5 @@
 	lookup_groupmem,
 	sequence_number,
 	trusted_domains,
-	domain_sid,
 	alternate_name
 };



More information about the samba-cvs mailing list