4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny/*
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny SSSD
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny System Database Header - SELinux support
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny Copyright (C) Jan Zeleny <jzeleny@redhat.com> 2012
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny This program is free software; you can redistribute it and/or modify
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny it under the terms of the GNU General Public License as published by
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny the Free Software Foundation; either version 3 of the License, or
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny (at your option) any later version.
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny This program is distributed in the hope that it will be useful,
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny but WITHOUT ANY WARRANTY; without even the implied warranty of
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny GNU General Public License for more details.
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny You should have received a copy of the GNU General Public License
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny along with this program. If not, see <http://www.gnu.org/licenses/>.
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny*/
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny#ifndef __SYS_DB_SELINUX_H__
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny#define __SYS_DB_SELINUX_H__
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny#include "db/sysdb.h"
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny#define SYSDB_SELINUX_CONTAINER "cn=selinux"
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny#define SYSDB_TMPL_SELINUX_BASE SYSDB_SELINUX_CONTAINER",cn=%s,"SYSDB_BASE
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny#define SYSDB_TMPL_SEUSERMAP SYSDB_NAME"=%s,"SYSDB_TMPL_SELINUX_BASE
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny#define SYSDB_SELINUX_NAME "config"
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny#define SYSDB_SELINUX_SEEALSO "seeAlso"
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny#define SYSDB_SELINUX_USER "selinuxUser"
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny#define SYSDB_SELINUX_ENABLED "enabled"
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny#define SYSDB_SELINUX_DEFAULT_USER "user"
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny#define SYSDB_SELINUX_DEFAULT_ORDER "order"
8338d6727eb33ccdc1c2b77e6b4d38220587b9d2Jakub Hrozek#define SYSDB_SELINUX_HOST_PRIORITY "hostPriority"
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny
17759fc794c22898d1db609b736fbcd77536d150Jakub Hrozekerrno_t sysdb_store_selinux_usermap(struct sss_domain_info *domain,
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny struct sysdb_attrs *attrs);
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny
17759fc794c22898d1db609b736fbcd77536d150Jakub Hrozekerrno_t sysdb_store_selinux_config(struct sss_domain_info *domain,
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny const char *default_map,
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny const char *order);
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny
6f0daa807ac0bb560353c5d5e25638cf1972f79fJakub Hrozekerrno_t sysdb_get_selinux_usermaps(TALLOC_CTX *mem_ctx,
740870643f337ce70d85f25f9ed057cd1f91028cSimo Sorce struct sss_domain_info *domain,
6f0daa807ac0bb560353c5d5e25638cf1972f79fJakub Hrozek const char **attrs,
6f0daa807ac0bb560353c5d5e25638cf1972f79fJakub Hrozek size_t *count,
6f0daa807ac0bb560353c5d5e25638cf1972f79fJakub Hrozek struct ldb_message ***messages);
6f0daa807ac0bb560353c5d5e25638cf1972f79fJakub Hrozek
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zelenyerrno_t sysdb_search_selinux_config(TALLOC_CTX *mem_ctx,
740870643f337ce70d85f25f9ed057cd1f91028cSimo Sorce struct sss_domain_info *domain,
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny const char **attrs,
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny struct ldb_message **_config);
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny
17759fc794c22898d1db609b736fbcd77536d150Jakub Hrozekerrno_t sysdb_delete_usermaps(struct sss_domain_info *domain);
ecfd767c65c39414a86937380b9986c6d2e0aecfJakub Hrozek
4c11f752e1f10cf5740d53a3206bb795e9e34fe8Jan Zeleny#endif