exit(1);
}
my $client = $1;
-if ( $ARGV[1] !~ /^([\w\s\.\/\$-]+)$/ ) {
+if ( $ARGV[1] !~ /^([\w\s.\/$(){}[\]-]+)$/ ) {
print("$0: bad share name '$ARGV[1]'\n");
exit(1);
}
#
my($nRead);
#print("Reading $f->{name}, $f->{size} bytes, type $f->{type}\n");
- pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $f);
+ pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $file, $f);
my $poolWrite = BackupPC::PoolWrite->new($bpc,
"$OutDir/$ShareName/$f->{mangleName}",
$f->{size}, $Compress);
# a plain file.
#
$f->{size} = length($f->{linkname});
- pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $f);
+ pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $file, $f);
my $poolWrite = BackupPC::PoolWrite->new($bpc,
"$OutDir/$ShareName/$f->{mangleName}",
$f->{size}, $Compress);
# contents.
#
$f->{size} = length($f->{linkname});
- pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $f);
+ pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $file, $f);
my $poolWrite = BackupPC::PoolWrite->new($bpc,
"$OutDir/$ShareName/$f->{mangleName}",
$f->{size}, $Compress);
} else {
$data = "$f->{devmajor},$f->{devminor}";
}
- pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $f);
+ pathCreate($dir, "$OutDir/$ShareName/$f->{mangleName}", $file, $f);
my $poolWrite = BackupPC::PoolWrite->new($bpc,
"$OutDir/$ShareName/$f->{mangleName}",
length($data), $Compress);
#
sub pathCreate
{
- my($dir, $file, $f) = @_;
+ my($dir, $fullPath, $file, $f) = @_;
#
- # Get parent directory of each of $dir and $file
+ # Get parent directory of each of $dir and $fullPath
#
- $dir =~ s{/[^/]*$}{};
- $file =~ s{/[^/]*$}{};
- return if ( -d $file );
- mkpath($file, 0, 0777);
+ $dir =~ s{/[^/]*$}{};
+ $fullPath =~ s{/[^/]*$}{};
+ return if ( -d $fullPath );
+ mkpath($fullPath, 0, 0777);
+ $Attrib{$dir} = BackupPC::Attrib->new({ compress => $Compress })
+ if ( !defined($Attrib{$dir}) );
$Attrib{$dir}->set($file, {
type => BPC_FTYPE_DIR,
mode => 0755,