Change alias_add() to return bool and set errno on failure.

This fixes a localization problem where the error message could
have been reported in the wrong locale.
This commit is contained in:
Todd C. Miller
2020-12-02 13:12:09 -07:00
parent e22817e3ab
commit d98374753c
5 changed files with 332 additions and 339 deletions

View File

@@ -298,7 +298,7 @@ struct cmnd_info {
struct rbtree *alloc_aliases(void);
void free_aliases(struct rbtree *aliases);
bool no_aliases(struct sudoers_parse_tree *parse_tree);
const char *alias_add(struct sudoers_parse_tree *parse_tree, char *name, int type, char *file, int line, int column, struct member *members);
bool alias_add(struct sudoers_parse_tree *parse_tree, char *name, int type, char *file, int line, int column, struct member *members);
const char *alias_type_to_string(int alias_type);
struct alias *alias_get(struct sudoers_parse_tree *parse_tree, const char *name, int type);
struct alias *alias_remove(struct sudoers_parse_tree *parse_tree, char *name, int type);