summaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/db')
-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 8e69cd3e..5311545d 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 7a022923..39bb67a1 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