[pve-devel] [PATCH access-control] handle % signs in $task->{status} before sprintf

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Jan 7 14:38:48 CET 2016


Partial fix for #861
---
 PVE/RPCEnvironment.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/PVE/RPCEnvironment.pm b/PVE/RPCEnvironment.pm
index 52c5f64..fa0c526 100644
--- a/PVE/RPCEnvironment.pm
+++ b/PVE/RPCEnvironment.pm
@@ -676,7 +676,8 @@ sub active_workers  {
 	my @arlist = ();
 	foreach my $task (@ta) {
 	    if (!$task->{saved}) {
-		$archive .= sprintf("$task->{upid} %08X $task->{status}\n", $task->{endtime});
+		my $status = ($task->{status} =~ s/%/%%/gr);
+		$archive .= sprintf("$task->{upid} %08X $status\n", $task->{endtime});
 		$save = 1;
 		push @arlist, $task;
 		$task->{saved} = 1;
-- 
2.1.4





More information about the pve-devel mailing list