summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2007-01-27 03:27:34 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:29 -0500
commit400f419580800020bc832412ef737116a02a9703 (patch)
treec4971d77564b8c5cc96fc1385e1fb004f63ea576 /source3
parent3bd12f9658ef5b2058183a561a7e451c40e68099 (diff)
downloadsamba-400f419580800020bc832412ef737116a02a9703.tar.gz
samba-400f419580800020bc832412ef737116a02a9703.tar.bz2
samba-400f419580800020bc832412ef737116a02a9703.zip
r21036: Fix the ad nss info backend to not abort the search when called outside the idmap daemon
(This used to be commit 57160e3dd96a7a776389da604393c20a738202ea)
Diffstat (limited to 'source3')
-rw-r--r--source3/nsswitch/idmap_ad.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/source3/nsswitch/idmap_ad.c b/source3/nsswitch/idmap_ad.c
index 208ccc2d4d..a0ed084765 100644
--- a/source3/nsswitch/idmap_ad.c
+++ b/source3/nsswitch/idmap_ad.c
@@ -708,34 +708,28 @@ static NTSTATUS nss_ad_get_info( struct nss_domain_entry *e,
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;
}