diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2013-05-29 00:56:53 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-06-07 00:14:13 +0200 |
commit | 3ca846cfb59dee6e20b94c4aee2716f1a20ebd3a (patch) | |
tree | 9cc777431457b2f827864a8b744b019534aec33c /src/providers/ldap/sdap_async_users.c | |
parent | 556040eac686265f8a3b20e2a744210607cba95c (diff) | |
download | sssd-3ca846cfb59dee6e20b94c4aee2716f1a20ebd3a.tar.gz sssd-3ca846cfb59dee6e20b94c4aee2716f1a20ebd3a.tar.xz sssd-3ca846cfb59dee6e20b94c4aee2716f1a20ebd3a.zip |
LDAP: store FQDNs for trusted users and groups
Because the NSS responder expects the name attribute to contain FQDN,
we must save the name as FQDN in the LDAP provider if the domain we save
to is a subdomain.
Diffstat (limited to 'src/providers/ldap/sdap_async_users.c')
-rw-r--r-- | src/providers/ldap/sdap_async_users.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/providers/ldap/sdap_async_users.c b/src/providers/ldap/sdap_async_users.c index 68e646cb9..2c9fa2939 100644 --- a/src/providers/ldap/sdap_async_users.c +++ b/src/providers/ldap/sdap_async_users.c @@ -44,6 +44,7 @@ int sdap_save_user(TALLOC_CTX *memctx, struct ldb_message_element *el; int ret; const char *name = NULL; + const char *user_name = NULL; const char *fullname = NULL; const char *pwd; const char *gecos; @@ -381,7 +382,7 @@ int sdap_save_user(TALLOC_CTX *memctx, } } - ret = sdap_save_all_names(name, attrs, !dom->case_sensitive, user_attrs); + ret = sdap_save_all_names(name, attrs, dom, user_attrs); if (ret != EOK) { DEBUG(1, ("Failed to save user names\n")); goto done; @@ -398,7 +399,14 @@ int sdap_save_user(TALLOC_CTX *memctx, DEBUG(6, ("Storing info for user %s\n", name)); - ret = sysdb_store_user(ctx, dom, name, pwd, uid, gid, + user_name = sss_get_domain_name(tmpctx, name, dom); + if (!user_name) { + DEBUG(SSSDBG_OP_FAILURE, ("failed to format user name,\n")); + ret = ENOMEM; + goto done; + } + + ret = sysdb_store_user(ctx, dom, user_name, pwd, uid, gid, gecos, homedir, shell, orig_dn, user_attrs, missing, cache_timeout, now); if (ret) goto done; |