diff options
author | Michal Zidek <mzidek@redhat.com> | 2016-06-15 16:53:54 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2016-07-07 10:24:50 +0200 |
commit | 095c198509601e30281d64becebdf47171a2f5b4 (patch) | |
tree | 281d2c6eac1411fd8c09c5c50a346b3f95dfb191 /src/db | |
parent | 66acb466af7493a05bf6292f01747c4e8abcc3ef (diff) | |
download | sssd-095c198509601e30281d64becebdf47171a2f5b4.tar.gz sssd-095c198509601e30281d64becebdf47171a2f5b4.tar.xz sssd-095c198509601e30281d64becebdf47171a2f5b4.zip |
SYSDB: Search functions don't need to construct per-domain names
All user and group names are standardized to be fully qualified, so
there's no need to provide per-domain names anymore.
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/sysdb_search.c | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/src/db/sysdb_search.c b/src/db/sysdb_search.c index ce30e61c3..e40b36c38 100644 --- a/src/db/sysdb_search.c +++ b/src/db/sysdb_search.c @@ -190,7 +190,6 @@ int sysdb_getpwnam(TALLOC_CTX *mem_ctx, struct ldb_result *res; char *sanitized_name; char *lc_sanitized_name; - const char *src_name; int ret; tmp_ctx = talloc_new(NULL); @@ -204,15 +203,7 @@ int sysdb_getpwnam(TALLOC_CTX *mem_ctx, goto done; } - /* If this is a subdomain we need to use fully qualified names for the - * search as well by default */ - src_name = sss_get_domain_name(tmp_ctx, name, domain); - if (!src_name) { - ret = ENOMEM; - goto done; - } - - ret = sss_filter_sanitize_for_dom(tmp_ctx, src_name, domain, + ret = sss_filter_sanitize_for_dom(tmp_ctx, name, domain, &sanitized_name, &lc_sanitized_name); if (ret != EOK) { goto done; @@ -839,7 +830,6 @@ int sysdb_getgrnam(TALLOC_CTX *mem_ctx, char *sanitized_name; struct ldb_dn *base_dn; struct ldb_result *res; - const char *src_name; char *lc_sanitized_name; int ret; @@ -861,15 +851,7 @@ int sysdb_getgrnam(TALLOC_CTX *mem_ctx, goto done; } - /* If this is a subomain we need to use fully qualified names for the - * search as well by default */ - src_name = sss_get_domain_name(tmp_ctx, name, domain); - if (!src_name) { - ret = ENOMEM; - goto done; - } - - ret = sss_filter_sanitize_for_dom(tmp_ctx, src_name, domain, + ret = sss_filter_sanitize_for_dom(tmp_ctx, name, domain, &sanitized_name, &lc_sanitized_name); if (ret != EOK) { goto done; @@ -1497,7 +1479,6 @@ int sysdb_get_user_attr(TALLOC_CTX *mem_ctx, TALLOC_CTX *tmp_ctx; struct ldb_dn *base_dn; struct ldb_result *res; - const char *src_name; char *sanitized_name; char *lc_sanitized_name; int ret; @@ -1513,15 +1494,7 @@ int sysdb_get_user_attr(TALLOC_CTX *mem_ctx, goto done; } - /* If this is a subdomain we need to use fully qualified names for the - * search as well by default */ - src_name = sss_get_domain_name(tmp_ctx, name, domain); - if (!src_name) { - ret = ENOMEM; - goto done; - } - - ret = sss_filter_sanitize_for_dom(tmp_ctx, src_name, domain, + ret = sss_filter_sanitize_for_dom(tmp_ctx, name, domain, &sanitized_name, &lc_sanitized_name); if (ret != EOK) { goto done; |