• E
    virsh: support VISUAL, and allow metacharacters in EDITOR · f3661756
    Eric Blake 提交于
    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.
    f3661756
virsh.c 267.3 KB