by Ross Skaliotis.
* Updated BackupPC/Xfer/Smb.pm to handle new messages from
smbclient 3.0.0rc2.
* Fixed $Conf{BackupZeroFilesIsFatal} so that it only applies to full
dumps, not incrementals.
* Replaced typo $Conf{PingClientPath} with $Conf{PingPath} in configure.pl.
* Removed -T (taint mode) on binaries installed in configure.pl.
# Version __VERSION__, __RELEASEDATE__
#------------------------------------------------------------------------
+* Fixed handling of $Conf{HardLinkMax} in BackupPC/Lib.pm. Reported
+ by Ross Skaliotis.
+
+* Updated BackupPC/Xfer/Smb.pm to handle new messages from
+ smbclient 3.0.0rc2.
+
+* Fixed $Conf{BackupZeroFilesIsFatal} so that it only applies to full
+ dumps, not incrementals.
+
+* Replaced typo $Conf{PingClientPath} with $Conf{PingPath} in configure.pl.
+
+* Removed -T (taint mode) on binaries installed in configure.pl.
+
+#------------------------------------------------------------------------
+# Version 2.0.1beta0, July 26th, 2003
+#------------------------------------------------------------------------
+
* In BackupPC_Admin, default REMOTE_USER to $Conf{BackupPCUser}
if it is not defined. This allows the CGI interface to work
when AdminUsers = '*'. Reported by Quentin Arce.
#
$hostIP = $client;
if ( $bpc->CheckHostAlive($hostIP) < 0 ) {
- print("Exiting because CheckHostAlive($hostIP) failed\n")
+ print(STDERR "Exiting because CheckHostAlive($hostIP) failed\n")
if ( $opts{v} );
exit(1);
}
if ( $Conf{NmbLookupCmd} eq "" ) {
- print("Exiting because \$Conf{NmbLookupCmd} is empty\n")
+ print(STDERR "Exiting because \$Conf{NmbLookupCmd} is empty\n")
if ( $opts{v} );
exit(1);
}
($client, $user) = $bpc->NetBiosInfoGet($hostIP);
if ( $client !~ /^([\w\.\s-]+)$/ ) {
- print("Exiting because NetBiosInfoGet($hostIP) returned '$client',"
- . " an invalid host name\n")
- if ( $opts{v} );
+ print(STDERR "Exiting because NetBiosInfoGet($hostIP) returned"
+ . " '$client', an invalid host name\n") if ( $opts{v} );
exit(1)
}
$Hosts = $bpc->HostInfoRead($client);
$Hosts = $bpc->HostInfoRead($client);
}
if ( !defined($Hosts->{$client}) ) {
- print("Exiting because host $client does not exist in the hosts file\n")
- if ( $opts{v} );
+ print(STDERR "Exiting because host $client does not exist in the"
+ . " hosts file\n") if ( $opts{v} );
exit(1)
}
# Ok, NS doesn't know about it. Maybe it is a NetBios name
# instead.
#
- print("Name server doesn't know about $host; trying NetBios\n")
+ print(STDERR "Name server doesn't know about $host; trying NetBios\n")
if ( $opts{v} );
if ( !defined($hostIP = $bpc->NetBiosHostIPFind($host)) ) {
print(LOG $bpc->timeStamp, "Can't find host $host via netbios\n");
if ( $opts{d} ) {
if ( $StatusHost{activeJob} ) {
# oops, something is already running for this host
- print("Exiting because backup is already running for $client\n")
+ print(STDERR "Exiting because backup is already running for $client\n")
if ( $opts{v} );
exit(0);
}
my $lastNum = -1;
#
-# If any share had zero files then consider the dump bad
+# If this is a full, and any share had zero files then consider the dump bad
#
-if ( $stat{hostError} eq ""
+if ( $type eq "full" && $stat{hostError} eq ""
&& length($noFilesErr) && $Conf{BackupZeroFilesIsFatal} ) {
$stat{hostError} = $noFilesErr;
$stat{xferOK} = 0;
$Cgi = new CGI;
%In = $Cgi->Vars;
-#
-# We require that Apache pass in $ENV{SCRIPT_NAME} and $ENV{REMOTE_USER}.
-# The latter requires .ht_access style authentication. Replace this
-# code if you are using some other type of authentication, and have
-# a different way of getting the user name.
-#
-$ENV{REMOTE_USER} = $Conf{BackupPCUser} if ( !defined($ENV{REMOTE_USER}) );
-$MyURL = $ENV{SCRIPT_NAME};
-$User = $ENV{REMOTE_USER};
-
if ( !defined($bpc) ) {
ErrorExit($Lang->{BackupPC__Lib__new_failed__check_apache_error_log})
if ( !($bpc = BackupPC::Lib->new(undef, undef, 1)) );
$Lang = $bpc->Lang();
}
+#
+# We require that Apache pass in $ENV{SCRIPT_NAME} and $ENV{REMOTE_USER}.
+# The latter requires .ht_access style authentication. Replace this
+# code if you are using some other type of authentication, and have
+# a different way of getting the user name.
+#
+$ENV{REMOTE_USER} = $Conf{BackupPCUser} if ( $ENV{REMOTE_USER} eq "" );
+$MyURL = $ENV{SCRIPT_NAME};
+$User = $ENV{REMOTE_USER};
+
#
# Clean up %ENV for taint checking
#
|| /^\s+directory \\/
|| /^Timezone is/
|| /^\.\//
- || /^ /
+ || /^ /
) {
$skipped++;
next;
%Conf = $bpc->Conf();
%OrigConf = %Conf;
$Conf{TopDir} = $topDir;
- my $err = $bpc->ServerConnect($Conf{ServerHost}, $Conf{ServerPort}, 1);
+ my $err = $bpc->ServerConnect($Conf{ServerHost}, $Conf{ServerPort}, 1);
if ( $err eq "" ) {
print <<EOF;
#
# Create install directories
#
-foreach my $dir ( qw(bin doc
- lib/BackupPC/CGI
- lib/BackupPC/Lang
- lib/BackupPC/Xfer
- lib/BackupPC/Zip
- ) ) {
+foreach my $dir ( qw(bin lib/BackupPC/Xfer lib/BackupPC/Zip
+ lib/BackupPC/Lang doc) ) {
next if ( -d "$Conf{InstallDir}/$dir" );
mkpath("$Conf{InstallDir}/$dir", 0, 0775);
if ( !-d "$Conf{InstallDir}/$dir"
unlink("$Conf{InstallDir}/bin/BackupPC_queueAll");
printf("Installing library in $Conf{InstallDir}/lib\n");
-foreach my $lib ( qw(
- BackupPC/Lib.pm
- BackupPC/FileZIO.pm
- BackupPC/Attrib.pm
- BackupPC/PoolWrite.pm
- BackupPC/View.pm
- BackupPC/Xfer/Tar.pm
- BackupPC/Xfer/Smb.pm
- BackupPC/Xfer/Rsync.pm
- BackupPC/Xfer/RsyncFileIO.pm
- BackupPC/Zip/FileMember.pm
- BackupPC/Lang/en.pm
- BackupPC/Lang/fr.pm
- BackupPC/Lang/es.pm
+foreach my $lib ( qw(BackupPC/Lib.pm BackupPC/FileZIO.pm BackupPC/Attrib.pm
+ BackupPC/PoolWrite.pm BackupPC/View.pm BackupPC/Xfer/Tar.pm
+ BackupPC/Xfer/Smb.pm BackupPC/Xfer/Rsync.pm
+ BackupPC/Xfer/RsyncFileIO.pm BackupPC/Zip/FileMember.pm
+ BackupPC/Lang/en.pm BackupPC/Lang/fr.pm BackupPC/Lang/es.pm
BackupPC/Lang/de.pm
- BackupPC/CGI/Browse.pm
- BackupPC/CGI/DirHistory.pm
- BackupPC/CGI/EmailSummary.pm
- BackupPC/CGI/GeneralInfo.pm
- BackupPC/CGI/HostInfo.pm
- BackupPC/CGI/Lib.pm
- BackupPC/CGI/LOGlist.pm
- BackupPC/CGI/Queue.pm
- BackupPC/CGI/RestoreFile.pm
- BackupPC/CGI/RestoreInfo.pm
- BackupPC/CGI/Restore.pm
- BackupPC/CGI/StartStopBackup.pm
- BackupPC/CGI/Summary.pm
- BackupPC/CGI/View.pm
) ) {
InstallFile("lib/$lib", "$Conf{InstallDir}/lib/$lib", 0444);
}
if ( $^O eq "solaris" || $^O eq "sunos" ) {
$Conf{PingCmd} = '$pingPath -s $host 56 1';
} elsif ( ($^O eq "linux" || $^O eq "openbsd" || $^O eq "netbsd")
- && !system("$Conf{PingClientPath} -c 1 -w 3 localhost") ) {
+ && !system("$Conf{PingPath} -c 1 -w 3 localhost") ) {
$Conf{PingCmd} = '$pingPath -c 1 -w 3 $host';
} else {
$Conf{PingCmd} = '$pingPath -c 1 $host';
s/__BACKUPPCUSER__/$Conf{BackupPCUser}/g;
s/__CGIDIR__/$Conf{CgiDir}/g;
if ( $first && /^#.*bin\/perl/ ) {
- if ( $Perl56 ) {
- #
- # perl56 and later is taint ok
- #
- print OUT "#!$Conf{PerlPath} -T\n";
- } else {
- #
- # prior to perl56, File::Find fails taint checks,
- # so we run without -T. It's still safe.
- #
- print OUT "#!$Conf{PerlPath}\n";
- }
+ #
+ # Fill in correct path to perl (no taint for >= 2.0.1).
+ #
+ print OUT "#!$Conf{PerlPath}\n";
} else {
print OUT;
}
doing the installation. Alternatively, L<http://www.samba.org> has binary
distributions for most platforms.
+Note: samba version 3.0.0rc2 (the latest version as of 9/1/03) still
+has several smbclient bugs. If you want to use samba 3.0.0, be sure
+to use the latest release. If that's still rc2, please apply the
+following patches:
+
+ https://bugzilla.samba.org/show_bug.cgi?id=308
+ https://bugzilla.samba.org/show_bug.cgi?id=388
+ https://bugzilla.samba.org/show_bug.cgi?id=389
+
+Hopefully any release after 3.0.0rc2 will have all these patches
+applied.
+
=item *
If you are using tar to backup linux/unix machines you should have version
return -2 if ( !defined($rawFile = $bpc->MD52Path($d, $compress)) );
$rawFile .= "_$i" if ( $i >= 0 );
if ( -f $rawFile ) {
- if ( !compare($name, $rawFile) ) {
+ if ( (stat(_))[3] < $bpc->{Conf}{HardLinkMax}
+ && !compare($name, $rawFile) ) {
unlink($name);
return -3 if ( !link($rawFile, $name) );
return 1;
while ( $t->{smbOut} =~ /(.*?)[\n\r]+(.*)/s ) {
$_ = $1;
$t->{smbOut} = $2;
+ #
+ # ignore the log file time stamps from smbclient introduced
+ # in version 3.0.0 - don't even write them to the log file.
+ #
+ next if ( m{^\[\d+/\d+/\d+ +\d+:\d+:\d+.*\] +client/cli.*\(\d+\)} );
$t->{XferLOG}->write(\"$_\n");
#
# refresh our inactivity alarm
} elsif ( /restore tar file (.*) of size (\d+) bytes/ ) {
$t->{byteCnt} += $2;
$t->{fileCnt}++;
- } elsif ( /tar: dumped \d+ files/ ) {
+ } elsif ( /^\s*tar: dumped \d+ files/ ) {
$t->{xferOK} = 1;
- } elsif ( /^tar: restored \d+ files/ ) {
+ } elsif ( /^\s*tar: restored \d+ files/ ) {
$t->{xferOK} = 1;
- } elsif ( /^read_socket_with_timeout: timeout read. /i ) {
+ } elsif ( /^\s*read_socket_with_timeout: timeout read. /i ) {
$t->{hostAbort} = 1;
} elsif ( /^code 0 listing /
- || /^code 0 opening /
- || /^abandoning restore/i
- || /^Error: Looping in FIND_NEXT/i
- || /^SUCCESS - 0/i
- || /^Call timed out: server did not respond/i
- || /^tree connect failed: ERRDOS - ERRnoaccess \(Access denied\.\)/
- || /^tree connect failed: NT_STATUS_BAD_NETWORK_NAME/
+ || /^\s*code 0 opening /
+ || /^\s*abandoning restore/i
+ || /^\s*Error: Looping in FIND_NEXT/i
+ || /^\s*SUCCESS - 0/i
+ || /^\s*Call timed out: server did not respond/i
+ || /^\s*tree connect failed: ERRDOS - ERRnoaccess \(Access denied\.\)/
+ || /^\s*tree connect failed: NT_STATUS_BAD_NETWORK_NAME/
) {
if ( $t->{hostError} eq "" ) {
$t->{XferLOG}->write(\"This backup will fail because: $_\n");
$t->{hostError} = $_;
}
- } elsif ( /^NT_STATUS_ACCESS_DENIED listing (.*)/
- || /^ERRDOS - ERRnoaccess \(Access denied\.\) listing (.*)/ ) {
+ } elsif ( /^\s*NT_STATUS_ACCESS_DENIED listing (.*)/
+ || /^\s*ERRDOS - ERRnoaccess \(Access denied\.\) listing (.*)/ ) {
my $badDir = $1;
$badDir =~ s{\\}{/}g;
$badDir =~ s{/+}{/}g;
$t->{hostError} ||= $_;
}
} elsif ( /smb: \\>/
- || /^added interface/i
- || /^tarmode is now/i
- || /^Total bytes written/i
- || /^Domain=/i
+ || /^\s*added interface/i
+ || /^\s*tarmode is now/i
+ || /^\s*Total bytes written/i
+ || /^\s*Domain=/i
|| /^\([\d\.]* kb\/s\) \(average [\d\.]* kb\/s\)$/i
- || /^Getting files newer than/i
- || /^\s+directory \\/i
- || /^Output is \/dev\/null/i
- || /^Timezone is/i ) {
+ || /^\s*Getting files newer than/i
+ || /^\s*directory \\/i
+ || /^\s*restore directory \\/i
+ || /^\s*Output is \/dev\/null/i
+ || /^\s*Timezone is/i ) {
# ignore these messages
} else {
$t->{xferErrCnt}++;
umask(0022);
-my $Version = "2.0.1beta0";
-my $ReleaseDate = "26 Jul 2003";
+my $Version = "2.0.1beta1";
+my $ReleaseDate = "13 Sep 2003";
my $DistDir = "dist/BackupPC-$Version";
my @PerlSrc = qw(