summaryrefslogtreecommitdiffstats
path: root/src/db/sysdb.h
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-10-15 15:09:58 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-10-18 13:12:04 -0400
commit8059574092a96396dea64dae13696a7f95b423b1 (patch)
treec69fc5f4647e423446de5b0fa0196e5e3b236145 /src/db/sysdb.h
parent55769ee01eac9ce8ce55b29222f14e1c4362fc3c (diff)
downloadsssd-8059574092a96396dea64dae13696a7f95b423b1.tar.gz
sssd-8059574092a96396dea64dae13696a7f95b423b1.tar.xz
sssd-8059574092a96396dea64dae13696a7f95b423b1.zip
Modify sysdb_[add|remove]_group_member to accept users and groups
Previously, it assumed that all members were users. This changes the interface so that either a user or a group can be specified. Also, it eliminates the need for a memory context to be passed, since the internal memory should be self-contained.
Diffstat (limited to 'src/db/sysdb.h')
-rw-r--r--src/db/sysdb.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index a1baa20d9..2ca9527dc 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -527,20 +527,27 @@ int sysdb_store_group(TALLOC_CTX *mem_ctx,
struct sysdb_attrs *attrs,
uint64_t cache_timeout);
-int sysdb_add_group_member(TALLOC_CTX *mem_ctx,
- struct sysdb_ctx *ctx,
+enum sysdb_member_type {
+ SYSDB_MEMBER_USER,
+ SYSDB_MEMBER_GROUP
+};
+
+int sysdb_add_group_member(struct sysdb_ctx *ctx,
struct sss_domain_info *domain,
const char *group,
- const char *user);
+ const char *member,
+ enum sysdb_member_type type);
-int sysdb_remove_group_member(TALLOC_CTX *mem_ctx,
- struct sysdb_ctx *ctx,
+int sysdb_remove_group_member(struct sysdb_ctx *ctx,
struct sss_domain_info *domain,
const char *group,
- const char *user);
+ const char *member,
+ enum sysdb_member_type type);
+
errno_t sysdb_update_members(struct sysdb_ctx *sysdb,
struct sss_domain_info *domain,
- const char *user,
+ const char *member,
+ enum sysdb_member_type type,
const char **add_groups,
const char **del_groups);