cvtsudoers: merge aliases when multiple sudoers files are specified

Duplicate aliases are remove.  If there are conflicting alias names,
the conflicts are renamed by appending a numerical suffix.
For example, if there are two SERVERS Host_Aliases, the second one
will be renamed to SERVERS_1.
This commit is contained in:
Todd C. Miller
2021-11-19 12:29:21 -07:00
parent 33fbf59467
commit ab9e44a6ca
7 changed files with 600 additions and 27 deletions

View File

@@ -93,6 +93,9 @@ bool convert_sudoers_json(struct sudoers_parse_tree *parse_tree, const char *out
/* cvtsudoers_ldif.c */
bool convert_sudoers_ldif(struct sudoers_parse_tree *parse_tree, const char *output_file, struct cvtsudoers_config *conf);
/* cvtsudoers_merge.c */
struct sudoers_parse_tree *merge_sudoers(struct sudoers_parse_tree_list *parse_trees, struct sudoers_parse_tree *merged_tree);
/* cvtsudoers_pwutil.c */
struct cache_item *cvtsudoers_make_pwitem(uid_t uid, const char *name);
struct cache_item *cvtsudoers_make_gritem(gid_t gid, const char *name);