summaryrefslogtreecommitdiffstats
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-28 14:45:37 +0100
commitfac2e9f6f7551bf5bce89605cdb0672871613ca6 (patch)
treef9cf4707cf6735f45055bae0faa17375d7433d8b
parentba04f0b2e26e50af2598d02e2a9e9a56c47dce1f (diff)
downloadsssd-fac2e9f6f7551bf5bce89605cdb0672871613ca6.tar.gz
sssd-fac2e9f6f7551bf5bce89605cdb0672871613ca6.tar.xz
sssd-fac2e9f6f7551bf5bce89605cdb0672871613ca6.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.
-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 48d184a86..d706740df 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;
@@ -83,6 +84,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;