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

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Jan 7 14:39:12 CET 2016


Partial fix for #861
---
 src/PVE/INotify.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/PVE/INotify.pm b/src/PVE/INotify.pm
index 60610ce..0fb0cb0 100644
--- a/src/PVE/INotify.pm
+++ b/src/PVE/INotify.pm
@@ -647,8 +647,9 @@ sub write_active_workers {
 	my $upid = $task->{upid};
 	my $saved = $task->{saved} ? 1 : 0;
 	if ($task->{endtime}) {
-	    if ($task->{status}) {
-		$raw .= sprintf("$upid $saved %08X $task->{status}\n", $task->{endtime});
+	    if (my $status = $task->{status}) {
+		$status =~ s/%/%%/g;
+		$raw .= sprintf("$upid $saved %08X $status\n", $task->{endtime});
 	    } else {
 		$raw .= sprintf("$upid $saved %08X\n", $task->{endtime});
 	    }
-- 
2.1.4





More information about the pve-devel mailing list