summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/db/sysdb.h6
-rw-r--r--src/db/sysdb_ops.c7
-rw-r--r--src/db/sysdb_subdomains.c11
-rw-r--r--src/responder/pac/pacsrv_cmd.c3
-rw-r--r--src/tests/sysdb-tests.c3
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,