Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ff43d8b
)
Fixed handling of filenames with an embedded $, @, or %.
author
Wayne Davison
<wayned@samba.org>
Thu, 31 Aug 2006 20:30:16 +0000
(20:30 +0000)
committer
Wayne Davison
<wayned@samba.org>
Thu, 31 Aug 2006 20:30:16 +0000
(20:30 +0000)
support/file-attr-restore
patch
|
blob
|
blame
|
history
diff --git
a/support/file-attr-restore
b/support/file-attr-restore
index
11d7524
..
8c25310
100755
(executable)
--- 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') {