Bug 369188 - "bonsai shell_escape problem" [p=reed r=bear]
git-svn-id: svn://10.0.0.236/trunk@224427 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
4aa7eec6a5
commit
c2a9baf3c0
@ -1396,11 +1396,10 @@ sub Fix_BonsaiLink {
|
||||
return $bonsai_path;
|
||||
}
|
||||
|
||||
# Quotify a string, suitable for invoking a shell process
|
||||
# Only allow characters suitable for invoking a shell process
|
||||
sub shell_escape {
|
||||
my ($file) = @_;
|
||||
$file =~ s/\000/_NULL_/g;
|
||||
$file =~ s/([ \"\'\`\~\^\?\$\&\|\!<>\(\)\[\]\;\:])/\\$1/g;
|
||||
$file =~ tr/[^A-Za-z0-9\-\_\+\=\.\,]//;
|
||||
return $file;
|
||||
}
|
||||
|
||||
|
||||
@ -83,11 +83,11 @@ for my $k (@revs) {
|
||||
my $prevrev = &PrevRev($rev);
|
||||
my $fullname = "$cvsroot/$dir/$file,v";
|
||||
$fullname = "$cvsroot/$dir/Attic/$file,v" if (! -r $fullname);
|
||||
if (! -r $fullname || IsHidden($fullname)) {
|
||||
if (! -e $fullname || ! -r $fullname || IsHidden($fullname)) {
|
||||
next;
|
||||
}
|
||||
&ChrootFilename($cvsroot, $fullname);
|
||||
open( DIFF, "$rcsdiffcommand -r$prevrev -r$rev -u " . shell_escape($fullname) ." 2>&1|" ) || die "rcsdiff failed\n";
|
||||
open(DIFF, "-|", "$rcsdiffcommand -r$prevrev -r$rev -u " . shell_escape($fullname) . " 2>&1") || die "rcsdiff failed\n";
|
||||
while(<DIFF>){
|
||||
if (($_ =~ /RCS file/) || ($_ =~ /rcsdiff/)) {
|
||||
$_ =~ s/(^.*)(.*\/)(.*)/$1 $3/;
|
||||
|
||||
@ -414,11 +414,10 @@ sub value_encode {
|
||||
return $s;
|
||||
}
|
||||
|
||||
# Quotify a string, suitable for invoking a shell process
|
||||
# Only allow characters suitable for invoking a shell process
|
||||
sub shell_escape {
|
||||
my ($file) = @_;
|
||||
$file =~ s/\000/_NULL_/g;
|
||||
$file =~ s/([ \"\'\`\~\^\?\$\&\|\!<>\(\)\[\]\;\:])/\\$1/g;
|
||||
$file =~ tr/[^A-Za-z0-9\-\_\+\=\.\,]//;
|
||||
return $file;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user