sysdb_sudo.h revision b0fa48b0d612b46a86e45f8e4b5d9feae9784c2b
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina Jakub Hrozek <jhrozek@redhat.com>
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina Copyright (C) 2011 Red Hat
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina This program is free software; you can redistribute it and/or modify
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina it under the terms of the GNU General Public License as published by
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina the Free Software Foundation; either version 3 of the License, or
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina (at your option) any later version.
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina This program is distributed in the hope that it will be useful,
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina but WITHOUT ANY WARRANTY; without even the implied warranty of
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina GNU General Public License for more details.
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina You should have received a copy of the GNU General Public License
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina along with this program. If not, see <http://www.gnu.org/licenses/>.
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina/* subdirs in cn=custom in sysdb. We don't store sudo stuff in sysdb directly
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina * b/c it's not name-service-switch data */
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina/* attribute of SUDORULE_SUBDIR
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina * should be true if we have downloaded all rules atleast once */
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina#define SYSDB_SUDO_AT_LAST_FULL_REFRESH "sudoLastFullRefreshTime"
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina/* sysdb attributes */
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina#define SYSDB_SUDO_CACHE_AT_COMMAND "sudoCommand"
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina#define SYSDB_SUDO_CACHE_AT_OPTION "sudoOption"
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina#define SYSDB_SUDO_CACHE_AT_RUNASUSER "sudoRunAsUser"
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina#define SYSDB_SUDO_CACHE_AT_RUNASGROUP "sudoRunAsGroup"
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina#define SYSDB_SUDO_CACHE_AT_NOTBEFORE "sudoNotBefore"
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina#define SYSDB_SUDO_CACHE_AT_NOTAFTER "sudoNotAfter"
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina/* When constructing a sysdb filter, OR these values to include.. */
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina#define SYSDB_SUDO_FILTER_NONE 0x00 /* no additional filter */
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina#define SYSDB_SUDO_FILTER_USERNAME 0x01 /* username */
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina#define SYSDB_SUDO_FILTER_GROUPS 0x04 /* groups */
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina#define SYSDB_SUDO_FILTER_NGRS 0x08 /* netgroups */
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina#define SYSDB_SUDO_FILTER_ONLY_EXPIRED 0x10 /* only expired */
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina#define SYSDB_SUDO_FILTER_INCLUDE_ALL 0x20 /* ALL */
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina#define SYSDB_SUDO_FILTER_INCLUDE_DFL 0x40 /* include cn=default */
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina#define SYSDB_SUDO_FILTER_USERINFO SYSDB_SUDO_FILTER_USERNAME \
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březinaerrno_t sysdb_sudo_filter_rules_by_time(TALLOC_CTX *mem_ctx,
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březinasysdb_get_sudo_filter(TALLOC_CTX *mem_ctx, const char *username,
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina uid_t uid, char **groupnames, unsigned int flags,
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březinasysdb_get_sudo_user_info(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb,
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březinaerrno_t sysdb_sudo_set_last_full_refresh(struct sysdb_ctx *sysdb,
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březinaerrno_t sysdb_sudo_get_last_full_refresh(struct sysdb_ctx *sysdb,
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březinaerrno_t sysdb_sudo_purge_byname(struct sysdb_ctx *sysdb,
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina const char *name);
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březinaerrno_t sysdb_sudo_purge_byfilter(struct sysdb_ctx *sysdb,
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina const char *filter);
2827b0d03f7b6bafa504d22a5d7ca39cbda048b3Pavel Březina#endif /* _SYSDB_SUDO_H_ */