summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-07-16 19:51:18 +0200
committerJakub Hrozek <jhrozek@redhat.com>2012-07-18 17:26:18 +0200
commitecfd767c65c39414a86937380b9986c6d2e0aecf (patch)
tree2d2203859ae30031f89731817ff0fe8153c2764f
parente432010244acda9c3eafccaee4f1d5965a899f81 (diff)
downloadsssd-ecfd767c65c39414a86937380b9986c6d2e0aecf.tar.gz
sssd-ecfd767c65c39414a86937380b9986c6d2e0aecf.tar.xz
sssd-ecfd767c65c39414a86937380b9986c6d2e0aecf.zip
SYSDB: Delete SELinux mappings
-rw-r--r--src/db/sysdb_selinux.c17
-rw-r--r--src/db/sysdb_selinux.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/src/db/sysdb_selinux.c b/src/db/sysdb_selinux.c
index 8e69cd3e2..5311545da 100644
--- a/src/db/sysdb_selinux.c
+++ b/src/db/sysdb_selinux.c
@@ -271,7 +271,24 @@ done:
return ret;
}
+errno_t sysdb_delete_usermaps(struct sysdb_ctx *sysdb)
+{
+ struct ldb_dn *dn = NULL;
+ errno_t ret;
+
+ dn = ldb_dn_new_fmt(sysdb, sysdb->ldb,
+ SYSDB_TMPL_SELINUX_BASE, sysdb->domain->name);
+ if (!dn) return ENOMEM;
+
+ ret = sysdb_delete_recursive(sysdb, dn, true);
+ talloc_free(dn);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("sysdb_delete_recursive failed.\n"));
+ return ret;
+ }
+ return EOK;
+}
/* --- SYSDB SELinux search routines --- */
errno_t sysdb_search_selinux_usermap_by_mapname(TALLOC_CTX *mem_ctx,
diff --git a/src/db/sysdb_selinux.h b/src/db/sysdb_selinux.h
index 7a0229236..39bb67a19 100644
--- a/src/db/sysdb_selinux.h
+++ b/src/db/sysdb_selinux.h
@@ -63,4 +63,6 @@ errno_t sysdb_search_selinux_config(TALLOC_CTX *mem_ctx,
const char **attrs,
struct ldb_message **_config);
+errno_t sysdb_delete_usermaps(struct sysdb_ctx *sysdb);
+
#endif