*/
extern int sudolineno, parse_error;
extern char *sudoers;
-int errorlineno = -1;
int clearaliases = TRUE;
int printmatches = FALSE;
int pedantic = FALSE;
int keepall = FALSE;
int quiet = FALSE;
int used_runas = FALSE;
+int errorlineno = -1;
+char *errorfile = NULL;
/*
* Alias types
const char *s;
{
/* Save the line the first error occurred on. */
- if (errorlineno == -1)
+ if (errorlineno == -1) {
errorlineno = sudolineno ? sudolineno - 1 : 0;
+ errorfile = estrdup(sudoers);
+ }
if (s && !quiet) {
#ifndef TRACELEXER
(void) fprintf(stderr, ">>> %s: %s, line %d <<<\n", sudoers, s,
int tgetpass_flags;
uid_t timestamp_uid;
extern int errorlineno;
+extern char *errorfile;
#if defined(RLIMIT_CORE) && !defined(SUDO_DEVEL)
static struct rlimit corelimit;
#endif /* RLIMIT_CORE && !SUDO_DEVEL */
}
if (ISSET(validated, VALIDATE_ERROR))
- log_error(0, "parse error in %s near line %d", _PATH_SUDOERS,
- errorlineno);
+ log_error(0, "parse error in %s near line %d", errorfile, errorlineno);
/* Is root even allowed to run sudo? */
if (user_uid == 0 && !def_root_sudo) {