#
#========================================================================
#
-# Version 1.5.0, released 2 Aug 2002.
+# Version 1.6.0_CVS, released 10 Dec 2002.
#
# See http://backuppc.sourceforge.net.
#
{
my($class, $bpc, $args) = @_;
+ $args ||= {};
my $t = bless {
bpc => $bpc,
conf => { $bpc->Conf },
return $t;
}
+sub args
+{
+ my($t, $args) = @_;
+
+ foreach my $arg ( keys(%$args) ) {
+ $t->{$arg} = $args->{$arg};
+ }
+}
+
+sub useTar
+{
+ return 1;
+}
+
sub start
{
my($t) = @_;
#
# First propagate the PASSWD setting
#
+ $ENV{PASSWD} = $ENV{BPC_SMB_PASSWD} if ( defined($ENV{BPC_SMB_PASSWD}) );
$ENV{PASSWD} = $conf->{SmbSharePasswd}
if ( defined($conf->{SmbSharePasswd}) );
if ( !defined($ENV{PASSWD}) ) {
$t->{_errStr} = "passwd not set for smbclient";
return;
}
+ if ( !defined($conf->{SmbClientPath}) || !-x $conf->{SmbClientPath} ) {
+ $t->{_errStr} = '$Conf{SmbClientPath} is not a valid executable';
+ return;
+ }
if ( $t->{type} eq "restore" ) {
$smbClientCmd =
"$conf->{SmbClientPath} '\\\\$t->{host}\\$t->{shareName}'"
return;
}
$t->{XferLOG}->write(\"Running: $smbClientCmd\n");
- alarm($conf->{SmbClientTimeout});
+ alarm($conf->{ClientTimeout});
$t->{_errStr} = undef;
return $logMsg;
}
#
# refresh our inactivity alarm
#
- alarm($conf->{SmbClientTimeout});
+ alarm($conf->{ClientTimeout});
$t->{lastOutputLine} = $_ if ( !/^$/ );
#
# This section is highly dependent on the version of smbclient.
} elsif ( /^code 0 listing /
|| /^code 0 opening /
|| /^abandoning restore/i
- || /^Error: Looping in FIND_NEXT/i ) {
+ || /^Error: Looping in FIND_NEXT/i
+ || /^SUCCESS - 0/i
+ || /^Call timed out: server did not respond/i
+ ) {
$t->{hostError} ||= $_;
} elsif ( /smb: \\>/
|| /^added interface/i