Unfortunately, no. Running it just tells me:
/etc/sudoers: parsed OK
karol wrote:For VISUAL to have any effect, you need to remove the bang from '!env_editor'.
I removed the bang from '!env_editor' but it had no effect. A re-install of sudo also did not correct the problem. This is very strange. I guess I could try completely removing sudo and then install it. Is there anything I should be aware of before I remove and reinstall sudo?
Before doing that, you could get hold of a default sudoers file and run visudo with the -f option against it, to double check there's nothing untoward in your sudoers file.
]]>/etc/sudoers: parsed OK
For VISUAL to have any effect, you need to remove the bang from '!env_editor'.
I removed the bang from '!env_editor' but it had no effect. A re-install of sudo also did not correct the problem. This is very strange. I guess I could try completely removing sudo and then install it. Is there anything I should be aware of before I remove and reinstall sudo?
]]>visudo -c
provide any clues? That is, are you sure your sudoers file is OK?
]]>$ sudo VISUAL="/usr/bin/nano -p" visudo
and
Defaults editor="/usr/bin/nano -p", !env_editor
$ sudo visudo
work for me.
The link you googled is about minix; if you're using Arch Linux it should simply work, I have no idea why it doesn't.
]]>Defaults editor="/usr/bin/nano", !env_editor
Also, running any of the following still produces the internal error.
$ sudo VISUAL="/usr/bin/nano -p" visudo
$ sudo VISUAL="/usr/bin/nano" visudo
$ sudo visudo
# Set default EDITOR to vim, and do not allow visudo to use EDITOR/VISUAL.
#Defaults editor=/usr/bin/vim, !env_editor
Defaults editor=/usr/bin/nano, !env_editor
Using the options you posted I broke my visudo:
Defaults editor="/usr/bin/nano -p -X", !env_editor
# visudo
nano: invalid option -- 'X'
Usage: nano [OPTIONS] [[+LINE,COLUMN] FILE]...
Option GNU long option Meaning
-h, -? --help Show this message
+LINE,COLUMN Start at line LINE, column COLUMN
-A --smarthome Enable smart home key
-B --backup Save backups of existing files
-C <dir> --backupdir=<dir> Directory for saving unique backup files
-D --boldtext Use bold instead of reverse video text
-E --tabstospaces Convert typed tabs to spaces
-F --multibuffer Enable multiple file buffers
-H --historylog Log & read search/replace string history
-I --ignorercfiles Don't look at nanorc files
-K --rebindkeypad Fix numeric keypad key confusion problem
-L --nonewlines Don't add newlines to the ends of files
-N --noconvert Don't convert files from DOS/Mac format
-O --morespace Use one more line for editing
-Q <str> --quotestr=<str> Quoting string
-R --restricted Restricted mode
-S --smooth Scroll by line instead of half-screen
-T <#cols> --tabsize=<#cols> Set width of a tab to #cols columns
-U --quickblank Do quick statusbar blanking
-V --version Print version information and exit
-W --wordbounds Detect word boundaries more accurately
-Y <str> --syntax=<str> Syntax definition to use for coloring
-c --const Constantly show cursor position
-d --rebinddelete Fix Backspace/Delete confusion problem
-i --autoindent Automatically indent new lines
-k --cut Cut from cursor to end of line
-l --nofollow Don't follow symbolic links, overwrite
-m --mouse Enable the use of the mouse
-o <dir> --operatingdir=<dir> Set operating directory
-p --preserve Preserve XON (^Q) and XOFF (^S) keys
-q --quiet Silently ignore startup issues like rc file errors
-r <#cols> --fill=<#cols> Set wrapping point at column #cols
-s <prog> --speller=<prog> Enable alternate speller
-t --tempfile Auto save on exit, don't prompt
-u --undo Allow generic undo [EXPERIMENTAL]
-v --view View mode (read-only)
-w --nowrap Don't wrap long lines
-x --nohelp Don't show the two help lines
-z --suspend Enable suspension
-$ --softwrap Enable soft line wrapping
-a, -b, -e,
-f, -g, -j (ignored, for Pico compatibility)
visudo: /etc/sudoers.tmp unchanged
[name@Arch ~]$ sudo VISUAL="/usr/bin/nano -p -X" visudo
visudo: internal error, tried to emalloc2(0)
A search of the Arch forums did not turn up any other accounts of this error, and the Google results are equally sparse. The best discussion of the problem I found was on this site attributing the error to "the getgroups function always returns 0" and suggests fixing it in sudo 1.7.x with a patch. Since the most current version is sudo 1.8.7, I don't think this applies anymore, though.
I am stumped at how I got the error in the first place or how to fix it so I can safely change the sudo configurations. Any help would be greatly appreciated. Thanks in advance!
]]>