You are not logged in.

#1 2013-06-29 12:49:52

cmorgenstern
Member
Registered: 2012-06-21
Posts: 40
Website

visudo internal error

I just decided to go in and change one of the configurations of the /etc/sudoers file, but running the appropriate commands to access the file returns the following error:

[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!


"Never ascribe to malice that which is adequately explained by incompetence."
~ Napoleon I

Offline

#2 2013-06-29 13:20:42

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: visudo internal error

I can easily use either vim or nano by setting them as the editor in 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

Last edited by karol (2013-06-29 13:25:29)

Offline

#3 2013-06-29 13:45:25

cmorgenstern
Member
Registered: 2012-06-21
Posts: 40
Website

Re: visudo internal error

Yes, you're right, the "-X" option I was listing was not valid for nano.  Still, I am getting the same error even though my default editor is set to nano in visudo without the improper option.

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

"Never ascribe to malice that which is adequately explained by incompetence."
~ Napoleon I

Offline

#4 2013-06-29 14:00:10

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: visudo internal error

For VISUAL to have any effect, you need to remove the bang from '!env_editor'.
Both

$ 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.

Offline

#5 2013-06-29 23:57:46

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: visudo internal error

Does

visudo -c

provide any clues? That is, are you sure your sudoers file is OK?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2013-07-02 14:43:55

cmorgenstern
Member
Registered: 2012-06-21
Posts: 40
Website

Re: visudo internal error

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?


"Never ascribe to malice that which is adequately explained by incompetence."
~ Napoleon I

Offline

#7 2013-07-02 15:07:39

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: visudo internal error

cmorgenstern wrote:

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.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

Board footer

Powered by FluxBB