From 4c11f752e1f10cf5740d53a3206bb795e9e34fe8 Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Tue, 24 Jan 2012 06:21:07 -0500 Subject: Added some SELinux-related sysdb routines --- src/db/sysdb_selinux.h | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/db/sysdb_selinux.h (limited to 'src/db/sysdb_selinux.h') diff --git a/src/db/sysdb_selinux.h b/src/db/sysdb_selinux.h new file mode 100644 index 00000000..7a022923 --- /dev/null +++ b/src/db/sysdb_selinux.h @@ -0,0 +1,66 @@ +/* + SSSD + + System Database Header - SELinux support + + Copyright (C) Jan Zeleny 2012 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef __SYS_DB_SELINUX_H__ +#define __SYS_DB_SELINUX_H__ + +#include "db/sysdb.h" + +#define SYSDB_SELINUX_CONTAINER "cn=selinux" +#define SYSDB_TMPL_SELINUX_BASE SYSDB_SELINUX_CONTAINER",cn=%s,"SYSDB_BASE +#define SYSDB_TMPL_SEUSERMAP SYSDB_NAME"=%s,"SYSDB_TMPL_SELINUX_BASE + +#define SYSDB_SELINUX_NAME "config" +#define SYSDB_SELINUX_SEEALSO "seeAlso" +#define SYSDB_SELINUX_USER "selinuxUser" +#define SYSDB_SELINUX_ENABLED "enabled" +#define SYSDB_SELINUX_DEFAULT_USER "user" +#define SYSDB_SELINUX_DEFAULT_ORDER "order" + +enum selinux_entity_type { + SELINUX_CONFIG, + SELINUX_USER_MAP +}; + +errno_t sysdb_store_selinux_usermap(struct sysdb_ctx *sysdb, + struct sysdb_attrs *attrs); + +errno_t sysdb_store_selinux_config(struct sysdb_ctx *sysdb, + const char *default_map, + const char *order); + +errno_t sysdb_search_selinux_usermap_by_mapname(TALLOC_CTX *mem_ctx, + struct sysdb_ctx *sysdb, + 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, + const char *username, + struct ldb_message ***_usermaps); + +errno_t sysdb_search_selinux_config(TALLOC_CTX *mem_ctx, + struct sysdb_ctx *sysdb, + const char **attrs, + struct ldb_message **_config); + +#endif -- cgit