diff -Nur e-smith-backup-2.6.0.old/root/etc/e-smith/events/actions/workstation-backup-dar e-smith-backup-2.6.0/root/etc/e-smith/events/actions/workstation-backup-dar --- e-smith-backup-2.6.0.old/root/etc/e-smith/events/actions/workstation-backup-dar 2021-05-12 15:57:35.360000000 -0400 +++ e-smith-backup-2.6.0/root/etc/e-smith/events/actions/workstation-backup-dar 2021-05-12 16:06:37.891000000 -0400 @@ -50,6 +50,7 @@ my $ether = $internalinterface->prop('Name'); my $smbhost = $backupwk->prop('SmbHost'); my $smbshare = $backupwk->prop('SmbShare'); +my $smbv1 = $backupwk->prop('SmbV1') || 'disabled'; my $smbhostmac = $backupwk->prop('SmbHostMAC'); my $smbhostdelay = $backupwk->prop('SmbHostDelay') || 300; my $login = $backupwk->prop('Login'); @@ -90,7 +91,7 @@ $report .= wol ($ether,$smbhost,$smbhostmac,$smbhostdelay); # mount backup -bmount($mntdir,$smbhost,$smbshare,$VFSType); +bmount($mntdir,$smbhost,$smbshare,$VFSType,$smbv1); # rotating backup indicators $incnum++; @@ -333,11 +334,12 @@ # mount dar unit according to dar-workstation configuration # return nothing if mount successfull - my ($host,$share,$mountdir,$login,$password,$VFSType) = @_; + my ($host,$share,$mountdir,$login,$password,$VFSType,$smbv1) = @_; if ($VFSType eq 'cifs') { - return ( qx(/bin/mount -t cifs "//$host/$share" $mountdir -o credentials=/etc/dar/CIFScredentials,nounix 2>&1) ); + my $opt= ($smbv1 eq "enabled")? ",vers=1.0": ""; + return ( qx(/bin/mount -t cifs "//$host/$share" $mountdir -o credentials=/etc/dar/CIFScredentials,nounix$opt 2>&1) ); } elsif ($VFSType eq 'nfs') { @@ -479,7 +481,7 @@ sub bmount { - my ($mntdir,$host,$share,$VFSType) = @_; + my ($mntdir,$host,$share,$VFSType,$smbv1) = @_; # verify backup directory not already mounted if (!checkMount ($mntdir)) @@ -502,7 +504,7 @@ createTree ($mntdir); # mount the backup directory - my $err = dmount($host,$share,$mntdir,'','',$VFSType); + my $err = dmount($host,$share,$mntdir,'','',$VFSType,$smbv1); ldie("Error while mounting \n" . $err) if $err; # verify $mntdir is mounted diff -Nur e-smith-backup-2.6.0.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/backup e-smith-backup-2.6.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/backup --- e-smith-backup-2.6.0.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/backup 2021-05-12 15:57:35.382000000 -0400 +++ e-smith-backup-2.6.0/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/backup 2021-05-12 16:10:52.006000000 -0400 @@ -936,5 +936,10 @@ DO_NOT_RESTORE_BIN_SBIN_LIB_LIB64_FROM_SME9 If you restore from Koozali SME Server 9 or before, pay attention that some folders in the system are now symlinks. Basic backup configuration does not include /bin, /lib, /lib64, /sbin, /var/lock and /var/run. If you have added them for files in their subdirectories, we will prevent the restoration of those folders to prevent dar from replacing those symlinks and leave the system unusable. Those additions are, however, not recommended as they are at risk to overwrite files provides by rpms. + + SMBV1 + Mount as legacy SMB v1 share (unsecure, not recommended). + + diff -Nur e-smith-backup-2.6.0.old/root/etc/e-smith/web/functions/backup e-smith-backup-2.6.0/root/etc/e-smith/web/functions/backup --- e-smith-backup-2.6.0.old/root/etc/e-smith/web/functions/backup 2021-05-12 15:57:35.383000000 -0400 +++ e-smith-backup-2.6.0/root/etc/e-smith/web/functions/backup 2021-05-12 16:06:37.670000000 -0400 @@ -1033,6 +1033,7 @@ my ($q) = @_; my $backupwk_status; my $enabledIncOnlyTimeout = ""; + my $smbv1 = ""; my $backupwkLogin = 'backup'; my $backupwkPassword = 'backup'; my $backupwkStation = 'host'; @@ -1066,6 +1067,7 @@ $backupwkIncOnlyTimeout = $rec->prop('IncOnlyTimeout') || 'yes'; $compression = $rec->prop('Compression') || '0'; $dof = (defined $rec->prop('FullDay')) ? $rec->prop('FullDay') : '7'; + $smbv1 = ( ($rec->prop('SmbV1') || 'disabled') eq "enabled" ) ? "enabled" : "disabled" ; $VFSType = $rec->prop('VFSType') || 'cifs'; $backupwk_status = $rec->prop('status'); } @@ -1094,6 +1096,7 @@ { print $fm->localise('LOGIN'), ' ', $backupwkLogin, '
'; print $fm->localise('PASSWORD'), ' ********
'; + print $fm->localise('SMBV1'), ' ', $smbv1, '
'; } print $fm->localise('WORKSTN_BACKUP_SETSNUM'), ' ', $setsNumber, '
'; print $fm->localise('WORKSTN_BACKUP_DAYSINSET'), ' ', $filesinset, '
'; @@ -1182,6 +1185,7 @@ my $VFSType = $q->param ('VFSType'); my $error=""; my $dof; + my $smbv1 = ''; my @usbdisks; my %dlabels = (); my @dlabels = split(' ', $fm->localise('DOW')); @@ -1208,6 +1212,7 @@ $backupwkIncOnlyTimeout = $rec->prop('IncOnlyTimeout') || 'yes'; $compression = $rec->prop('Compression') || '0'; $dof = (defined $rec->prop('FullDay')) ? $rec->prop('FullDay') : '7'; + $smbv1 = ( ($rec->prop('SmbV1') || 'disabled') eq "enabled" ) ? "checked" : "" ; } ($backupwkHour, $backupwkMin) = split (':', $backupwkTime, -1); @@ -1344,6 +1349,23 @@ -default => $backupwkPassword, -size => 20)), ); +#smbv1 + print $q->Tr( + esmith::cgi::genCell( + $q, + $fm->localise('SMBV1') + ), + + esmith::cgi::genCell ( + $q, + " " + ), + + ); + } print ''; @@ -1476,6 +1498,7 @@ my $status = $q->param ('workstnbackup') || ""; my $inconly = $q->param ('incOnlyTimeout'); + my $smbv1 = $q->param ('smbv1'); my $dof = $q->param('dof'); my $ampm; my $incOnlyTimeout; @@ -1631,6 +1654,15 @@ $incOnlyTimeout = 'no'; } + if (defined $smbv1 && $smbv1 eq 'on') + { + $smbv1 = 'enabled'; + } + else + { + $smbv1 = 'disabled'; + } + my $compression = $q->param ('compression'); if (( $compression < 0 ) || ( $compression > 9 )) { @@ -1642,6 +1674,7 @@ $rec->set_prop('SmbHost', $backupwkStation); $rec->set_prop('SmbShare', $backupwkFolder); + $rec->set_prop('SmbV1', $smbv1); $rec->set_prop('Mount', $backupwkMount); $rec->set_prop('Login', $backupwkLogin); $rec->set_prop('Password', $backupwkPassword); @@ -1733,7 +1766,7 @@ # we test if the remote host is reachable, else we simply display a warning if ( $VFSType =~ m/cifs|nfs/s ) { - my $error_message = vmount($backupwkStation,$backupwkFolder,$backupwkMount,$VFSType); + my $error_message = vmount($backupwkStation,$backupwkFolder,$backupwkMount,$VFSType,$smbv1); if (! $error_message) { bunmount($backupwkMount,$VFSType); @@ -1774,6 +1807,7 @@ my $id = $rec->prop('Id') || $conf->get('SystemName')->value . "." . $conf->get('DomainName')->value; my $smbhost = $rec->prop('SmbHost'); my $smbshare = $rec->prop('SmbShare'); + my $smbv1 = $rec->prop('SmbV1') || 'disabled'; my $VFSType = $rec->prop('VFSType') || 'cifs'; my $err; $mntdir = "/$smbshare" if ( $VFSType eq 'usb' ); @@ -1792,7 +1826,7 @@ }; # Mounting backup shared folder - my $error_message = bmount($mntdir,$smbhost,$smbshare,$VFSType); + my $error_message = bmount($mntdir,$smbhost,$smbshare,$VFSType,$smbv1); if ($error_message) { esmith::cgi::genResult($q, $error_message, $id); @@ -1902,6 +1936,7 @@ my $backupwkrec = $conf->get('backupwk'); my $smbhost = $backupwkrec->prop('SmbHost'); my $smbshare = $backupwkrec->prop('SmbShare'); + my $smbv1 = $backupwkrec->prop('SmbV1') || 'disabled'; my $mntdir = $backupwkrec->prop('Mount') || '/mnt/smb'; my $key; my $error_message; @@ -1913,7 +1948,7 @@ $mntdir = "/$smbshare" if ( $VFSType eq 'usb' ); # Mounting backup shared folder - $error_message = bmount($mntdir,$smbhost,$smbshare,$VFSType); + $error_message = bmount($mntdir,$smbhost,$smbshare,$VFSType,$smbv1); if ($error_message) { esmith::cgi::genResult($q, $error_message, $id); @@ -2142,6 +2177,7 @@ my $VFSType = $rec->prop('VFSType') || 'cifs'; my $smbhost = $rec->prop('SmbHost'); my $smbshare = $rec->prop('SmbShare'); + my $smbv1 = $rec->prop('SmbV1') || 'disabled'; my $err; $mntdir = "/$smbshare" if ( $VFSType eq 'usb' ); @@ -2160,7 +2196,7 @@ }; # Mounting backup shared folder - my $error_message = bmount($mntdir,$smbhost,$smbshare,$VFSType); + my $error_message = bmount($mntdir,$smbhost,$smbshare,$VFSType,$smbv1); if ($error_message) { esmith::cgi::genResult($q, $error_message, $id); @@ -2295,12 +2331,13 @@ my $VFSType = $backupwkrec->prop('VFSType') || 'cifs'; my $smbhost = $backupwkrec->prop('SmbHost'); my $smbshare = $backupwkrec->prop('SmbShare'); + my $smbv1 = $backupwkrec->prop('SmbV1') || 'disabled'; $mntdir = "/$smbshare" if ( $VFSType eq 'usb' ); my $err; my $error_message; # Mounting backup shared folder - $error_message = bmount($mntdir,$smbhost,$smbshare,$VFSType); + $error_message = bmount($mntdir,$smbhost,$smbshare,$VFSType,$smbv1); if ($error_message) { esmith::cgi::genHeaderNonCacheable($q,undef, $fm->localise('RESTORE_CANNOT_PROCEED')); @@ -2532,6 +2569,7 @@ my $VFSType = $rec->prop('VFSType') || 'cifs'; my $smbhost = $rec->prop('SmbHost'); my $smbshare = $rec->prop('SmbShare'); + my $smbv1 = $rec->prop('SmbV1') || 'disabled'; $mntdir = "/$smbshare" if ( $VFSType eq 'usb' ); my $err; my $error_message; @@ -2551,7 +2589,7 @@ }; # Mounting backup shared folder - $error_message = bmount($mntdir,$smbhost,$smbshare,$VFSType); + $error_message = bmount($mntdir,$smbhost,$smbshare,$VFSType,$smbv1); if ($error_message) { esmith::cgi::genResult($q, $error_message, $id); @@ -2680,6 +2718,7 @@ my $backupwkrec = $conf->get('backupwk'); my $smbhost = $backupwkrec->prop('SmbHost'); my $smbshare = $backupwkrec->prop('SmbShare'); + my $smbv1 = $backupwkrec->prop('SmbV1') || 'disabled'; my $mntdir = $backupwkrec->prop('Mount') || '/mnt/smb'; my $key; my $id = $backupwkrec->prop('Id') || @@ -2702,7 +2741,7 @@ } # Mounting backup shared folder - $error_message = bmount($mntdir,$smbhost,$smbshare,$VFSType); + $error_message = bmount($mntdir,$smbhost,$smbshare,$VFSType,$smbv1); if ($error_message) { esmith::cgi::genResult($q, $error_message, $id); @@ -2857,12 +2896,13 @@ my $VFSType = $backupwkrec->prop('VFSType') || 'cifs'; my $smbhost = $backupwkrec->prop('SmbHost'); my $smbshare = $backupwkrec->prop('SmbShare'); + my $smbv1 = $backupwkrec->prop('SmbV1') || 'disabled'; my $err; my $error_message; $mntdir = "/$smbshare" if ( $VFSType eq 'usb' ); # Mounting backup shared folder - $error_message = bmount($mntdir,$smbhost,$smbshare,$VFSType); + $error_message = bmount($mntdir,$smbhost,$smbshare,$VFSType,$smbv1); if ($error_message) { esmith::cgi::genResult($q, $error_message, $id); @@ -3108,11 +3148,12 @@ # mount dar unit according to dar-workstation configuration # return nothing if mount successfull - my ($host,$share,$mountdir,$login,$password,$VFSType) = @_; + my ($host,$share,$mountdir,$login,$password,$VFSType,$smbv1) = @_; if ($VFSType eq 'cifs') { - return ( qx(/bin/mount -t cifs "//$host/$share" $mountdir -o credentials=/etc/dar/CIFScredentials,nounix 2>&1) ); + my $opt= ($smbv1 eq "enabled")? ",vers=1.0": ""; + return ( qx(/bin/mount -t cifs "//$host/$share" $mountdir -o credentials=/etc/dar/CIFScredentials,nounix$opt 2>&1) ); } elsif ($VFSType eq 'nfs') { @@ -3155,7 +3196,7 @@ sub bmount { - my ($mntdir,$host,$share,$VFSType) = @_; + my ($mntdir,$host,$share,$VFSType,$smbv1) = @_; # verify backup directory not already mounted if (!checkMount ($mntdir)) @@ -3176,7 +3217,7 @@ return ($fm->localise('ERR_MOUNTING_SMBSHARE') . "\n" . $err) if $err; # mount the backup directory - $err = dmount($host,$share,$mntdir,'','',$VFSType); + $err = dmount($host,$share,$mntdir,'','',$VFSType,$smbv1); return ($fm->localise('ERR_MOUNTING_SMBSHARE') . "\n" . $err) if $err; # verify $mntdir is mounted @@ -3238,10 +3279,11 @@ { # mount dar unit according to dar-workstation configuration in order to test the remote host # return nothing if mount successfull - my ($host,$share,$mountdir,$VFSType) = @_; + my ($host,$share,$mountdir,$VFSType,$smbv1) = @_; if ($VFSType eq 'cifs') { - return ( qx(/bin/mount -t cifs "//$host/$share" $mountdir -o credentials=/etc/dar/CIFScredentials,nounix 2>&1) ); + my $opt= ($smbv1 eq "enabled")? ",vers=1.0": ""; + return ( qx(/bin/mount -t cifs "//$host/$share" $mountdir -o credentials=/etc/dar/CIFScredentials,nounix$opt 2>&1) ); } elsif ($VFSType eq 'nfs') {