summaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2016-06-19 08:35:57 +0200
committerJakub Hrozek <jhrozek@redhat.com>2016-07-07 10:28:38 +0200
commit7c083e276ac40aa29bad6f04a950026697ea4f1d (patch)
tree648b22723351421b8efe364722b18364fc936cf1 /src/db
parentd62f7e644be93477fc869698f6eb3d55f08167a9 (diff)
downloadsssd-7c083e276ac40aa29bad6f04a950026697ea4f1d.tar.gz
sssd-7c083e276ac40aa29bad6f04a950026697ea4f1d.tar.xz
sssd-7c083e276ac40aa29bad6f04a950026697ea4f1d.zip
SYSDB: Construct internal fqnames, not NSS names in sysdb_add_group_member_overrides
Because all users and groups are stored the same way in sysdb, we can avoid parsing and unparsing the name with NSS functions and instead just grab the name from the FQDN in the cache. Reviewed-by: Sumit Bose <sbose@redhat.com>
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb_views.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/db/sysdb_views.c b/src/db/sysdb_views.c
index 7fc4ca37b..7adc15230 100644
--- a/src/db/sysdb_views.c
+++ b/src/db/sysdb_views.c
@@ -1458,11 +1458,11 @@ errno_t sysdb_add_group_member_overrides(struct sss_domain_info *domain,
NULL);
if (memberuid != NULL) {
- ret = sss_parse_name(tmp_ctx, domain->names, orig_name,
- &orig_domain, NULL);
+ ret = sss_parse_internal_fqname(tmp_ctx, orig_name,
+ NULL, &orig_domain);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE,
- "sss_parse_name failed to split original name [%s].\n",
+ "sss_parse_internal_fqname failed to split [%s].\n",
orig_name);
goto done;
}
@@ -1474,14 +1474,14 @@ errno_t sysdb_add_group_member_overrides(struct sss_domain_info *domain,
DEBUG(SSSDBG_CRIT_FAILURE,
"Cannot find domain with name [%s].\n",
orig_domain);
- ret = EINVAL;
+ ret = ERR_DOMAIN_NOT_FOUND;
goto done;
}
- memberuid = sss_get_domain_name(tmp_ctx, memberuid,
- orig_dom);
+ memberuid = sss_create_internal_fqname(tmp_ctx, memberuid,
+ orig_dom->name);
if (memberuid == NULL) {
DEBUG(SSSDBG_OP_FAILURE,
- "sss_get_domain_name failed.\n");
+ "sss_create_internal_fqname failed.\n");
ret = ENOMEM;
goto done;
}