diff --git a/plugins/sudoers/gram.c b/plugins/sudoers/gram.c index c11b8edaa..7a74451eb 100644 --- a/plugins/sudoers/gram.c +++ b/plugins/sudoers/gram.c @@ -3135,8 +3135,8 @@ sudoerserror(const char *s) /* Warnings are displayed in the user's locale. */ sudoers_setlocale(SUDOERS_LOCALE_USER, &oldlocale); - sudo_printf(SUDO_CONV_ERROR_MSG, _("%s:%d: %s\n"), sudoers, - this_lineno, _(s)); + sudo_printf(SUDO_CONV_ERROR_MSG, _("%s:%d:%d: %s\n"), sudoers, + this_lineno, (int)sudolinebuf.toke_start + 1, _(s)); sudoers_setlocale(oldlocale, NULL); /* Display the offending line and token if possible. */ diff --git a/plugins/sudoers/gram.y b/plugins/sudoers/gram.y index cc9b2b9e0..0d4f8be93 100644 --- a/plugins/sudoers/gram.y +++ b/plugins/sudoers/gram.y @@ -1050,8 +1050,8 @@ sudoerserror(const char *s) /* Warnings are displayed in the user's locale. */ sudoers_setlocale(SUDOERS_LOCALE_USER, &oldlocale); - sudo_printf(SUDO_CONV_ERROR_MSG, _("%s:%d: %s\n"), sudoers, - this_lineno, _(s)); + sudo_printf(SUDO_CONV_ERROR_MSG, _("%s:%d:%d: %s\n"), sudoers, + this_lineno, (int)sudolinebuf.toke_start + 1, _(s)); sudoers_setlocale(oldlocale, NULL); /* Display the offending line and token if possible. */ diff --git a/plugins/sudoers/regress/testsudoers/test11.out.ok b/plugins/sudoers/regress/testsudoers/test11.out.ok index 8cf92ad22..987ab6559 100644 --- a/plugins/sudoers/regress/testsudoers/test11.out.ok +++ b/plugins/sudoers/regress/testsudoers/test11.out.ok @@ -1,6 +1,6 @@ Testing @include with garbage after the path name -sudoers:1: syntax error +sudoers:1:24: syntax error @include sudoers.local womp womp ^~~~ testsudoers: unable to stat sudoers.local: No such file or directory @@ -11,7 +11,7 @@ Command unmatched Testing #include with garbage after the path name -sudoers:1: syntax error +sudoers:1:24: syntax error #include sudoers.local womp womp ^~~~ testsudoers: unable to stat sudoers.local: No such file or directory diff --git a/plugins/sudoers/regress/testsudoers/test12.out.ok b/plugins/sudoers/regress/testsudoers/test12.out.ok index 5dd75fb19..93205dd47 100644 --- a/plugins/sudoers/regress/testsudoers/test12.out.ok +++ b/plugins/sudoers/regress/testsudoers/test12.out.ok @@ -1,12 +1,12 @@ Testing sudoers with multiple syntax errors -sudoers:1: syntax error +sudoers:1:20: syntax error User_Alias A1 = u1 u2 : A2 = u3, u4 ^~ -sudoers:3: syntax error +sudoers:3:26: syntax error millert ALL = /fail : foo ^ -sudoers:5: syntax error +sudoers:5:16: syntax error root ALL = ALL bar ^~~ diff --git a/plugins/sudoers/regress/testsudoers/test13.out.ok b/plugins/sudoers/regress/testsudoers/test13.out.ok index fbc86ecaf..2c131113c 100644 --- a/plugins/sudoers/regress/testsudoers/test13.out.ok +++ b/plugins/sudoers/regress/testsudoers/test13.out.ok @@ -1,21 +1,21 @@ Testing alias definitions using reserved words -sudoers:1: syntax error, reserved word used as an alias name +sudoers:1:12: syntax error, reserved word used as an alias name Cmnd_Alias ALL=ALL ^~~ -sudoers:2: syntax error, reserved word used as an alias name +sudoers:2:12: syntax error, reserved word used as an alias name Cmnd_Alias CHROOT=foo ^~~~~~ -sudoers:3: syntax error, reserved word used as an alias name +sudoers:3:12: syntax error, reserved word used as an alias name User_Alias TIMEOUT=foo ^~~~~~~ -sudoers:4: syntax error, reserved word used as an alias name +sudoers:4:13: syntax error, reserved word used as an alias name Runas_Alias CWD=bar ^~~ -sudoers:5: syntax error, reserved word used as an alias name +sudoers:5:12: syntax error, reserved word used as an alias name Host_Alias NOTBEFORE=baz ^~~~~~~~~ -sudoers:6: syntax error, reserved word used as an alias name +sudoers:6:12: syntax error, reserved word used as an alias name Host_Alias NOTAFTER=biff ^~~~~~~~