Bugzilla – Bug 75
visudo fails if $EDITOR set
Last modified: 2002-04-03 11:40:45 MST
If env-editor is not defined and EDITOR environment variable is set to a valid editor (/usr/bin/vi), visudo fails with the following error: visudo: unable to run : No such file or directory visudo: sudoers file unchanged. This happens because Editor points to a EditorPath after it has been free'ed. Here's a patch that fixes this bug. --- visudo.c Fri Dec 14 21:52:48 200 +++ visudo.c.pablo Wed Apr 3 17:26:45 2002 @@ -315,6 +315,7 @@ && (editor_sb.st_mode & 0000111) && editor_sb.st_dev == user_editor_sb.st_dev && editor_sb.st_ino == user_editor_sb.st_ino) + Editor = estrdup(Editor); break; } } while ((Editor = strtok(NULL, ":")));
Ooops, embarrassing, this is already fixed in 1.6.5.