summaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-11-12 11:08:12 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-11-15 20:19:27 +0100
commit7a1a56860993475d0025e7411547649abf09d32c (patch)
tree6198ab4f152dd4fa17b9eb5c500a15c91407069e /src/db
parentc1284d966d351e5c42fb23a0d0ef6c268a11b7f8 (diff)
downloadsssd-7a1a56860993475d0025e7411547649abf09d32c.tar.gz
sssd-7a1a56860993475d0025e7411547649abf09d32c.tar.xz
sssd-7a1a56860993475d0025e7411547649abf09d32c.zip
Merge ipa_selinux_common.c and ipa_selinux.c
Moved unused functions and merged ipa_selinux_common.c into ipa_selinux.c
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb_selinux.c61
-rw-r--r--src/db/sysdb_selinux.h18
2 files changed, 4 insertions, 75 deletions
diff --git a/src/db/sysdb_selinux.c b/src/db/sysdb_selinux.c
index 80cfe5390..905b43a79 100644
--- a/src/db/sysdb_selinux.c
+++ b/src/db/sysdb_selinux.c
@@ -24,6 +24,10 @@
#include "db/sysdb_private.h"
/* Some generic routines */
+enum selinux_entity_type {
+ SELINUX_CONFIG,
+ SELINUX_USER_MAP
+};
static errno_t
sysdb_add_selinux_entity(struct sysdb_ctx *sysdb,
@@ -240,63 +244,6 @@ errno_t sysdb_delete_usermaps(struct sysdb_ctx *sysdb,
}
/* --- SYSDB SELinux search routines --- */
-errno_t sysdb_search_selinux_usermap_by_mapname(TALLOC_CTX *mem_ctx,
- struct sysdb_ctx *sysdb,
- struct sss_domain_info *domain,
- const char *name,
- const char **attrs,
- struct ldb_message **_usermap)
-{
- TALLOC_CTX *tmp_ctx;
- const char *def_attrs[] = { SYSDB_NAME,
- SYSDB_USER_CATEGORY,
- SYSDB_HOST_CATEGORY,
- SYSDB_ORIG_MEMBER_USER,
- SYSDB_ORIG_MEMBER_HOST,
- SYSDB_SELINUX_USER,
- NULL };
- struct ldb_message **msgs = NULL;
- struct ldb_dn *basedn;
- size_t msgs_count = 0;
- char *clean_name;
- int ret;
-
- tmp_ctx = talloc_new(NULL);
- if (!tmp_ctx) {
- return ENOMEM;
- }
-
- ret = sysdb_dn_sanitize(tmp_ctx, name, &clean_name);
- if (ret != EOK) {
- goto done;
- }
-
- basedn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_SEUSERMAP,
- clean_name, domain->name);
- if (!basedn) {
- ret = ENOMEM;
- goto done;
- }
-
- ret = sysdb_search_entry(tmp_ctx, sysdb, basedn, LDB_SCOPE_BASE, NULL,
- attrs?attrs:def_attrs, &msgs_count, &msgs);
- if (ret) {
- goto done;
- }
-
- *_usermap = talloc_steal(mem_ctx, msgs[0]);
-
-done:
- if (ret == ENOENT) {
- DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n"));
- }
- else if (ret) {
- DEBUG(SSSDBG_TRACE_FUNC, ("Error: %d (%s)\n", ret, strerror(ret)));
- }
- talloc_zfree(tmp_ctx);
- return ret;
-}
-
errno_t
sysdb_get_selinux_usermaps(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
diff --git a/src/db/sysdb_selinux.h b/src/db/sysdb_selinux.h
index 752f2206f..a40e7b52f 100644
--- a/src/db/sysdb_selinux.h
+++ b/src/db/sysdb_selinux.h
@@ -36,11 +36,6 @@
#define SYSDB_SELINUX_DEFAULT_ORDER "order"
#define SYSDB_SELINUX_HOST_PRIORITY "hostPriority"
-enum selinux_entity_type {
- SELINUX_CONFIG,
- SELINUX_USER_MAP
-};
-
errno_t sysdb_store_selinux_usermap(struct sysdb_ctx *sysdb,
struct sss_domain_info *domain,
struct sysdb_attrs *attrs);
@@ -57,19 +52,6 @@ errno_t sysdb_get_selinux_usermaps(TALLOC_CTX *mem_ctx,
size_t *count,
struct ldb_message ***messages);
-errno_t sysdb_search_selinux_usermap_by_mapname(TALLOC_CTX *mem_ctx,
- struct sysdb_ctx *sysdb,
- struct sss_domain_info *domain,
- const char *name,
- const char **attrs,
- struct ldb_message **_usermap);
-
-errno_t sysdb_search_selinux_usermap_by_username(TALLOC_CTX *mem_ctx,
- struct sysdb_ctx *sysdb,
- struct sss_domain_info *domain,
- const char *username,
- struct ldb_message ***_usermaps);
-
errno_t sysdb_search_selinux_config(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
struct sss_domain_info *domain,