diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2009-02-12 07:40:55 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2009-02-12 17:08:57 -0500 |
commit | 7c3629bc78edd79f557805176f3024eaf4fa51b1 (patch) | |
tree | 66c7eeaf934ef8c47300e13d747a1779ba3f7112 /server/db/sysdb.h | |
parent | 1e0f445f123f3ee96260989895f3ba558697d152 (diff) | |
download | sssd-7c3629bc78edd79f557805176f3024eaf4fa51b1.tar.gz sssd-7c3629bc78edd79f557805176f3024eaf4fa51b1.tar.xz sssd-7c3629bc78edd79f557805176f3024eaf4fa51b1.zip |
Add support for removing members from groups. Updated convenience functions for adding/removing user accounts and POSIX groups to the groups.
Also modified the add/remove member functions to be a single
interface taking a flag for add or removal, since the code only
differs by one LDB flag.
Added associated unit tests.
Diffstat (limited to 'server/db/sysdb.h')
-rw-r--r-- | server/db/sysdb.h | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/server/db/sysdb.h b/server/db/sysdb.h index 014e2ce91..656cb8fe1 100644 --- a/server/db/sysdb.h +++ b/server/db/sysdb.h @@ -82,6 +82,13 @@ struct confdb_ctx; typedef void (*sysdb_callback_t)(void *, int, struct ldb_result *); +enum sysdb_flags { + SYSDB_FLAG_MOD_NONE = 0, + SYSDB_FLAG_MOD_ADD, + SYSDB_FLAG_MOD_DELETE, + SYSDB_FLAG_MOD_MODIFY +}; + int sysdb_init(TALLOC_CTX *mem_ctx, struct event_context *ev, struct confdb_ctx *cdb, @@ -155,20 +162,24 @@ int sysdb_store_group_posix(TALLOC_CTX *memctx, const char *domain, const char *name, gid_t gid); -int sysdb_add_acct_to_posix_group(TALLOC_CTX *mem_ctx, - struct sysdb_ctx *sysdb, - const char *domain, - const char *gname, - const char *username); - -int sysdb_add_group_to_posix_group(TALLOC_CTX *mem_ctx, - struct sysdb_ctx *sysdb, - const char *domain, - const char *group, - const char *member_group); - -int sysdb_add_member_to_posix_group(TALLOC_CTX *mem_ctx, - struct sysdb_ctx *sysdb, - struct ldb_dn *member_dn, - struct ldb_dn *group_dn); +int sysdb_add_remove_posix_group_acct(TALLOC_CTX *mem_ctx, + struct sysdb_ctx *sysdb, + int flag, + const char *domain, + const char *group, + const char *username); + +/* Wrapper around adding a POSIX group to a POSIX group */ +int sysdb_add_remove_posix_group_group(TALLOC_CTX *mem_ctx, + struct sysdb_ctx *sysdb, + int flag, + const char *domain, + const char *group, + const char *member_group); + +int sysdb_add_remove_posix_group_member(TALLOC_CTX *mem_ctx, + struct sysdb_ctx *sysdb, + int flag, + struct ldb_dn *member_dn, + struct ldb_dn *group_dn); #endif /* __SYS_DB_H__ */ |