When spliting EDITOR check for escaped quote characters.

Also add check_editor to sudoers "make check".
This commit is contained in:
Todd C. Miller
2021-04-25 19:12:50 -06:00
parent 5e5131dec3
commit 6907376ae9
3 changed files with 20 additions and 4 deletions

View File

@@ -45,6 +45,15 @@ struct test_data {
5,
{ "sh", "-c", "vi $1", "--", "/etc/motd", NULL }
},
{
/* Try connecting to the emacs server, falling back on plain emacs. */
"VISUAL=sh -c \"emacsclient -a emacs -n \\\"\\$@\\\" || emacs \\\"\\$@\\\"\"",
1,
{ "/etc/motd", NULL },
"/usr/bin/sh",
5,
{ "sh", "-c", "emacsclient -a emacs -n \"$@\" || emacs \"$@\"", "--", "/etc/motd", NULL }
},
{
/* GitHub issue #99 */
"EDITOR=/usr/bin/vi\\",