3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek Jakub Hrozek <jhrozek@redhat.com>
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek Copyright (C) 2011 Red Hat
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek This program is free software; you can redistribute it and/or modify
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek it under the terms of the GNU General Public License as published by
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek the Free Software Foundation; either version 3 of the License, or
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek (at your option) any later version.
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek This program is distributed in the hope that it will be useful,
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek but WITHOUT ANY WARRANTY; without even the implied warranty of
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek GNU General Public License for more details.
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek You should have received a copy of the GNU General Public License
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek along with this program. If not, see <http://www.gnu.org/licenses/>.
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek/* subdirs in cn=custom in sysdb. We don't store sudo stuff in sysdb directly
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek * b/c it's not name-service-switch data */
1a542b3698d8c42cf075b722f8838f106eb09fccPavel Březina/* attribute of SUDORULE_SUBDIR
1a542b3698d8c42cf075b722f8838f106eb09fccPavel Březina * should be true if we have downloaded all rules atleast once */
44749ce0c1fee9babee80060fa0db99eebb2ab51Pavel Březina#define SYSDB_SUDO_AT_LAST_FULL_REFRESH "sudoLastFullRefreshTime"
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek/* sysdb attributes */
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek#define SYSDB_SUDO_CACHE_AT_COMMAND "sudoCommand"
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek#define SYSDB_SUDO_CACHE_AT_RUNASUSER "sudoRunAsUser"
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek#define SYSDB_SUDO_CACHE_AT_RUNASGROUP "sudoRunAsGroup"
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek#define SYSDB_SUDO_CACHE_AT_NOTBEFORE "sudoNotBefore"
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek#define SYSDB_SUDO_CACHE_AT_NOTAFTER "sudoNotAfter"
a2057618f30a3c64bdffb35a2ef3c2ba148c8a03Pavel Březina/* sysdb ipa attributes */
a2057618f30a3c64bdffb35a2ef3c2ba148c8a03Pavel Březina#define SYSDB_IPA_SUDORULE_ENABLED "ipaEnabledFlag"
a2057618f30a3c64bdffb35a2ef3c2ba148c8a03Pavel Březina#define SYSDB_IPA_SUDORULE_RUNASUSER "ipaSudoRunAs"
a2057618f30a3c64bdffb35a2ef3c2ba148c8a03Pavel Březina#define SYSDB_IPA_SUDORULE_RUNASGROUP "ipaSudoRunAsGroup"
a2057618f30a3c64bdffb35a2ef3c2ba148c8a03Pavel Březina#define SYSDB_IPA_SUDORULE_ORIGCMD "originalMemberCommand"
a2057618f30a3c64bdffb35a2ef3c2ba148c8a03Pavel Březina#define SYSDB_IPA_SUDORULE_ALLOWCMD "memberAllowCmd"
a2057618f30a3c64bdffb35a2ef3c2ba148c8a03Pavel Březina#define SYSDB_IPA_SUDORULE_DENYCMD "memberDenyCmd"
a2057618f30a3c64bdffb35a2ef3c2ba148c8a03Pavel Březina#define SYSDB_IPA_SUDORULE_NOTAFTER "sudoNotAfter"
a2057618f30a3c64bdffb35a2ef3c2ba148c8a03Pavel Březina#define SYSDB_IPA_SUDORULE_NOTBEFORE "sudoNotBefore"
a2057618f30a3c64bdffb35a2ef3c2ba148c8a03Pavel Březina#define SYSDB_IPA_SUDORULE_SUDOORDER "sudoOrder"
a2057618f30a3c64bdffb35a2ef3c2ba148c8a03Pavel Březina#define SYSDB_IPA_SUDORULE_CMDCATEGORY "cmdCategory"
a2057618f30a3c64bdffb35a2ef3c2ba148c8a03Pavel Březina#define SYSDB_IPA_SUDORULE_HOSTCATEGORY "hostCategory"
a2057618f30a3c64bdffb35a2ef3c2ba148c8a03Pavel Březina#define SYSDB_IPA_SUDORULE_USERCATEGORY "userCategory"
a2057618f30a3c64bdffb35a2ef3c2ba148c8a03Pavel Březina#define SYSDB_IPA_SUDORULE_RUNASUSERCATEGORY "ipaSudoRunAsUserCategory"
a2057618f30a3c64bdffb35a2ef3c2ba148c8a03Pavel Březina#define SYSDB_IPA_SUDORULE_RUNASGROUPCATEGORY "ipaSudoRunAsGroupCategory"
a7d2b4f157194c14bc4a40c74f6416b82befa460Pavel Březina#define SYSDB_IPA_SUDORULE_RUNASEXTUSER "ipaSudoRunAsExtUser"
a7d2b4f157194c14bc4a40c74f6416b82befa460Pavel Březina#define SYSDB_IPA_SUDORULE_RUNASEXTGROUP "ipaSudoRunAsExtGroup"
a7d2b4f157194c14bc4a40c74f6416b82befa460Pavel Březina#define SYSDB_IPA_SUDORULE_RUNASEXTUSERGROUP "ipaSudoRunAsExtUserGroup"
991c9f47fcb24704b880f60ab8ee77cfda056e2cPavel Březina#define SYSDB_IPA_SUDORULE_EXTUSER "externalUser"
ed8650be18af26b7bf389e1246f7e8cdb363f829Pavel Březina#define SYSDB_IPA_SUDOCMDGROUP_OC "ipasudocmdgrp"
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek/* When constructing a sysdb filter, OR these values to include.. */
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek#define SYSDB_SUDO_FILTER_NONE 0x00 /* no additional filter */
f6171b2bc954a367f316853ab71090eb213bdee3Pavel Březina#define SYSDB_SUDO_FILTER_USERNAME 0x01 /* username */
f6171b2bc954a367f316853ab71090eb213bdee3Pavel Březina#define SYSDB_SUDO_FILTER_GROUPS 0x04 /* groups */
f6171b2bc954a367f316853ab71090eb213bdee3Pavel Březina#define SYSDB_SUDO_FILTER_NGRS 0x08 /* netgroups */
f7af8c5b369938725e47585c641ae5b017d442a1Pavel Březina#define SYSDB_SUDO_FILTER_ONLY_EXPIRED 0x10 /* only expired */
f6171b2bc954a367f316853ab71090eb213bdee3Pavel Březina#define SYSDB_SUDO_FILTER_INCLUDE_ALL 0x20 /* ALL */
f6171b2bc954a367f316853ab71090eb213bdee3Pavel Březina#define SYSDB_SUDO_FILTER_INCLUDE_DFL 0x40 /* include cn=default */
f6171b2bc954a367f316853ab71090eb213bdee3Pavel Březina#define SYSDB_SUDO_FILTER_USERINFO SYSDB_SUDO_FILTER_USERNAME \
c9aab1c04c399ca2d1abef74f6df22ced34983dcPavel Březinaerrno_t sysdb_sudo_filter_rules_by_time(TALLOC_CTX *mem_ctx,
61913b8f0d1ba54d82640500d7486fac5f72b030Pavel Březinasysdb_sudo_filter_defaults(TALLOC_CTX *mem_ctx);
61913b8f0d1ba54d82640500d7486fac5f72b030Pavel Březinasysdb_sudo_filter_netgroups(TALLOC_CTX *mem_ctx,
6a31a971a376a992afb838fe60b311360c970267Jakub Hrozekerrno_t sysdb_sudo_set_last_full_refresh(struct sss_domain_info *domain,
6a31a971a376a992afb838fe60b311360c970267Jakub Hrozekerrno_t sysdb_sudo_get_last_full_refresh(struct sss_domain_info *domain,
68abbe716bed7c8d6790d9bec168ef44469306a1Pavel Březinaerrno_t sysdb_sudo_purge(struct sss_domain_info *domain,
68abbe716bed7c8d6790d9bec168ef44469306a1Pavel Březinasysdb_sudo_store(struct sss_domain_info *domain,
e2d26e97d62f06f65e8228b28746471cc5f73fe5Petr Cech const char **attrs,
e2d26e97d62f06f65e8228b28746471cc5f73fe5Petr Cechsysdb_set_sudo_rule_attr(struct sss_domain_info *domain,
e2d26e97d62f06f65e8228b28746471cc5f73fe5Petr Cech const char *name,
3f98cdc011bb4e8cd22c088f288b0bcdb6452492Jakub Hrozek#endif /* _SYSDB_SUDO_H_ */