From 2ce00e0d3896bb42db169d1e79553a81ca837a22 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 6 Jan 2013 18:24:12 -0500 Subject: Add domain to sysdb_search_user_by_name() Also remove unused sysdb_search_domuser_by_name() --- src/db/sysdb_ops.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/db/sysdb_ops.c') 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", -- cgit