+++ This bug was initially created as a clone of Bug #1197885 +++
Description of problem:
visudo ignores the -q (quiet) option and prints out syntax errors.
Version-Release number of selected component (if applicable):
Also in the version present in RHEL 7.0
Any sort of syntax error or warning present in sudoers file. As an example:
Remove a ")" resulting in a syntax error:
## Same thing without a password
%wheel ALL=(ALL NOPASSWD: ALL
Steps to Reproduce:
1. Create syntax error in /etc/sudoers
2. Run 'visudo -c -q'
visudo -c -q
visudo: >>> /etc/sudoers: syntax error near line 108 <<<
parse error in /etc/sudoers near line 108
No output, with an exit value of 1
Based on a code review it does not appear to be honoring the '-q' flag
It's initialized to false to start:
* Arg handling.
checkonly = oldperms = quiet = strict = false;
Then when the args get parsed:
strict = true; /* strict mode */
quiet = false; /* quiet mode */
quiet doesn't appear to ever be set to true.
Found some upstream references that this flag was broken in 1.8.6,
which both RHEL 6 and RHEL 7 are based off.
Created attachment 1181645 [details]
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.