Lines Matching defs:rules
101 sort_sudo_rules(struct sysdb_attrs **rules, size_t count, bool lower_wins)
104 DEBUG(SSSDBG_TRACE_FUNC, "Sorting rules with lower-wins logic\n");
105 qsort(rules, count, sizeof(struct sysdb_attrs *),
108 DEBUG(SSSDBG_TRACE_FUNC, "Sorting rules with higher-wins logic\n");
109 qsort(rules, count, sizeof(struct sysdb_attrs *),
126 struct sysdb_attrs **rules;
137 /* rules are stored inside parent domain tree */
149 DEBUG(SSSDBG_CRIT_FAILURE, "Error looking up SUDO rules\n");
153 ret = sysdb_msg2attrs(tmp_ctx, count, msgs, &rules);
160 *_rules = talloc_steal(mem_ctx, rules);
203 struct sysdb_attrs **rules;
234 &rules, &num_rules);
249 ret = sysdb_attrs_add_string(rules[i], SYSDB_SUDO_CACHE_AT_USER, val);
256 *_rules = talloc_steal(mem_ctx, rules);
314 struct sysdb_attrs **rules;
346 rules = talloc_array(tmp_ctx, struct sysdb_attrs *, num_rules);
347 if (rules == NULL) {
354 rules[rule_iter] = talloc_steal(rules, user_rules[i]);
358 rules[rule_iter] = talloc_steal(rules, ng_rules[i]);
361 ret = sort_sudo_rules(rules, num_rules, inverse_order);
363 DEBUG(SSSDBG_OP_FAILURE, "Could not sort rules by sudoOrder\n");
367 *_rules = talloc_steal(mem_ctx, rules);
420 struct sysdb_attrs **rules;
427 DEBUG(SSSDBG_TRACE_FUNC, "Retrieving rules for [%s@%s]\n",
429 debug_name = "rules";
432 inverse_order, &rules, &num_rules);
440 ret = sudosrv_cached_defaults(mem_ctx, domain, &rules, &num_rules);
456 *_rules = rules;
489 struct sysdb_attrs **rules;
505 &rules, &num_rules);
508 "Unable to retrieve expired sudo rules [%d]: %s\n",
514 DEBUG(SSSDBG_TRACE_FUNC, "No expired rules were found for [%s@%s].\n",
520 DEBUG(SSSDBG_TRACE_INTERNAL, "Refreshing %d expired rules of [%s@%s]\n",
525 username, num_rules, rules);
570 "Some expired rules were removed from the server, scheduling "
613 struct sysdb_attrs **rules;
727 "Unable to refresh expired rules, we will return what is "
734 &state->rules, &state->num_rules);
754 *_rules = talloc_steal(mem_ctx, state->rules);