chiark / gitweb /
dgit-repos-server: Use shellquote() where appropriate in diagnostics
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 2 May 2015 19:10:03 +0000 (20:10 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 31 May 2015 10:54:09 +0000 (11:54 +0100)
infra/dgit-repos-server

index 63f9aac081df8284e08c4b8ae9304d4114ab9a8e..7925d04510515acc6cb16e0a51d8af00ec273e03 100755 (executable)
@@ -263,7 +263,7 @@ sub runcmd {
     debugcmd '+',@_;
     $!=0; $?=0;
     my $r = system @_;
-    die "@_ $? $!" if $r;
+    die (shellquote @_)." $? $!" if $r;
 }
 
 sub policyhook {
@@ -274,8 +274,9 @@ sub policyhook {
     debugcmd '+',@cmd;
     my $r = system @cmd;
     die "system: $!" if $r < 0;
-    die "hook (@cmd) failed ($?)" if $r & ~($policyallowbits << 8);
-    printdebug sprintf "hook (%s) => %#x\n", "@polargs", $r;
+    die "hook (".(shellquote @cmd).") failed ($?)"
+       if $r & ~($policyallowbits << 8);
+    printdebug sprintf "hook (%s) => %#x\n", (shellquote @polargs), $r;
     return $r >> 8;
 }
 
@@ -889,7 +890,7 @@ sub parseargsdispatch () {
     if ($ARGV[0] eq '--pre-receive-hook') {
        if ($debuglevel) {
            $debugprefix.="=";
-           printdebug "in stunthook @ARGV\n";
+           printdebug "in stunthook ".(shellquote @ARGV)."\n";
            foreach my $k (sort keys %ENV) {
                printdebug "$k=$ENV{$k}\n" if $k =~  m/^DGIT/;
            }