2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

Initial support filtering by user, group and host in cvtsudoers.

Currently forces alias expansion when a filter is applied and the
entire matching user or host list is printed, even the non-matching
entries.  This effectively allows you to grep sudoers by user, group
and host.
This commit is contained in:
Todd C. Miller
2018-03-21 12:24:11 -06:00
parent bc5e2d06a7
commit ff79de8592
10 changed files with 1090 additions and 128 deletions

View File

@@ -39,7 +39,7 @@
/*
* Globals
*/
struct rbtree *aliases;
static struct rbtree *aliases;
/*
* Comparison function for the red-black tree.
@@ -166,6 +166,20 @@ no_aliases(void)
debug_return_bool(rbisempty(aliases));
}
/*
* Replace the aliases tree with a new one, returns the old.
*/
struct rbtree *
replace_aliases(struct rbtree *new_aliases)
{
struct rbtree *old_aliases = aliases;
debug_decl(replace_aliases, SUDOERS_DEBUG_ALIAS)
aliases = new_aliases;
debug_return_ptr(old_aliases);
}
/*
* Free memory used by an alias struct and its members.
*/