summaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-07 23:39:50 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-01-15 10:53:02 +0100
commita58ccee5afc802c7560624929614616aeefa9bd0 (patch)
treec007a5d2faaa1978740419e5978ce227b7b81640 /src/db
parent2b7ee2a760e7fcc70f4970a3bbee6fbf8f2ccb9d (diff)
downloadsssd-a58ccee5afc802c7560624929614616aeefa9bd0.tar.gz
sssd-a58ccee5afc802c7560624929614616aeefa9bd0.tar.bz2
sssd-a58ccee5afc802c7560624929614616aeefa9bd0.zip
Add domain argument to sysdb_delete_group()
Also remove sysdb_delete_domgroup()
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb.h4
-rw-r--r--src/db/sysdb_ops.c7
-rw-r--r--src/db/sysdb_subdomains.c15
3 files changed, 5 insertions, 21 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index 8ccf637a..ca82c78e 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -384,9 +384,6 @@ errno_t sysdb_master_domain_get_info(TALLOC_CTX *mem_ctx,
errno_t sysdb_master_domain_add_info(struct sysdb_ctx *sysdb,
struct sysdb_subdom *domain_info);
-errno_t sysdb_delete_domgroup(struct sss_domain_info *domain,
- const char *name, gid_t gid);
-
errno_t sysdb_get_ranges(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb,
size_t *range_count,
struct range_info ***range_list);
@@ -769,6 +766,7 @@ int sysdb_search_groups(TALLOC_CTX *mem_ctx,
struct ldb_message ***msgs);
int sysdb_delete_group(struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
const char *name, gid_t gid);
int sysdb_search_netgroups(TALLOC_CTX *mem_ctx,
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 37e6b682..a32f4183 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -1831,7 +1831,7 @@ int sysdb_store_group(struct sysdb_ctx *sysdb,
/* This may be a group rename. If there is a group with the
* same GID, remove it and try to add the basic group again
*/
- ret = sysdb_delete_group(sysdb, NULL, gid);
+ ret = sysdb_delete_group(sysdb, domain, NULL, gid);
if (ret == ENOENT) {
/* Not found by GID, return the original EEXIST,
* this may be a conflict in MPG domain or something
@@ -2562,6 +2562,7 @@ fail:
/* =Delete-Group-by-Name-OR-gid=========================================== */
int sysdb_delete_group(struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
const char *name, gid_t gid)
{
TALLOC_CTX *tmp_ctx;
@@ -2574,10 +2575,10 @@ int sysdb_delete_group(struct sysdb_ctx *sysdb,
}
if (name) {
- ret = sysdb_search_group_by_name(tmp_ctx, sysdb, sysdb->domain,
+ ret = sysdb_search_group_by_name(tmp_ctx, sysdb, domain,
name, NULL, &msg);
} else {
- ret = sysdb_search_group_by_gid(tmp_ctx, sysdb, sysdb->domain,
+ ret = sysdb_search_group_by_gid(tmp_ctx, sysdb, domain,
gid, NULL, &msg);
}
if (ret) {
diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c
index 10de8502..1f85b572 100644
--- a/src/db/sysdb_subdomains.c
+++ b/src/db/sysdb_subdomains.c
@@ -569,18 +569,3 @@ errno_t sysdb_get_subdomain_context(TALLOC_CTX *mem_ctx,
return EOK;
}
-
-#define CHECK_DOMAIN_INFO(dom_info) do { \
- if (dom_info == NULL || dom_info->sysdb == NULL) { \
- DEBUG(SSSDBG_OP_FAILURE, ("Invalid domain info.\n")); \
- return EINVAL; \
- } \
-} while(0)
-
-errno_t sysdb_delete_domgroup(struct sss_domain_info *domain,
- const char *name, gid_t gid)
-{
- CHECK_DOMAIN_INFO(domain);
-
- return sysdb_delete_group(domain->sysdb, name, gid);
-}