Re: shall libvirtd validate guest's name ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2015-07-09 at 17:19 +0800, zhang bo wrote:
> linux-ZyvZnF:~ # virsh list --all
>  Id    Name                           State
> ----------------------------------------------------
>  -     redhat7;reboot                 shut off
>  -     oscar-vm-5                     shut off
> 
> 
> As shown above, 
> 1 we use command "virsh define a.xml" to define a guest with a name 
> containing ';', that's 'redhat7;reboot'
> 2 then we start the guest: "virsh start redhat7;reboot"
> 3 shell consider the command as
>   a) run "virsh start redhat7", failed
>   b) run "reboot", to reboot the host
>   And *the host get rebooted*.
> 
> shall libvirtd do the guest-name-validation work? Or other 
> suggustions?

Proper usage of string escaping is the user's responsibility.
Unfortunately a lot of shell scripts get this wrong, leading
to more or less catastrophic results.

The same reasoning, by the way, applies to file names, and eg.
the Nautilus file manager happily allows me to use foo;reboot
as name when creating or renaming files...

Cheers.

-- 
Andrea Bolognani
Software Engineer - Virtualization Team

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]