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

Add a hook for sudoers parse errors (including defaults and aliases).

The hook can be used to log parser errors (sudoers module) or keep
track of which files have an error (visudo).
Previously, we only kept track of a single parse error.
This commit is contained in:
Todd C. Miller
2022-03-10 13:30:56 -07:00
parent 6ec279532e
commit d7ddff2a31
18 changed files with 504 additions and 522 deletions

View File

@@ -310,10 +310,6 @@ int pam_prep_user(struct passwd *);
/* gram.y */
int sudoersparse(void);
extern char *login_style;
extern char *errorfile;
extern int errorlineno;
extern int errorcolumn;
extern char *errorstring;
extern bool parse_error;
extern bool sudoers_warnings;
extern bool sudoers_recovery;
@@ -413,7 +409,7 @@ bool matches_env_pattern(const char *pattern, const char *var, bool *full_match)
/* sudoers.c */
FILE *open_sudoers(const char *, bool, bool *);
int set_cmnd_path(const char *runchroot);
int sudoers_init(void *info, char * const envp[]);
int sudoers_init(void *info, sudoers_logger_t logger, char * const envp[]);
int sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[], bool verbose, void *closure);
void sudoers_cleanup(void);
void sudo_user_free(void);