diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2012-07-16 19:51:18 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2012-07-18 17:26:18 +0200 |
commit | ecfd767c65c39414a86937380b9986c6d2e0aecf (patch) | |
tree | 2d2203859ae30031f89731817ff0fe8153c2764f /src/db | |
parent | e432010244acda9c3eafccaee4f1d5965a899f81 (diff) | |
download | sssd-ecfd767c65c39414a86937380b9986c6d2e0aecf.tar.gz sssd-ecfd767c65c39414a86937380b9986c6d2e0aecf.tar.bz2 sssd-ecfd767c65c39414a86937380b9986c6d2e0aecf.zip |
SYSDB: Delete SELinux mappings
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/sysdb_selinux.c | 17 | ||||
-rw-r--r-- | src/db/sysdb_selinux.h | 2 |
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 |