]> git.proxmox.com Git - pve-storage.git/commit
fix insecure migration failing if waiting on lock
authorMira Limbeck <m.limbeck@proxmox.com>
Wed, 17 Apr 2024 09:48:57 +0000 (11:48 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 17 Apr 2024 10:10:05 +0000 (12:10 +0200)
commitb6fc9de14ad8da71037f9bd3d63055cc1f517416
tree7cb3e642057aed3e4f40899b3de2bcfdde12e0d6
parentd47460eec7d2c5eaebf94be7fbe072be37780520
fix insecure migration failing if waiting on lock

both STDOUT and STDERR are written into `$info` which is then parsed for
IP and port of the target socket listening.
when the ports file can't be locked immediately `trying to acquire
lock...` is printed on STDERR and in turn written into `$info`.
trying to parse the IP then fails, resulting in a migration or
replication failing.

the bare open3 call is replaced by the run_command wrapper from
pve-common to use a safe wrapper around open3 with the same
functionality.
STDERR is read separatey from STDOUT and the last line of STDERR is
kept in case of errors.

Fixes: 57acd6a ("fix #1452: also log stderr of remote command with
insecure storage migration")

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
src/PVE/Storage.pm