diff options
author | Andreas Schneider <asn@samba.org> | 2014-07-03 16:17:46 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2014-07-15 18:25:28 +0200 |
commit | 776c7ed0f505be4f17d884c9ee3c40ae6c722b2a (patch) | |
tree | 3fd0065f384ac078703063cd2f9f1f65fa9ae9e2 | |
parent | e0128fd07e31b3e93c38d35731d9fc15048089d7 (diff) | |
download | samba-776c7ed0f505be4f17d884c9ee3c40ae6c722b2a.tar.gz samba-776c7ed0f505be4f17d884c9ee3c40ae6c722b2a.tar.xz samba-776c7ed0f505be4f17d884c9ee3c40ae6c722b2a.zip |
samlogon_cache: avoid overwriting info3->base.full_name.string.
This field servers as a source for the gecos field. We should not overwrite it
when a info3 struct from a samlogon network level gets saved in which case this
field is always NULL.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10440
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Tue Jul 15 18:25:28 CEST 2014 on sn-devel-104
-rw-r--r-- | source3/libsmb/samlogon_cache.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source3/libsmb/samlogon_cache.c b/source3/libsmb/samlogon_cache.c index f7457aedc6..0a157d4846 100644 --- a/source3/libsmb/samlogon_cache.c +++ b/source3/libsmb/samlogon_cache.c @@ -149,6 +149,20 @@ bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3) /* Prepare data */ + if (info3->base.full_name.string == NULL) { + struct netr_SamInfo3 *cached_info3; + const char *full_name = NULL; + + cached_info3 = netsamlogon_cache_get(tmp_ctx, &user_sid); + if (cached_info3 != NULL) { + full_name = cached_info3->base.full_name.string; + } + + if (full_name != NULL) { + info3->base.full_name.string = talloc_strdup(info3, full_name); + } + } + /* only Samba fills in the username, not sure why NT doesn't */ /* so we fill it in since winbindd_getpwnam() makes use of it */ |