summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2012-10-26 16:13:57 +0200
committerJakub Hrozek <jhrozek@redhat.com>2012-11-08 10:38:01 +0100
commitec2102d767bd658668d59db0954013c9c20c15dd (patch)
treee44d6f70e9ed87ed502ad87db1afb46f75b5d529 /src
parent33cbb789ff71be5dccbb4a0acd68814b0d53da34 (diff)
downloadsssd-ec2102d767bd658668d59db0954013c9c20c15dd.tar.gz
sssd-ec2102d767bd658668d59db0954013c9c20c15dd.tar.xz
sssd-ec2102d767bd658668d59db0954013c9c20c15dd.zip
do not default fullname to gecos when schema = ad
https://fedorahosted.org/sssd/ticket/1482 When we add fullname to user_attrs, then sysdb_add_basic_user() will set fullname to gecos when it initially creates the user object in the cache, but it will be overwritten in the same transaction when sysdb_store_user() adds all the user_attrs.
Diffstat (limited to 'src')
-rw-r--r--src/providers/ldap/sdap_async_users.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_async_users.c b/src/providers/ldap/sdap_async_users.c
index 8974e6a24..e2e7b72d8 100644
--- a/src/providers/ldap/sdap_async_users.c
+++ b/src/providers/ldap/sdap_async_users.c
@@ -42,6 +42,7 @@ int sdap_save_user(TALLOC_CTX *memctx,
struct ldb_message_element *el;
int ret;
const char *name = NULL;
+ const char *fullname = NULL;
const char *pwd;
const char *gecos;
const char *homedir;
@@ -82,6 +83,19 @@ int sdap_save_user(TALLOC_CTX *memctx,
goto fail;
}
+ if (opts->schema_type == SDAP_SCHEMA_AD) {
+ ret = sysdb_attrs_get_string(attrs,
+ opts->user_map[SDAP_AT_USER_FULLNAME].sys_name, &fullname);
+ if (ret == EOK) {
+ ret = sysdb_attrs_add_string(user_attrs, SYSDB_FULLNAME, fullname);
+ if (ret != EOK) {
+ goto fail;
+ }
+ } else if (ret != ENOENT) {
+ goto fail;
+ }
+ }
+
ret = sysdb_attrs_get_el(attrs,
opts->user_map[SDAP_AT_USER_PWD].sys_name, &el);
if (ret) goto fail;