git.samba.org
/
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
|
history
diff --git
a/support/file-attr-restore
b/support/file-attr-restore
index 11d7524f184c6a9ab7295c3f6416b3ad68442acd..8c25310e88d6efc04aaf7e12ff0e5e0112357a56 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') {