From: Volker Lendecke Date: Tue, 2 Feb 2016 13:41:16 +0000 (+0100) Subject: winbind: Fix a type error X-Git-Tag: ldb-1.1.26~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=db64deb6819b814ffb49901aa00ef8fb7e480787;p=thirdparty%2Fsamba.git winbind: Fix a type error nss_info_methods has "get_nss_info"'s p_gid parameter as gid_t *, not uint32_t *. Probably that did not hurt due to typedefs, but if we find a platform where gid_t is not uint32_t, this would be VERY hard to debug Signed-off-by: Volker Lendecke Reviewed-by: Andreas Schneider --- diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c index bc9d785bb41..df1d3695ebb 100644 --- a/source3/winbindd/idmap_ad.c +++ b/source3/winbindd/idmap_ad.c @@ -672,7 +672,7 @@ static NTSTATUS nss_ad_get_info( struct nss_domain_entry *e, const char **homedir, const char **shell, const char **gecos, - uint32_t *gid ) + gid_t *p_gid ) { const char *attrs[] = {NULL, /* attr_homedir */ NULL, /* attr_shell */ @@ -741,9 +741,18 @@ static NTSTATUS nss_ad_get_info( struct nss_domain_entry *e, *shell = ads_pull_string(ctx->ads, mem_ctx, msg_internal, ctx->ad_schema->posix_shell_attr); *gecos = ads_pull_string(ctx->ads, mem_ctx, msg_internal, ctx->ad_schema->posix_gecos_attr); - if (gid) { - if (!ads_pull_uint32(ctx->ads, msg_internal, ctx->ad_schema->posix_gidnumber_attr, gid)) - *gid = (uint32_t)-1; + if (p_gid != NULL) { + uint32_t gid = UINT32_MAX; + bool ok; + + ok = ads_pull_uint32(ctx->ads, msg_internal, + ctx->ad_schema->posix_gidnumber_attr, + &gid); + if (ok) { + *p_gid = gid; + } else { + *p_gid = (gid_t)-1; + } } nt_status = NT_STATUS_OK;