f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio/*
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio SSSD
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio Authors:
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio Fabiano Fidêncio <fidencio@redhat.com>
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio Copyright (C) 2017 Red Hat
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio This program is free software; you can redistribute it and/or modify
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio it under the terms of the GNU General Public License as published by
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio the Free Software Foundation; either version 3 of the License, or
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio (at your option) any later version.
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio This program is distributed in the hope that it will be useful,
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio but WITHOUT ANY WARRANTY; without even the implied warranty of
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio GNU General Public License for more details.
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio You should have received a copy of the GNU General Public License
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio along with this program. If not, see <http://www.gnu.org/licenses/>.
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio*/
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio#ifndef IPA_DESKPROFILE_RULES_UTIL_H_
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio#define IPA_DESKPROFILE_RULES_UTIL_H_
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio#include "db/sysdb.h"
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio#ifndef IPA_DESKPROFILE_RULES_USER_DIR
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio#define IPA_DESKPROFILE_RULES_USER_DIR SSS_STATEDIR"/deskprofile"
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio#endif /* IPA_DESKPROFILE_RULES_USER_DIR */
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncioerrno_t
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncioipa_deskprofile_rules_create_user_dir(
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio const char *username, /* fully-qualified */
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio uid_t uid,
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio gid_t gid);
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncioerrno_t
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncioipa_deskprofile_rules_save_rule_to_disk(
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio TALLOC_CTX *mem_ctx,
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio uint16_t priority,
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio struct sysdb_attrs *rule,
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio struct sss_domain_info *domain,
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio const char *hostname,
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio const char *username, /* fully-qualified */
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio uid_t uid,
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio gid_t gid);
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncioerrno_t
1a011c4f20e80f2bcb4d10a4d690b3a88c2fd70dFabiano Fidêncioipa_deskprofile_rules_remove_user_dir(const char *user_dir,
1a011c4f20e80f2bcb4d10a4d690b3a88c2fd70dFabiano Fidêncio uid_t uid,
1a011c4f20e80f2bcb4d10a4d690b3a88c2fd70dFabiano Fidêncio gid_t gid);
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncioerrno_t
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidênciodeskprofile_get_cached_priority(struct sss_domain_info *domain,
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio uint16_t *_priority);
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncioconst char **
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidênciodeskprofile_get_attrs_to_get_cached_rules(TALLOC_CTX *mem_ctx);
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio#endif /* IPA_DESKPROFILE_RULES_UTIL_H_ */