a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen Fabiano FidĂȘncio <fidencio@redhat.com>
d176f84ce5ca2073f4dfbafb457b9c74f6bf0d76Timo Sirainen Copyright (C) 2017 Red Hat
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen This program is free software; you can redistribute it and/or modify
along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "providers/ipa/ipa_deskprofile_rules_util.h"
#include "providers/ipa/ipa_deskprofile_private.h"
#include "providers/ipa/ipa_rules_common.h"
#include <ctype.h>
#include <fcntl.h>
* "/var/lib/sss/deskprofile/ipa.example/user_foobar/000420_000000_000420_000420_000000_testrule.json"
static errno_t
const char *rules_dir,
const char *domain,
const char *username,
const char *priority,
const char *user_priority,
const char *group_priority,
const char *host_priority,
const char *hostgroup_priority,
const char *rule_name,
const char *extension,
char **_filename_path)
NULL,
return ENOMEM;
goto done;
goto done;
for (int i = 0; i < DESKPROFILE_NAME_SENTINEL; i++) {
switch(perms[i]) {
case RULES_DIR:
case DOMAIN:
case USERNAME:
case PRIORITY:
case USER:
case GROUP:
case HOST:
case HOSTGROUP:
case RULE_NAME:
case EXTENSION:
goto done;
goto done;
done:
return ret;
return ENOMEM;
goto done;
goto done;
domain);
goto done;
goto done;
done:
return ret;
static errno_t
const char *name,
char **_rule_name)
buffer_len = 0;
replace = false;
replace = true;
buffer_len++;
return ENOMEM;
return EOK;
static errno_t
const char *rule_name,
const char *rule_prio,
const char *base_dn,
char **_user_prio,
char **_group_prio)
return ENOMEM;
goto done;
goto done;
goto done;
goto done;
num_groups = 0;
NULL);
num_groups++;
goto done;
goto done;
user = true;
goto done;
group = true;
goto done;
goto done;
done:
return ret;
static errno_t
const char *rule_name,
const char *rule_prio,
const char *base_dn,
const char *hostname,
char **_host_prio,
char **_hostgroup_prio)
return ENOMEM;
goto done;
goto done;
goto done;
num_memberhostgroup = 0;
&name);
data);
goto done;
goto done;
host = true;
goto done;
hostgroup = true;
goto done;
goto done;
done:
return ret;
const char *hostname,
return ENOMEM;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
if (ret < 0) {
goto done;
goto done;
goto done;
done:
orig_gid);
return ret;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
done:
return ret;
return ENOMEM;
goto done;
goto done;
done:
return ret;
goto done;
done:
return attrs;