summaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-06 18:24:12 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-01-15 10:49:20 +0100
commit2ce00e0d3896bb42db169d1e79553a81ca837a22 (patch)
tree4680fe9905816d67d70169ccc378f41545db8352 /src/db
parent5d78919c955c945e78865f322726aac075c71203 (diff)
downloadsssd-2ce00e0d3896bb42db169d1e79553a81ca837a22.tar.gz
sssd-2ce00e0d3896bb42db169d1e79553a81ca837a22.tar.bz2
sssd-2ce00e0d3896bb42db169d1e79553a81ca837a22.zip
Add domain to sysdb_search_user_by_name()
Also remove unused sysdb_search_domuser_by_name()
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb.h6
-rw-r--r--src/db/sysdb_ops.c11
-rw-r--r--src/db/sysdb_selinux.c4
-rw-r--r--src/db/sysdb_subdomains.c11
-rw-r--r--src/db/sysdb_sudo.c4
5 files changed, 12 insertions, 24 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index 097e0a1a..b744ac24 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_name(TALLOC_CTX *mem_ctx,
- struct sss_domain_info *domain,
- const char *name,
- const char **attrs,
- struct ldb_message **msg);
errno_t sysdb_search_domuser_by_uid(TALLOC_CTX *mem_ctx,
struct sss_domain_info *domain,
uid_t uid,
@@ -552,6 +547,7 @@ int sysdb_search_entry(TALLOC_CTX *mem_ctx,
/* Search User (by uid or name) */
int sysdb_search_user_by_name(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
const char *name,
const char **attrs,
struct ldb_message **msg);
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 08d7734d..76f19878 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -233,6 +233,7 @@ int sysdb_search_entry(TALLOC_CTX *mem_ctx,
int sysdb_search_user_by_name(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
const char *name,
const char **attrs,
struct ldb_message **msg)
@@ -249,7 +250,7 @@ int sysdb_search_user_by_name(TALLOC_CTX *mem_ctx,
return ENOMEM;
}
- basedn = sysdb_user_dn(sysdb, tmp_ctx, sysdb->domain, name);
+ basedn = sysdb_user_dn(sysdb, tmp_ctx, domain, name);
if (!basedn) {
ret = ENOMEM;
goto done;
@@ -1295,7 +1296,7 @@ int sysdb_add_group(struct sysdb_ctx *sysdb,
* Don't worry about users, if we try to add a user with the same
* name the operation will fail */
- ret = sysdb_search_user_by_name(tmp_ctx, sysdb,
+ ret = sysdb_search_user_by_name(tmp_ctx, sysdb, domain,
name, NULL, &msg);
if (ret != ENOENT) {
if (ret == EOK) ret = EEXIST;
@@ -1640,7 +1641,7 @@ int sysdb_store_user(struct sysdb_ctx *sysdb,
in_transaction = true;
- ret = sysdb_search_user_by_name(tmp_ctx, sysdb,
+ ret = sysdb_search_user_by_name(tmp_ctx, sysdb, sysdb->domain,
name, NULL, &msg);
if (ret && ret != ENOENT) {
goto fail;
@@ -2393,7 +2394,7 @@ int sysdb_delete_user(struct sysdb_ctx *sysdb,
}
if (name) {
- ret = sysdb_search_user_by_name(tmp_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,
@@ -2817,7 +2818,7 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb,
return ret;
}
- ret = sysdb_search_user_by_name(tmp_ctx, sysdb,
+ ret = sysdb_search_user_by_name(tmp_ctx, sysdb, sysdb->domain,
name, attrs, &ldb_msg);
if (ret != EOK) {
DEBUG(1, ("sysdb_search_user_by_name failed [%d][%s].\n",
diff --git a/src/db/sysdb_selinux.c b/src/db/sysdb_selinux.c
index 44e87024..c1fb07fb 100644
--- a/src/db/sysdb_selinux.c
+++ b/src/db/sysdb_selinux.c
@@ -363,8 +363,10 @@ errno_t sysdb_search_selinux_usermap_by_username(TALLOC_CTX *mem_ctx,
return ENOMEM;
}
+ domain = sysdb->domain;
+
/* Now extract user attributes */
- ret = sss_selinux_extract_user(tmp_ctx, sysdb, username, &user);
+ ret = sss_selinux_extract_user(tmp_ctx, sysdb, domain, username, &user);
if (ret != EOK) {
goto done;
}
diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c
index 9f20ed59..de5a6ac1 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_name(TALLOC_CTX *mem_ctx,
- struct sss_domain_info *domain,
- const char *name,
- const char **attrs,
- struct ldb_message **msg)
-{
- CHECK_DOMAIN_INFO(domain);
-
- return sysdb_search_user_by_name(mem_ctx, domain->sysdb, name, attrs, msg);
-}
-
errno_t sysdb_search_domuser_by_uid(TALLOC_CTX *mem_ctx,
struct sss_domain_info *domain,
uid_t uid,
diff --git a/src/db/sysdb_sudo.c b/src/db/sysdb_sudo.c
index 9a8e76aa..43c17bd6 100644
--- a/src/db/sysdb_sudo.c
+++ b/src/db/sysdb_sudo.c
@@ -332,8 +332,8 @@ sysdb_get_sudo_user_info(TALLOC_CTX *mem_ctx, const char *username,
tmp_ctx = talloc_new(NULL);
NULL_CHECK(tmp_ctx, ret, done);
- ret = sysdb_search_user_by_name(tmp_ctx, sysdb, username,
- attrs, &msg);
+ ret = sysdb_search_user_by_name(tmp_ctx, sysdb, sysdb->domain,
+ username, attrs, &msg);
if (ret != EOK) {
DEBUG(SSSDBG_CRIT_FAILURE, ("Error looking up user %s\n", username));
goto done;