Go to file
Thomas Lamprecht e5caa02e05 avoid harmful '<>' pattern, explicitly read from STDIN
Fixes problems in CLIHandler using the code pattern:

while (my $line = <>) {
    ...
}

For why this causes only _now_ problems lets first look how <>
behaves:

"The null filehandle <> is special: [...] Input from <> comes either
from standard input, or from each file listed on the command line.
Here's how it works: the first time <> is evaluated, the @ARGV array
is checked, and if it is empty, $ARGV[0] is set to "-" , which when
opened gives you standard input.  The @ARGV array is then processed
as a list of filenames." - 'perldoc perlop'

Recent changes in the CLIHandler code changed how we modfiied @ARGV
Earlier we assumed that the first argument must be the command and
thus shifted it out of @ARGV, now we can have multiple levels of
(sub)commands. This change also changed how we handle @ARGV, we do
not unshift anything but go through the arguments until we got to
the final command and copy the rest of @ARGV as we know that this
must be the commandos arguments.

For '<>' this means that ARGV was still fully populated and perl
tried to open element as a file, which naturally failed.
Thus the change in pve-common only exposed this 'dangerous' code
pattern.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-01-22 14:56:27 +01:00
debian bump version to 5.0-20 2018-01-16 14:27:43 +01:00
PVE avoid harmful '<>' pattern, explicitly read from STDIN 2018-01-22 14:56:27 +01:00
test Add tests for parse_ovf function 2017-09-25 13:31:55 +02:00
.gitignore add qm.bash-completion to .gitignore 2015-09-14 10:37:12 +02:00
bootsplash.jpg add seabios bootsplash and use it 2016-09-08 12:22:01 +02:00
bootsplash.xcf add seabios bootsplash and use it 2016-09-08 12:22:01 +02:00
Makefile bump version to 5.0-20 2018-01-16 14:27:43 +01:00
modules-load.conf remove unnecessary init.d, postint, postrm and qmupdate scripts 2015-02-27 16:09:41 +01:00
pcitest.pl use warnings instead of global -w flag 2013-10-01 13:14:49 +02:00
pve-bridge fix #909: pass rate to tap_plug() 2016-03-08 15:52:31 +01:00
pve-bridge-hotplug pve-bridge-hotplug code deduplication 2015-11-14 10:34:22 +01:00
pve-bridgedown add pve-bridgedown script 2014-05-08 08:37:04 +02:00
pve-q35.cfg fix syntax in pve-q35.cfg 2016-06-22 09:13:16 +02:00
pve-usb.cfg imported from svn 'qemu-server/pve2' 2011-08-23 07:47:04 +02:00
qm convert qmrestore into a PVE::CLI class 2015-10-05 13:10:24 +02:00
qmextract remove legacy sparsecp 2017-08-23 10:03:37 +02:00
qmrestore convert qmrestore into a PVE::CLI class 2015-10-05 13:10:24 +02:00