From 3ca846cfb59dee6e20b94c4aee2716f1a20ebd3a Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 29 May 2013 00:56:53 +0200 Subject: 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. --- src/providers/ldap/sdap_async_users.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/providers/ldap/sdap_async_users.c') diff --git a/src/providers/ldap/sdap_async_users.c b/src/providers/ldap/sdap_async_users.c index 68e646cb..2c9fa293 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; -- cgit