From 359a795122e5fd5888ad92731147dcd7c1d6db12 Mon Sep 17 00:00:00 2001 From: cbarratt Date: Sun, 27 Jul 2003 05:41:36 +0000 Subject: [PATCH] * A failed full dump is now saved as a partial (incomplete) dump, provided it includes some files. This can be used for browsing, restoring etc, and will also form the basis of resuming full dumps. Only one partial is kept, and it is removed as soon as a success full (or a new partial) is done. * 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. * For SMB, code that detected files with a read-locked region (eg: outlook .pst files), removed them and then tried to link with an earlier version was broken. This code missed a step of mangling the file names. This is now fixed. Reported by Pierre Bourgin. * A backup of a share that has zero files is now considered fatal. This is used to catch miscellaneous Xfer errors that result in no files being backed up. A new config parameter $Conf{BackupZeroFilesIsFatal} (defaults to 1) and can be set to zero to turn off this check. Suggested by Guillaume Filion. * SMB: now detect NT_STATUS_ACCESS_DENIED on entire share or BackupFilesOnly (also ERRDOS - ERRnoaccess (Access denied.) for older versions of smbclient.) Suggested by Guillaume Filion. * SMB: now detects "tree connect failed: NT_STATUS_BAD_NETWORK_NAME" and the dump is considered failed. * Rsync: Previously BackupFilesOnly = '/' did --include '/' --exclude '/*', which just included the '/' directory and nothing below. Now it does just --include '/', which should include everything. Reported by denon. * Add hostError to DumpPostUserCmd variable substitutions for both dump and restore. * Verbose output in Lib.pm goes to STDERR, not STDOUT. This now makes BackupPC_dump -v work better. * Don't allow browsing with ".." in directory in case a user tries to trick BackupPC_Admin into displaying directories outside where they are allowed. * Required File::RsyncP version is now 0.44, since File::RsyncP 0.44 fixes large file (>2GB) bugs. Large file bugs reported by Steve Waltner. --- lib/BackupPC/CGI/Browse.pm | 3 +++ lib/BackupPC/CGI/HostInfo.pm | 4 +--- lib/BackupPC/CGI/Lib.pm | 7 ++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/BackupPC/CGI/Browse.pm b/lib/BackupPC/CGI/Browse.pm index 3993b94..aeb006b 100644 --- a/lib/BackupPC/CGI/Browse.pm +++ b/lib/BackupPC/CGI/Browse.pm @@ -84,6 +84,9 @@ sub action $dir = "/$dir" if ( $dir !~ /^\// ); my $relDir = $dir; my $currDir = undef; + if ( $dir =~ m{(^|/)\.\.(/|$)} ) { + ErrorExit($Lang->{Nice_try__but_you_can_t_put}); + } # # Loop up the directory tree until we hit the top. diff --git a/lib/BackupPC/CGI/HostInfo.pm b/lib/BackupPC/CGI/HostInfo.pm index ce075ab..81d75a3 100644 --- a/lib/BackupPC/CGI/HostInfo.pm +++ b/lib/BackupPC/CGI/HostInfo.pm @@ -105,9 +105,7 @@ sub action my $filled = $Backups[$i]{noFill} ? $Lang->{No} : $Lang->{Yes}; $filled .= " ($Backups[$i]{fillFromNum}) " if ( $Backups[$i]{fillFromNum} ne "" ); - my $ltype; - if ($Backups[$i]{type} eq "full") { $ltype = $Lang->{full}; } - else { $ltype = $Lang->{incremental}; } + my $ltype = $Lang->{"backupType_$Backups[$i]{type}"}; $str .= < $Backups[$i]{num} $ltype diff --git a/lib/BackupPC/CGI/Lib.pm b/lib/BackupPC/CGI/Lib.pm index baa168f..078f3fd 100644 --- a/lib/BackupPC/CGI/Lib.pm +++ b/lib/BackupPC/CGI/Lib.pm @@ -93,6 +93,12 @@ sub NewRequest $Cgi = new CGI; %In = $Cgi->Vars; + # + # Default REMOTE_USER so in a miminal installation the user + # has a sensible default. + # + $ENV{REMOTE_USER} = $Conf{BackupPCUser} if ( !defined($ENV{REMOTE_USER}) ); + # # We require that Apache pass in $ENV{SCRIPT_NAME} and $ENV{REMOTE_USER}. # The latter requires .ht_access style authentication. Replace this @@ -156,7 +162,6 @@ sub timeStamp2 { my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($_[0] == 0 ? time : $_[0] ); - $year += 1900; $mon++; if ( $Conf{CgiDateFormatMMDD} ) { return sprintf("$mon/$mday %02d:%02d", $hour, $min); -- 2.20.1