From: cbarratt Date: Fri, 7 Feb 2003 05:50:20 +0000 (+0000) Subject: - Fixed rsync is case of shareName = '/' X-Git-Tag: v2_0_0beta0~6 X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=commitdiff_plain;h=8a5f496e93ee77491746cb72ef9949ab91c82dae;hp=bd5c45421b5719f1f2419ddab7df55567b0ce0fc - Fixed rsync is case of shareName = '/' - Repaired host name regex to correctly allow '-' in host name - Added sshPath to Pre/Post command vars - Ensured child exited after failed exec for Pre/Post commands - Added space before $I_option in Smb. - Made $I_option a listref, rather than string, for Smb --- diff --git a/bin/BackupPC_dump b/bin/BackupPC_dump index 0b46c90..bc09e4e 100755 --- a/bin/BackupPC_dump +++ b/bin/BackupPC_dump @@ -102,7 +102,7 @@ if ( @ARGV != 1 ) { print("usage: $0 [-d] [-e] [-f] [-i] \n"); exit(1); } -if ( $ARGV[0] !~ /^([\w\.-\s]+)$/ ) { +if ( $ARGV[0] !~ /^([\w\.\s-]+)$/ ) { print("$0: bad client name '$ARGV[0]'\n"); exit(1); } @@ -121,7 +121,7 @@ if ( $opts{d} ) { $hostIP = $client; exit(1) if ( $bpc->CheckHostAlive($hostIP) < 0 ); ($client, $user) = $bpc->NetBiosInfoGet($hostIP); - exit(1) if ( $host !~ /^([\w\.-]+)$/ ); + exit(1) if ( $host !~ /^([\w\.\s-]+)$/ ); my $hosts = $bpc->HostInfoRead($client); exit(1) if ( !defined($hosts->{$client}) ); $host = $client; @@ -913,6 +913,7 @@ sub UserCommandRun share => $ShareNames->[0], shares => $ShareNames, XferMethod => $Conf{XferMethod}, + sshPath => $Conf{SshPath}, LOG => *LOG, XferLOG => $XferLOG, stat => \%stat, diff --git a/bin/BackupPC_link b/bin/BackupPC_link index 8bd8dc1..fa014e7 100755 --- a/bin/BackupPC_link +++ b/bin/BackupPC_link @@ -70,7 +70,7 @@ if ( @ARGV != 1 ) { print("usage: $0 \n"); exit(1); } -if ( $ARGV[0] !~ /^([\w\.-\s]+)$/ ) { +if ( $ARGV[0] !~ /^([\w\.\s-]+)$/ ) { print("$0: bad host name '$ARGV[0]'\n"); exit(1); } diff --git a/bin/BackupPC_restore b/bin/BackupPC_restore index 7746a36..18e5700 100755 --- a/bin/BackupPC_restore +++ b/bin/BackupPC_restore @@ -565,6 +565,7 @@ sub UserCommandRun hostIP => $hostIP, share => $RestoreReq{shareDest}, XferMethod => $Conf{XferMethod}, + sshPath => $Conf{SshPath}, LOG => *LOG, XferLOG => $RestoreLOG, stat => \%stat, diff --git a/bin/BackupPC_tarCreate b/bin/BackupPC_tarCreate index 3ba3bbc..2fb6459 100755 --- a/bin/BackupPC_tarCreate +++ b/bin/BackupPC_tarCreate @@ -78,7 +78,7 @@ if ( @ARGV < 1 ) { exit(1); } -if ( $opts{h} !~ /^([\w\.-\s]+)$/ ) { +if ( $opts{h} !~ /^([\w\.\s-]+)$/ ) { print(STDERR "$0: bad host name '$opts{h}'\n"); exit(1); } diff --git a/bin/BackupPC_tarExtract b/bin/BackupPC_tarExtract index 7f53915..fc5dfa5 100755 --- a/bin/BackupPC_tarExtract +++ b/bin/BackupPC_tarExtract @@ -50,7 +50,7 @@ if ( @ARGV != 3 ) { print("usage: $0 \n"); exit(1); } -if ( $ARGV[0] !~ /^([\w\.-\s]+)$/ ) { +if ( $ARGV[0] !~ /^([\w\.\s-]+)$/ ) { print("$0: bad host name '$ARGV[0]'\n"); exit(1); } diff --git a/bin/BackupPC_zipCreate b/bin/BackupPC_zipCreate index c91d208..ac0c237 100755 --- a/bin/BackupPC_zipCreate +++ b/bin/BackupPC_zipCreate @@ -84,7 +84,7 @@ if ( @ARGV < 1 ) { exit(1); } -if ( $opts{h} !~ /^([\w\.-]+)$/ ) { +if ( $opts{h} !~ /^([\w\.\s-]+)$/ ) { print(STDERR "$0: bad host name '$opts{h}'\n"); exit(1); } diff --git a/conf/config.pl b/conf/config.pl index 6d81255..679908e 100644 --- a/conf/config.pl +++ b/conf/config.pl @@ -547,15 +547,15 @@ $Conf{SmbClientPath} = '/usr/bin/smbclient'; # $timeStampFile start time for incremental dump # $Conf{SmbClientFullCmd} = '$smbClientPath \\\\$host\\$shareName' - . '$I_option -U $userName -E -N -d 1' + . ' $I_option -U $userName -E -N -d 1' . ' -c tarmode\\ full -Tc$X_option - $fileList'; $Conf{SmbClientIncrCmd} = '$smbClientPath \\\\$host\\$shareName' - . '$I_option -U $userName -E -N -d 1' + . ' $I_option -U $userName -E -N -d 1' . ' -c tarmode\\ full -TcN$X_option $timeStampFile - $fileList'; $Conf{SmbClientRestoreCmd} = '$smbClientPath \\\\$host\\$shareName' - . '$I_option -U $userName -E -N -d 1' + . ' $I_option -U $userName -E -N -d 1' . ' -c tarmode\\ full -Tx -'; # @@ -957,6 +957,8 @@ $Conf{RestorePostUserCmd} = undef; # to all refer to the same physical hosts. This should only be # set in the per-PC config file. # +# Note: this setting doesn't work for DHCP hosts. +# $Conf{ClientNameAlias} = undef; #