aboutsummaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2006-08-31 20:30:16 +0000
committerWayne Davison <wayned@samba.org>2006-08-31 20:30:16 +0000
commit4187572616d8cde172d418329053a2a67529c6ba (patch)
treee32277993992582d6f9017f2cc309bafcc66b957 /support
parentff43d8b4493836fd02d99fc376afe33ff22088db (diff)
downloadandroid_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-xsupport/file-attr-restore4
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') {