X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FXfer%2FSmb.pm;h=3f88c3c01f928aa21798fd7f899ca0e28a33af4d;hp=b694785b566bd506f74fc4ede4612366af91bda3;hb=5729095faa3ef12dc5d4f02538c3650ac81912ef;hpb=74dc9d456332757127d5eda4ce32f29377133fa2 diff --git a/lib/BackupPC/Xfer/Smb.pm b/lib/BackupPC/Xfer/Smb.pm index b694785..3f88c3c 100644 --- a/lib/BackupPC/Xfer/Smb.pm +++ b/lib/BackupPC/Xfer/Smb.pm @@ -11,7 +11,7 @@ # Craig Barratt # # COPYRIGHT -# Copyright (C) 2001 Craig Barratt +# Copyright (C) 2001-2003 Craig Barratt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -29,7 +29,7 @@ # #======================================================================== # -# Version 2.0.0beta3, released 1 Jun 2003. +# Version 2.1.0_CVS, released 3 Jul 2003. # # See http://backuppc.sourceforge.net. # @@ -121,9 +121,11 @@ sub start }; } } + $t->{fileIncludeHash} = {}; if ( defined($conf->{BackupFilesOnly}{$t->{shareName}}) ) { foreach my $file ( @{$conf->{BackupFilesOnly}{$t->{shareName}}} ) { push(@fileList, $file); + $t->{fileIncludeHash}{$file} = 1; } } elsif ( defined($conf->{BackupFilesExclude}{$t->{shareName}}) ) { foreach my $file ( @{$conf->{BackupFilesExclude}{$t->{shareName}}} ) @@ -257,8 +259,24 @@ sub readOutput || /^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/ ) { - $t->{hostError} ||= $_; + 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 (.*)/ ) { + my $badDir = $1; + $badDir =~ s{\\}{/}g; + $badDir =~ s{/+}{/}g; + $badDir =~ s{/\*$}{}; + if ( $t->{hostError} eq "" + && ($badDir eq "" || $t->{fileIncludeHash}{$badDir}) ) { + $t->{XferLOG}->write(\"This backup will fail because: $_\n"); + $t->{hostError} ||= $_; + } } elsif ( /smb: \\>/ || /^added interface/i || /^tarmode is now/i @@ -297,7 +315,10 @@ sub readOutput my $badFile = $1; $badFile =~ s{\\}{/}g; $badFile =~ s{^/}{}; - push(@{$t->{badFiles}}, "$t->{shareName}/$badFile"); + push(@{$t->{badFiles}}, { + share => $t->{shareName}, + file => $badFile + }); } } }