sysdb_sudo.h revision e2d26e97d62f06f65e8228b28746471cc5f73fe5
/*
Authors:
Jakub Hrozek <jhrozek@redhat.com>
Copyright (C) 2011 Red Hat
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 <http://www.gnu.org/licenses/>.
*/
#ifndef _SYSDB_SUDO_H_
#define _SYSDB_SUDO_H_
/* subdirs in cn=custom in sysdb. We don't store sudo stuff in sysdb directly
* b/c it's not name-service-switch data */
#define SUDORULE_SUBDIR "sudorules"
/* attribute of SUDORULE_SUBDIR
* should be true if we have downloaded all rules atleast once */
#define SYSDB_SUDO_AT_REFRESHED "refreshed"
#define SYSDB_SUDO_AT_LAST_FULL_REFRESH "sudoLastFullRefreshTime"
/* sysdb attributes */
#define SYSDB_SUDO_CACHE_OC "sudoRule"
#define SYSDB_SUDO_CACHE_AT_CN "cn"
#define SYSDB_SUDO_CACHE_AT_USER "sudoUser"
#define SYSDB_SUDO_CACHE_AT_HOST "sudoHost"
#define SYSDB_SUDO_CACHE_AT_COMMAND "sudoCommand"
#define SYSDB_SUDO_CACHE_AT_OPTION "sudoOption"
#define SYSDB_SUDO_CACHE_AT_RUNAS "sudoRunAs"
#define SYSDB_SUDO_CACHE_AT_RUNASUSER "sudoRunAsUser"
#define SYSDB_SUDO_CACHE_AT_RUNASGROUP "sudoRunAsGroup"
#define SYSDB_SUDO_CACHE_AT_NOTBEFORE "sudoNotBefore"
#define SYSDB_SUDO_CACHE_AT_NOTAFTER "sudoNotAfter"
#define SYSDB_SUDO_CACHE_AT_ORDER "sudoOrder"
/* sysdb ipa attributes */
#define SYSDB_IPA_SUDORULE_OC "ipasudorule"
#define SYSDB_IPA_SUDORULE_ENABLED "ipaEnabledFlag"
#define SYSDB_IPA_SUDORULE_OPTION "ipaSudoOpt"
#define SYSDB_IPA_SUDORULE_RUNASUSER "ipaSudoRunAs"
#define SYSDB_IPA_SUDORULE_RUNASGROUP "ipaSudoRunAsGroup"
#define SYSDB_IPA_SUDORULE_ORIGCMD "originalMemberCommand"
#define SYSDB_IPA_SUDORULE_ALLOWCMD "memberAllowCmd"
#define SYSDB_IPA_SUDORULE_DENYCMD "memberDenyCmd"
#define SYSDB_IPA_SUDORULE_HOST "memberHost"
#define SYSDB_IPA_SUDORULE_USER "memberUser"
#define SYSDB_IPA_SUDORULE_NOTAFTER "sudoNotAfter"
#define SYSDB_IPA_SUDORULE_NOTBEFORE "sudoNotBefore"
#define SYSDB_IPA_SUDORULE_SUDOORDER "sudoOrder"
#define SYSDB_IPA_SUDORULE_CMDCATEGORY "cmdCategory"
#define SYSDB_IPA_SUDORULE_HOSTCATEGORY "hostCategory"
#define SYSDB_IPA_SUDORULE_USERCATEGORY "userCategory"
#define SYSDB_IPA_SUDORULE_RUNASUSERCATEGORY "ipaSudoRunAsUserCategory"
#define SYSDB_IPA_SUDORULE_RUNASGROUPCATEGORY "ipaSudoRunAsGroupCategory"
#define SYSDB_IPA_SUDORULE_RUNASEXTUSER "ipaSudoRunAsExtUser"
#define SYSDB_IPA_SUDORULE_RUNASEXTGROUP "ipaSudoRunAsExtGroup"
#define SYSDB_IPA_SUDORULE_RUNASEXTUSERGROUP "ipaSudoRunAsExtUserGroup"
#define SYSDB_IPA_SUDORULE_EXTUSER "externalUser"
#define SYSDB_IPA_SUDOCMDGROUP_OC "ipasudocmdgrp"
#define SYSDB_IPA_SUDOCMD_OC "ipasudocmd"
#define SYSDB_IPA_SUDOCMD_SUDOCMD "sudoCmd"
/* When constructing a sysdb filter, OR these values to include.. */
struct sysdb_attrs **in_rules,
struct sysdb_attrs ***_rules);
char **_filter);
struct sss_domain_info *domain,
char ***groupnames);
const char *delete_filter,
struct sysdb_attrs **rules,
struct sysdb_attrs **rules,
struct sss_domain_info *domain,
const char *sub_filter,
const char **attrs,
struct ldb_message ***_msgs);
const char *name,
struct sysdb_attrs *attrs,
int mod_op);
#endif /* _SYSDB_SUDO_H_ */