diff options
author | rene <rene@FreeBSD.org> | 2016-06-22 04:39:00 +0800 |
---|---|---|
committer | rene <rene@FreeBSD.org> | 2016-06-22 04:39:00 +0800 |
commit | c05046f2504e15ebdd582c98dd763c6cafc1708a (patch) | |
tree | d23a5c49401b1dfd3c101a07e381b19604708fbd | |
parent | ed1e5929d03cee8ae6c8a36158ee7afc96ec7b5e (diff) | |
download | freebsd-ports-gnome-c05046f2504e15ebdd582c98dd763c6cafc1708a.tar.gz freebsd-ports-gnome-c05046f2504e15ebdd582c98dd763c6cafc1708a.tar.zst freebsd-ports-gnome-c05046f2504e15ebdd582c98dd763c6cafc1708a.zip |
sysutils/backuppc: add a workaround for users of Samba 4.
Using Samba 3.6 is still reccommended
PR: 209874
Submitted by: myself, patch by maintainer
-rw-r--r-- | sysutils/backuppc/Makefile | 2 | ||||
-rw-r--r-- | sysutils/backuppc/files/patch-lib_BackupPC_Xfer_Smb.pm | 33 | ||||
-rw-r--r-- | sysutils/backuppc/files/patch-lib__BackupPC__CGI__View.pm | 17 | ||||
-rw-r--r-- | sysutils/backuppc/files/pkg-message.in | 9 |
4 files changed, 57 insertions, 4 deletions
diff --git a/sysutils/backuppc/Makefile b/sysutils/backuppc/Makefile index 0f07a143bf79..5a57068c9187 100644 --- a/sysutils/backuppc/Makefile +++ b/sysutils/backuppc/Makefile @@ -3,7 +3,7 @@ PORTNAME= backuppc PORTVERSION= 3.3.1 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= sysutils MASTER_SITES= SF DISTNAME= BackupPC-${PORTVERSION} diff --git a/sysutils/backuppc/files/patch-lib_BackupPC_Xfer_Smb.pm b/sysutils/backuppc/files/patch-lib_BackupPC_Xfer_Smb.pm new file mode 100644 index 000000000000..f12b03731c64 --- /dev/null +++ b/sysutils/backuppc/files/patch-lib_BackupPC_Xfer_Smb.pm @@ -0,0 +1,33 @@ +--- lib/BackupPC/Xfer/Smb.pm.orig 2016-06-04 10:42:02 UTC ++++ lib/BackupPC/Xfer/Smb.pm +@@ -217,7 +217,7 @@ sub readOutput + # This section is highly dependent on the version of smbclient. + # If you upgrade Samba, make sure that these regexp are still valid. + # +- if ( /^\s*(-?\d+) \(\s*\d+[.,]\d kb\/s\) (.*)$/ ) { ++ if ( /^\s*(-?\d+) \(\s*\d+[.,]\d kb\/s\) (.*)$/ || /^tar:(\d+)\s+\+\+\+ (.*)$/ ) { + my $sambaFileSize = $1; + my $pcFileName = $2; + (my $fileName = $pcFileName) =~ s/\\/\//g; +@@ -230,7 +230,9 @@ sub readOutput + $t->{byteCnt} += $2; + $t->{fileCnt}++; + $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 1 ); +- } elsif ( /^\s*tar: dumped \d+ files/ ) { ++ } elsif ( /^\s*tar: dumped \d+ files/ ++ || /Total bytes received: \d+/i ++ || /tar_process done, err = 0/ ) { + $t->{xferOK} = 1; + $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 0 ); + } elsif ( /^\s*tar: restored \d+ files/ ) { +@@ -270,6 +272,10 @@ sub readOutput + } elsif ( /^\s*directory \\/i ) { + $t->{XferLOG}->write(\"$_\n") if ( $t->{logLevel} >= 2 ); + } elsif ( /smb: \\>/ ++ || /^tar:\d+\s/ ++ || /^ NTLMSSP_/ ++ || /^GENSEC backend / ++ || /^doing parameter / + || /^\s*added interface/i + || /^\s*tarmode is now/i + || /^\s*Total bytes written/i diff --git a/sysutils/backuppc/files/patch-lib__BackupPC__CGI__View.pm b/sysutils/backuppc/files/patch-lib__BackupPC__CGI__View.pm index 94ad75a787ed..b3a15623d0ff 100644 --- a/sysutils/backuppc/files/patch-lib__BackupPC__CGI__View.pm +++ b/sysutils/backuppc/files/patch-lib__BackupPC__CGI__View.pm @@ -1,6 +1,6 @@ ---- ./lib/BackupPC/CGI/View.pm.orig 2014-08-30 15:21:07.000000000 +0400 -+++ ./lib/BackupPC/CGI/View.pm 2014-08-30 15:21:18.000000000 +0400 -@@ -89,7 +89,7 @@ +--- lib/BackupPC/CGI/View.pm.orig 2015-01-12 00:19:53 UTC ++++ lib/BackupPC/CGI/View.pm +@@ -89,7 +89,7 @@ sub action $file = $bpc->ConfDir() . "/hosts"; $linkHosts = 1; } elsif ( $type eq "docs" ) { @@ -9,3 +9,14 @@ } elsif ( $host ne "" ) { if ( !defined($In{num}) ) { # get the latest LOG file +@@ -136,6 +136,10 @@ sub action + } + $s =~ s/[\n\r]+//g; + if ( $s =~ /smb: \\>/ ++ || $s =~ /^tar:\d+\s/ ++ || $s =~ /^ NTLMSSP_/ ++ || $s =~ /^GENSEC backend / ++ || $s =~ /^doing parameter / + || $s =~ /^\s*(\d+) \(\s*\d+\.\d kb\/s\) (.*)$/ + || $s =~ /^tar: dumped \d+ files/ + || $s =~ /^\s*added interface/i diff --git a/sysutils/backuppc/files/pkg-message.in b/sysutils/backuppc/files/pkg-message.in index 5a3d8f4dbf64..45e12bcf3cb6 100644 --- a/sysutils/backuppc/files/pkg-message.in +++ b/sysutils/backuppc/files/pkg-message.in @@ -13,4 +13,13 @@ This is where all the backup data is stored. This file system needs to be big enough to accommodate all the PCs you expect to backup. + + - Users of Samba 4 smbclient should change debug level for smbclient + restore command to 5 ('-d 5') in the main configuration, for instance + + $Conf{SmbClientRestoreCmd} = '$smbClientPath \\\\$host\\$shareName $I_option -U $userName -E -d 5 -c tarmode\\ full -Tx -'; + + and set in the each host's configuration + + $Conf{BackupZeroFilesIsFatal} = '0'; ========================================================================== |