diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-07-18 15:57:28 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2015-07-19 19:36:15 +0100 |
commit | 067e68de07f7d1cf1d406c4917e9cdd7b0b6f26a (patch) | |
tree | 31bd56c94a18744c4c4d2e3db9184e402b83ebaf | |
parent | 6b9192c43040de5e0c18d0cd4057dcfb7457d86a (diff) |
Do some quoting on debug output (needed if the server might not be trustworthy and might send us bad stuff).
-rw-r--r-- | Debian/Dgit.pm | 9 | ||||
-rw-r--r-- | debian/changelog | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index 2938ae1..edb338c 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -173,8 +173,13 @@ sub cmdoutput_errok { die $! if P->error; if (!close P) { printdebug "=>!$?\n"; return undef; } chomp $d; - $d =~ m/^.*/; - printdebug "=> \`$&'",(length $' ? '...' : ''),"\n" if $debuglevel>0; #'; + if ($debuglevel > 0) { + $d =~ m/^.*/; + my $dd = $&; + my $more = (length $' ? '...' : ''); #'); + $dd =~ s{[^\n -~]|\\}{ sprintf "\\x%02x", ord $& }ge; + printdebug "=> \`$dd'",$more,"\n"; + } return $d; } diff --git a/debian/changelog b/debian/changelog index fd664d3..c6b28b5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,8 @@ dgit (0.31~~) unstable; urgency=low Access machinery: * Provide for different access mechanisms when pushing. * Provide for configurable git url suffix. + * Do some quoting on debug output (needed if the server might not + be trustworthy and might send us bad stuff). Infrastructure: * Provide for mirroring git updates to a different server. |