]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virsh: support VISUAL, and allow metacharacters in EDITOR
authorEric Blake <eblake@redhat.com>
Fri, 12 Mar 2010 16:33:22 +0000 (09:33 -0700)
committerEric Blake <eblake@redhat.com>
Mon, 29 Mar 2010 22:38:51 +0000 (16:38 -0600)
commitf3661756c1b6ab35789a5c9c14486034a9b58956
tree37129ab83ae4e08d1653c5c3ae8c9261404d673e
parentb522264b4000b30c16f78d93dea38292aadb1ebd
virsh: support VISUAL, and allow metacharacters in EDITOR

Common Unix practice is to prefer VISUAL over EDITOR, particularly if
the editor of choice spawns a new window.  Thus, it is also common to
see settings like EDITOR='emacs -nw', with the expectation that the
shell will parse this as an argument to 'emacs' and not try to invoke
a file containing a space.

If a user puts junk in EDITOR, they deserve what they get (much more
than virsh will misbehave); furthermore, sudo scrubs EDITOR by
default.  So the blind use of metacharacters in EDITOR should not be
considered too much of a security issue.

* tools/virsh.c (editFile): Prefer VISUAL over EDITOR.  Don't
reject shell metacharacters in EDITOR.
* tools/virsh.pod (edit, net-edit, ENVIRONMENT): Document VISUAL.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=487738.
tools/virsh.c
tools/virsh.pod