svn commit: samba r21036 - in branches/SAMBA_3_0/source/nsswitch: .

jerry at samba.org jerry at samba.org
Sat Jan 27 03:27:34 GMT 2007


Author: jerry
Date: 2007-01-27 03:27:34 +0000 (Sat, 27 Jan 2007)
New Revision: 21036

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

Log:
Fix the ad nss info backend to not abort the search when called outside the idmap daemon
Modified:
   branches/SAMBA_3_0/source/nsswitch/idmap_ad.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/idmap_ad.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/idmap_ad.c	2007-01-27 02:33:21 UTC (rev 21035)
+++ branches/SAMBA_3_0/source/nsswitch/idmap_ad.c	2007-01-27 03:27:34 UTC (rev 21036)
@@ -708,34 +708,28 @@
 				  char **gecos,
 				  uint32 *gid )
 {
-	char *home, *sh, *gec;
+	ADS_STRUCT *ads_internal = NULL;
 
-	if ( !ad_schema )
+	/* We are assuming that the internal ADS_STRUCT is for the 
+	   same forest as the incoming *ads pointer */
+
+	ads_internal = ad_idmap_cached_connection();
+
+	if ( !ads_internal || !ad_schema )
 		return NT_STATUS_OBJECT_NAME_NOT_FOUND;
 	
 	if ( !homedir || !shell || !gecos )
 		return NT_STATUS_INVALID_PARAMETER;
 
-	home = ads_pull_string( ads, ctx, msg, ad_schema->posix_homedir_attr );
-	sh   = ads_pull_string( ads, ctx, msg, ad_schema->posix_shell_attr );
-	gec  = ads_pull_string( ads, ctx, msg, ad_schema->posix_gecos_attr );
+	*homedir = ads_pull_string( ads, ctx, msg, ad_schema->posix_homedir_attr );
+	*shell   = ads_pull_string( ads, ctx, msg, ad_schema->posix_shell_attr );
+	*gecos   = ads_pull_string( ads, ctx, msg, ad_schema->posix_gecos_attr );
        
 	if ( gid ) {		
 		if ( !ads_pull_uint32(ads, msg, ad_schema->posix_gidnumber_attr, gid ) )
 			*gid = 0;		
 	}
 		
-	if ( home )
-		*homedir = talloc_strdup( ctx, home );
-	if ( sh )
-		*shell   = talloc_strdup( ctx, sh );
-	if ( gec )
-		*gecos   = talloc_strdup( ctx, gec );
-	
-	SAFE_FREE( home );
-	SAFE_FREE( sh );
-	SAFE_FREE( gec );
-	
 	return NT_STATUS_OK;
 }
 



More information about the samba-cvs mailing list