[pve-devel] run_command and shellquote

Dietmar Maurer dietmar at proxmox.com
Tue Nov 4 07:08:57 CET 2014


> > Why does shell quoting make the command fail? I thought shell quoting should
> not have any effect on
> > how the command receives parameters?
> >
> This is the particular code:
> my @ssh_opts = ('-o', 'BatchMode=yes');
> my @ssh_cmd = ('/usr/bin/ssh', @ssh_opts);
> ....
> 
> my @params = ('set', "refreservation=$size", $path);
> my $target = 'root@' . $scfg->{portal};
> my $cmd = [@ssh_cmd, '-i', "$id_rsa_path/$scfg->{portal}_id_rsa",
> $target, 'zfs', @params];

Beside, we do not quote anything. The $cmd array is directly passed top open3():

    $pid = open3($writer, $reader, $error, @$cmd) || die $!;

So I cannot reproduce what you talk about.




More information about the pve-devel mailing list