summaryrefslogtreecommitdiff
path: root/src/db/sysdb_ops.c
diff options
context:
space:
mode:
authorJan Zeleny <jzeleny@redhat.com>2012-02-21 07:07:30 -0500
committerStephen Gallagher <sgallagh@redhat.com>2012-02-24 14:58:26 -0500
commit277a0187190fd417696590b303a5d7a204ed0555 (patch)
treea06e000f6b5e9f88b61f7907c32a8e698a298733 /src/db/sysdb_ops.c
parentce162d4a207d8f63a31587e84e86ad4bea986cf2 (diff)
downloadsssd-277a0187190fd417696590b303a5d7a204ed0555.tar.gz
sssd-277a0187190fd417696590b303a5d7a204ed0555.tar.bz2
sssd-277a0187190fd417696590b303a5d7a204ed0555.zip
Delete missing attributes from netgroups to be stored
https://fedorahosted.org/sssd/ticket/1136
Diffstat (limited to 'src/db/sysdb_ops.c')
-rw-r--r--src/db/sysdb_ops.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 7606b8f0..59b3bcae 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -1378,6 +1378,7 @@ int sysdb_add_netgroup(struct sysdb_ctx *sysdb,
const char *name,
const char *description,
struct sysdb_attrs *attrs,
+ char **missing,
int cache_timeout,
time_t now)
{
@@ -1422,6 +1423,15 @@ int sysdb_add_netgroup(struct sysdb_ctx *sysdb,
ret = sysdb_set_netgroup_attr(sysdb, name, attrs, SYSDB_MOD_REP);
+ if (missing) {
+ ret = sysdb_remove_attrs(sysdb, name,
+ SYSDB_MEMBER_NETGROUP,
+ missing);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_MINOR_FAILURE, ("Could not remove missing attributes\n"));
+ }
+ }
+
done:
if (ret == EOK) {
ret = ldb_transaction_commit(sysdb->ldb);
@@ -2956,6 +2966,10 @@ errno_t sysdb_remove_attrs(struct sysdb_ctx *sysdb,
msg->dn = sysdb_group_dn(sysdb, msg, sysdb->domain->name, name);
break;
+ case SYSDB_MEMBER_NETGROUP:
+ msg->dn = sysdb_netgroup_dn(sysdb, msg, sysdb->domain->name, name);
+ break;
+
case SYSDB_MEMBER_SERVICE:
msg->dn = sysdb_svc_dn(sysdb, msg, sysdb->domain->name, name);
break;