diff options
author | Wayne Davison <wayned@samba.org> | 2006-08-31 20:30:16 +0000 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2006-08-31 20:30:16 +0000 |
commit | 4187572616d8cde172d418329053a2a67529c6ba (patch) | |
tree | e32277993992582d6f9017f2cc309bafcc66b957 /support | |
parent | ff43d8b4493836fd02d99fc376afe33ff22088db (diff) | |
download | android_external_rsync-4187572616d8cde172d418329053a2a67529c6ba.tar.gz android_external_rsync-4187572616d8cde172d418329053a2a67529c6ba.tar.bz2 android_external_rsync-4187572616d8cde172d418329053a2a67529c6ba.zip |
Fixed handling of filenames with an embedded $, @, or %.
Diffstat (limited to 'support')
-rwxr-xr-x | support/file-attr-restore | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/support/file-attr-restore b/support/file-attr-restore index 11d7524f..8c25310e 100755 --- a/support/file-attr-restore +++ b/support/file-attr-restore @@ -47,7 +47,9 @@ while (<>) { my($type, $perms, $owner, $group, $name) = /$detail_line/; die "Invalid input line $.:\n$_" unless defined $name; die "A filename is not properly escaped:\n$_" unless $name =~ /^[^"\\]*(\\(\d\d\d|\D)[^"\\]*)*$/; - my $fn = eval "\"$name\""; + my $fn = $name; + $fn =~ s/([\$\@\%])/\\$1/g; + $fn = eval "\"$fn\""; if ($type eq '-') { undef $type unless -f $fn; } elsif ($type eq 'd') { |