diff options
author | Simo Sorce <simo@redhat.com> | 2013-01-06 18:27:50 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-01-15 10:49:20 +0100 |
commit | a5a4e5b4836fdd693bab6e1c7f9d633d1440447d (patch) | |
tree | a58ee3c7c5d78da5350817d5c02ede740a586f49 | |
parent | 2ce00e0d3896bb42db169d1e79553a81ca837a22 (diff) | |
download | sssd-a5a4e5b4836fdd693bab6e1c7f9d633d1440447d.tar.gz sssd-a5a4e5b4836fdd693bab6e1c7f9d633d1440447d.tar.bz2 sssd-a5a4e5b4836fdd693bab6e1c7f9d633d1440447d.zip |
Add domain to sysdb_search_user_by_uid()
Also remove unused sysdb_search_domuser_by_uid()
-rw-r--r-- | src/db/sysdb.h | 6 | ||||
-rw-r--r-- | src/db/sysdb_ops.c | 7 | ||||
-rw-r--r-- | src/db/sysdb_subdomains.c | 11 | ||||
-rw-r--r-- | src/responder/pac/pacsrv_cmd.c | 3 | ||||
-rw-r--r-- | src/tests/sysdb-tests.c | 3 |
5 files changed, 9 insertions, 21 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h index b744ac24..333c94ae 100644 --- a/src/db/sysdb.h +++ b/src/db/sysdb.h @@ -385,11 +385,6 @@ errno_t sysdb_master_domain_add_info(struct sysdb_ctx *sysdb, struct sysdb_subdom *domain_info); -errno_t sysdb_search_domuser_by_uid(TALLOC_CTX *mem_ctx, - struct sss_domain_info *domain, - uid_t uid, - const char **attrs, - struct ldb_message **msg); errno_t sysdb_store_domuser(struct sss_domain_info *domain, const char *name, const char *pwd, @@ -554,6 +549,7 @@ int sysdb_search_user_by_name(TALLOC_CTX *mem_ctx, int sysdb_search_user_by_uid(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, + struct sss_domain_info *domain, uid_t uid, const char **attrs, struct ldb_message **msg); diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c index 76f19878..2e361ec8 100644 --- a/src/db/sysdb_ops.c +++ b/src/db/sysdb_ops.c @@ -277,6 +277,7 @@ done: int sysdb_search_user_by_uid(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, + struct sss_domain_info *domain, uid_t uid, const char **attrs, struct ldb_message **msg) @@ -295,7 +296,7 @@ int sysdb_search_user_by_uid(TALLOC_CTX *mem_ctx, } basedn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, - SYSDB_TMPL_USER_BASE, sysdb->domain->name); + SYSDB_TMPL_USER_BASE, domain->name); if (!basedn) { ret = ENOMEM; goto done; @@ -1129,7 +1130,7 @@ int sysdb_add_user(struct sysdb_ctx *sysdb, /* check no other user with the same uid exist */ if (uid != 0) { - ret = sysdb_search_user_by_uid(tmp_ctx, sysdb, + ret = sysdb_search_user_by_uid(tmp_ctx, sysdb, domain, uid, NULL, &msg); if (ret != ENOENT) { if (ret == EOK) ret = EEXIST; @@ -2397,7 +2398,7 @@ int sysdb_delete_user(struct sysdb_ctx *sysdb, ret = sysdb_search_user_by_name(tmp_ctx, sysdb, sysdb->domain, name, NULL, &msg); } else { - ret = sysdb_search_user_by_uid(tmp_ctx, sysdb, + ret = sysdb_search_user_by_uid(tmp_ctx, sysdb, sysdb->domain, uid, NULL, &msg); } if (ret == EOK) { diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c index de5a6ac1..5943c1d1 100644 --- a/src/db/sysdb_subdomains.c +++ b/src/db/sysdb_subdomains.c @@ -577,17 +577,6 @@ errno_t sysdb_get_subdomain_context(TALLOC_CTX *mem_ctx, } \ } while(0) -errno_t sysdb_search_domuser_by_uid(TALLOC_CTX *mem_ctx, - struct sss_domain_info *domain, - uid_t uid, - const char **attrs, - struct ldb_message **msg) -{ - CHECK_DOMAIN_INFO(domain); - - return sysdb_search_user_by_uid(mem_ctx, domain->sysdb, uid, attrs, msg); -} - errno_t sysdb_store_domuser(struct sss_domain_info *domain, const char *name, const char *pwd, diff --git a/src/responder/pac/pacsrv_cmd.c b/src/responder/pac/pacsrv_cmd.c index 4d5755d5..3c053a7c 100644 --- a/src/responder/pac/pacsrv_cmd.c +++ b/src/responder/pac/pacsrv_cmd.c @@ -384,7 +384,8 @@ static errno_t save_pac_user(struct pac_req_ctx *pr_ctx) goto done; } - ret = sysdb_search_user_by_uid(tmp_ctx, sysdb, pwd->pw_uid, attrs, &msg); + ret = sysdb_search_user_by_uid(tmp_ctx, sysdb, pr_ctx->dom, + pwd->pw_uid, attrs, &msg); if (ret == EOK) { if (new_and_cached_user_differs(pwd, msg)) { ret = sysdb_delete_user(sysdb, NULL, pwd->pw_uid); diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c index 236c41aa..5337b4a6 100644 --- a/src/tests/sysdb-tests.c +++ b/src/tests/sysdb-tests.c @@ -4402,7 +4402,8 @@ START_TEST(test_sysdb_subdomain_user_ops) fail_unless(ldb_dn_compare(msg->dn, check_dn) == 0, "Unexpedted DN returned"); - ret = sysdb_search_domuser_by_uid(test_ctx, subdomain, 12345, NULL, &msg); + ret = sysdb_search_user_by_uid(test_ctx, subdomain->sysdb, subdomain, + 12345, NULL, &msg); fail_unless(ret == EOK, "sysdb_search_domuser_by_uid failed with [%d][%s].", ret, strerror(ret)); fail_unless(ldb_dn_compare(msg->dn, check_dn) == 0, |