diff options
author | Günther Deschner <gd@samba.org> | 2006-02-23 14:28:41 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:10:21 -0500 |
commit | 379bd6865f2fa46ea28024ad2bb2162ccfbb0db7 (patch) | |
tree | e0bac0a82a9c2e5059fb4fbf5af3993da7624658 /source3/nsswitch | |
parent | da8846ffef8e5f875e5ff9ce064192280634f490 (diff) | |
download | samba-379bd6865f2fa46ea28024ad2bb2162ccfbb0db7.tar.gz samba-379bd6865f2fa46ea28024ad2bb2162ccfbb0db7.tar.bz2 samba-379bd6865f2fa46ea28024ad2bb2162ccfbb0db7.zip |
r13657: Let winbindd try to obtain the gecos field from the msSFU30Gecos
attribute when "winbind nss info = sfu" is set. Fixes #3539.
Guenther
(This used to be commit ffce0461de130828345c44293e564ca03227607d)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r-- | source3/nsswitch/winbindd_ads.c | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/source3/nsswitch/winbindd_ads.c b/source3/nsswitch/winbindd_ads.c index a866365042..179659f86f 100644 --- a/source3/nsswitch/winbindd_ads.c +++ b/source3/nsswitch/winbindd_ads.c @@ -153,7 +153,8 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain, "name", "objectSid", "primaryGroupID", "sAMAccountType", ADS_ATTR_SFU_HOMEDIR_OID, - ADS_ATTR_SFU_SHELL_OID, + ADS_ATTR_SFU_SHELL_OID, + ADS_ATTR_SFU_GECOS_OID, NULL}; int i, count; ADS_STATUS rc; @@ -193,7 +194,7 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain, i = 0; for (msg = ads_first_entry(ads, res); msg; msg = ads_next_entry(ads, msg)) { - char *name, *gecos; + char *name, *gecos = NULL; char *homedir = NULL; char *shell = NULL; uint32 group; @@ -206,12 +207,18 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain, } name = ads_pull_username(ads, mem_ctx, msg); - gecos = ads_pull_string(ads, mem_ctx, msg, "name"); + if (use_nss_info("sfu")) { homedir = ads_pull_string(ads, mem_ctx, msg, ads->schema.sfu_homedir_attr); - shell = ads_pull_string(ads, mem_ctx, msg, - ads->schema.sfu_shell_attr); + shell = ads_pull_string(ads, mem_ctx, msg, + ads->schema.sfu_shell_attr); + gecos = ads_pull_string(ads, mem_ctx, msg, + ads->schema.sfu_gecos_attr); + } + + if (gecos == NULL) { + gecos = ads_pull_string(ads, mem_ctx, msg, "name"); } if (!ads_pull_sid(ads, msg, "objectSid", @@ -437,7 +444,8 @@ static NTSTATUS query_user(struct winbindd_domain *domain, "name", "primaryGroupID", ADS_ATTR_SFU_HOMEDIR_OID, - ADS_ATTR_SFU_SHELL_OID, + ADS_ATTR_SFU_SHELL_OID, + ADS_ATTR_SFU_GECOS_OID, NULL}; ADS_STATUS rc; int count; @@ -475,13 +483,18 @@ static NTSTATUS query_user(struct winbindd_domain *domain, } info->acct_name = ads_pull_username(ads, mem_ctx, msg); - info->full_name = ads_pull_string(ads, mem_ctx, msg, "name"); if (use_nss_info("sfu")) { - info->homedir = ads_pull_string(ads, mem_ctx, msg, - ads->schema.sfu_homedir_attr); - info->shell = ads_pull_string(ads, mem_ctx, msg, - ads->schema.sfu_shell_attr); + info->homedir = ads_pull_string(ads, mem_ctx, msg, + ads->schema.sfu_homedir_attr); + info->shell = ads_pull_string(ads, mem_ctx, msg, + ads->schema.sfu_shell_attr); + info->full_name = ads_pull_string(ads, mem_ctx, msg, + ads->schema.sfu_gecos_attr); + } + + if (info->full_name == NULL) { + info->full_name = ads_pull_string(ads, mem_ctx, msg, "name"); } if (!ads_pull_uint32(ads, msg, "primaryGroupID", &group_rid)) { |