Bugzilla – Bug 942
visudo fails if $EDITOR contains quotes
Last modified: 2021-09-11 15:57:31 MDT
visudo fails if $EDITOR isn't a simple space-separated list of arguments. For example: # env EDITOR='sh -c "vi \$1"' visudo \$1": -c: line 0: unexpected EOF while looking for matching `"' \$1": -c: line 1: syntax error: unexpected end of file visudo: /etc/sudoers.tmp unchanged (This is a simplified example, but my actual use-case it to send a message to an already-running instance of Emacs to tell it to open visudo's temporary file. Background at https://github.com/magit/with-editor/issues/84)
Created attachment 547 [details] Patch to honor quotes in EDITOR and collapse backslashes. Can you try the following patch and verify that it fixes your use case? It can be applied to either sudo 1.9.3 or the current sources in mercurial or github.
Yes, the patch works for me. Thanks!
Fixed in sudo 1.9.4