The Samba-Bugzilla – Attachment 10392 Details for
Bug 10440
Lookup the user gecos field if samlogon doesn't provide it.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
allow giving nss_template_get_info a hint about the full_name (like for gid)
ads_full_name_hint_nss_template.patch (text/plain), 2.30 KB, created by
Michael Saxl
on 2014-10-31 09:21:43 UTC
(
hide
)
Description:
allow giving nss_template_get_info a hint about the full_name (like for gid)
Filename:
MIME Type:
Creator:
Michael Saxl
Created:
2014-10-31 09:21:43 UTC
Size:
2.30 KB
patch
obsolete
>--- a/source3/winbindd/nss_info_template.c >+++ b/source3/winbindd/nss_info_template.c >@@ -41,14 +41,16 @@ static NTSTATUS nss_template_get_info( s > const char **gecos, > gid_t *gid ) > { >- if ( !homedir || !shell || !gecos ) >+ /* gecos is not handled, like gid, so ignore it. It may be a >+ * hint for the cache, like gid >+ */ >+ if ( !homedir || !shell ) > return NT_STATUS_INVALID_PARAMETER; > > /* protect against home directories using whitespace in the > username */ > *homedir = talloc_strdup( ctx, lp_template_homedir() ); > *shell = talloc_strdup( ctx, lp_template_shell() ); >- *gecos = NULL; > > if ( !*homedir || !*shell ) { > return NT_STATUS_NO_MEMORY; >--- a/source3/winbindd/winbindd_ads.c >+++ b/source3/winbindd/winbindd_ads.c >@@ -355,6 +355,10 @@ static NTSTATUS query_user_list(struct w > struct wbint_userinfo *info = &((*pinfo)[i]); > const char *gecos = NULL; > gid_t primary_gid = (gid_t)-1; >+ /* set gecos if we know full_name already as a hint. nss_template does not >+ * handle gecos, so the cache would be filled incomplete >+ */ >+ if(info->full_name!=NULL) gecos = info->full_name; > > status = nss_get_info_cached(domain, &info->user_sid, mem_ctx, > &info->homedir, &info->shell, >@@ -368,6 +372,7 @@ static NTSTATUS query_user_list(struct w > } > > if (gecos != NULL) { >+ if (gecos != info->full_name) TALLOC_FREE(info->full_name); > info->full_name = gecos; > } > info->primary_gid = primary_gid; >@@ -637,6 +642,7 @@ static NTSTATUS query_user(struct winbin > sid_compose(&info->group_sid, &domain->sid, DOMAIN_RID_USERS ); > > /* Try to fill in what the nss_info backend can do */ >+ info->full_name=NULL; //we cannot get this offline, so we have no hint > > nss_get_info_cached( domain, sid, mem_ctx, > &info->homedir, &info->shell, &info->full_name, >@@ -701,6 +707,9 @@ static NTSTATUS query_user(struct winbin > ads_msgfree(ads, msg); > msg = NULL; > >+ /* give nss_get_info a hint */ >+ info->full_name = ads_name; >+ > status = nss_get_info_cached( domain, sid, mem_ctx, > &info->homedir, &info->shell, &info->full_name, > &gid); >@@ -713,7 +722,7 @@ static NTSTATUS query_user(struct winbin > > if (info->full_name == NULL) { > info->full_name = ads_name; >- } else { >+ } else if (info->full_name != ads_name) { > TALLOC_FREE(ads_name); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 10440
:
10289
| 10392 |
10438