Verifying the bug as I write this.

** Description changed:

  [Impact]
  
  An update to samba changed the behavior of smbclient and this broke
  backuppc's parsing of that output, causing smb backup jobs to fail.
  
  [Test Case]
  
  We will want to test four scenarios:
  a) old samba, old backuppc: should work
  b) old samba, new backuppc: should work
  c) new samba, new backuppc: should work
  d) new samba, old backuppc: should fail (this bug)
  
  I suggest to proceed in the order listed above, as it's easier to
  downgrade backuppc (just one package) than to downgrade the whole samba
  suite. Alternatively, a new VM/LXD could be used for each scenario, of
  course.
  
  The steps below are generic.
  
  * Install samba and backuppc, and accept all defaults. Keep in mind
  which scenario from above you are testing, and adjust
  /etc/apt/sources.list accordingly to either include or not updates.
  
  sudo apt update
  sudo apt install samba backuppc
  
  * If you want to use the web interface, take note of the password given 
during the installation and restart apache2 at the end:
  sudo service apache2 restart
  
  * If you want to regenerate the password, install apache2-utils and run the 
htpasswd command:
  sudo apt install apache2-utils
  sudo htpasswd /etc/backuppc/htpasswd backuppc
  
  * Add this snippet to the end of /etc/samba/smb.conf:
  [public]
    path = /public
    guest ok = yes
    read only = no
  
  * Create /c and copy some content into it:
  sudo mkdir /public
  sudo chmod 1777 /public
- sudo cp -a /usr/bin /public
+ sudo cp -a /usr/bin/x* /public
  
  * restart the samba services
  sudo service smbd restart; sudo service nmbd restart
  
  * overwrite /etc/backuppc/localhost.pl with this;
  $Conf{XferMethod} = 'smb';
  $Conf{XferLogLevel} = 1;
  $Conf{ClientCharset} = '';
  $Conf{ClientCharsetLegacy} = 'iso-8859-1';
  $Conf{SmbShareName} = 'public';
  $Conf{SmbShareUserName} = '';
  $Conf{SmbSharePasswd} = '';
  
  * Now you are ready to run the backup command. Depending on the scenario
  being tested, it will work or fail.
  
  This is the working scenario:
  $ sudo -u backuppc -H /usr/share/backuppc/bin/BackupPC_dump -f localhost
  started full dump, share=C$
  xferPids 7009,7008
  full backup complete
  $ echo $?
  0
  
  This is the failing scenario:
  
  $ sudo -u backuppc -H /usr/share/backuppc/bin/BackupPC_dump -f localhost
  started full dump, share=C$
  xferPids 11008,11007
  dump failed: No files dumped for share C$
  link localhost
  $ echo $?
  2
  
  [Regression Potential]
  Since there is a tight coupling between samba and backuppc, there could be a 
regression for people who are not using the latest versions of each package. 
Therefore, I added specific tests for that to this SRU: all combinations of old 
and new packages of both samba and backuppc. Prior to uploading, I performed 
these tests myself and all combinations work as expected, with the only failing 
one being this bug that is being fixed.
  
  That being said, there is no guarantee that future samba or backuppc
  updates won't break again, because of this tight coupling. This package
  could benefit from DEP8 tests in that area.
  
  [Other Info]
  The fix adopted in Debian and Ubuntu Bionic onwards is different than the one 
presented here. The one used here is what was merged upstream, and doesn't 
require a configuration file change. I chose to leave bionic alone for now, 
since the bug is fixed there, just differently.
  
  [Original Description]
  
  After the current update of samba 4.1.6 to 4.3.8 samba on trusty the
  BackupPC smb transfer is broken.
  
  Several bugs in smbclient >= 4.1.6 in combination with BackupPC:
   https://bugzilla.samba.org/show_bug.cgi?id=11642 (tarmode is no longer 
verbose and ignores verbose flag)
    - patch1 (reenable tarmode verbose, and skip inaccessible files) 
https://attachments.samba.org/attachment.cgi?id=11733
    - patch 2 (modified clitar.c for tarmode verbose) 
https://attachments.samba.org/attachment.cgi?id=11734
   https://bugzilla.redhat.com/show_bug.cgi?id=1294761 (mis-interpreted failure 
of new tar:\d+ lines) (fix: 
https://bugzilla.redhat.com/attachment.cgi?id=1111264&action=diff)
  
  Package Information:
  
   0)root@essrv2:~ $ dpkg -l | grep -E "(smb|samba|backuppc)"
   ii backuppc 3.3.0-1ubuntu1 amd64 high-performance, enterprise-grade system 
for backing up PCs
   ii libpam-smbpass:amd64 2:4.3.8+dfsg-0ubuntu0.14.04.2 amd64 pluggable 
authentication module for Samba
   ii libsmbclient:amd64 2:4.3.8+dfsg-0ubuntu0.14.04.2 amd64 shared library for 
communication with SMB/CIFS servers
   ii python-samba 2:4.3.8+dfsg-0ubuntu0.14.04.2 amd64 Python bindings for Samba
   ii samba 2:4.3.8+dfsg-0ubuntu0.14.04.2 amd64 SMB/CIFS file, print, and login 
server for Unix
   ii samba-common 2:4.3.8+dfsg-0ubuntu0.14.04.2 all common files used by both 
the Samba server and client
   ii samba-common-bin 2:4.3.8+dfsg-0ubuntu0.14.04.2 amd64 Samba common files 
used by both the server and the client
   ii samba-doc 2:4.3.8+dfsg-0ubuntu0.14.04.2 all Samba documentation
   ii samba-dsdb-modules 2:4.3.8+dfsg-0ubuntu0.14.04.2 amd64 Samba Directory 
Services Database
   ii samba-libs:amd64 2:4.3.8+dfsg-0ubuntu0.14.04.2 amd64 Samba core libraries
   ii samba-vfs-modules 2:4.3.8+dfsg-0ubuntu0.14.04.2 amd64 Samba Virtual 
FileSystem plugins
   ii smbclient 2:4.3.8+dfsg-0ubuntu0.14.04.2 amd64 command-line SMB/CIFS 
clients for Unix
  
  System information of the update:
  
   0)root@essrv2:~ $ grep samba /var/log/apt/history.log | sed "s|),|)\n|g" | 
grep -E "(samba|smb)"
   Upgrade: libpam-smbpass:amd64 (4.1.6+dfsg-1ubuntu2.14.04.13, 
4.3.8+dfsg-0ubuntu0.14.04.2)
    python-samba:amd64 (4.1.6+dfsg-1ubuntu2.14.04.13, 
4.3.8+dfsg-0ubuntu0.14.04.2)
    samba:amd64 (4.1.6+dfsg-1ubuntu2.14.04.13, 4.3.8+dfsg-0ubuntu0.14.04.2)
    samba-dsdb-modules:amd64 (4.1.6+dfsg-1ubuntu2.14.04.13, 
4.3.8+dfsg-0ubuntu0.14.04.2)
    samba-common-bin:amd64 (4.1.6+dfsg-1ubuntu2.14.04.13, 
4.3.8+dfsg-0ubuntu0.14.04.2)
    samba-libs:amd64 (4.1.6+dfsg-1ubuntu2.14.04.13, 4.3.8+dfsg-0ubuntu0.14.04.2)
    samba-doc:amd64 (4.1.6+dfsg-1ubuntu2.14.04.13, 4.3.8+dfsg-0ubuntu0.14.04.2)
    smbclient:amd64 (4.1.6+dfsg-1ubuntu2.14.04.13, 4.3.8+dfsg-0ubuntu0.14.04.2)
    samba-vfs-modules:amd64 (4.1.6+dfsg-1ubuntu2.14.04.13, 
4.3.8+dfsg-0ubuntu0.14.04.2)
    samba-common:amd64 (4.1.6+dfsg-1ubuntu2.14.04.13, 
4.3.8+dfsg-0ubuntu0.14.04.2)
    libsmbclient:amd64 (4.1.6+dfsg-1ubuntu2.14.04.13, 
4.3.8+dfsg-0ubuntu0.14.04.2)
  
  Log of backup when failing:
  
   Running: /usr/bin/smbclient \\\\esrouter\\backups -U backup -E -d 1 -c 
tarmode\ full -TcrX - \*.sysdmp.tar.xz
   full backup started for share backups
   Xfer PIDs are now 25749,25748
   Domain=[E_SPIRIT] OS=[Windows 6.1] Server=[Samba 4.3.8-Ubuntu]
   tar:316 tarmode is now full, system, hidden, noreset, quiet
   tar:712 Total bytes received: 224900956
     create 644 0/0 138326 esrouter.2016-04-26.packages
     pool 644 0/0 136349 esrouter.2016-04-23.packages
     pool 644 0/0 27551 esrouter.2016-04-23.dpkg
     create 644 0/0 56037724 esrouter.2016-04-23.evh.tar.xz
     create 644 0/0 56017156 esrouter.2016-04-24.evh.tar.xz
     create 644 0/0 27964 esrouter.2016-04-26.dpkg
     pool 644 0/0 136349 esrouter.2016-04-24.packages
     create 644 0/0 138326 esrouter.2016-04-25.packages
     create 644 0/0 27964 esrouter.2016-04-25.dpkg
     pool 644 0/0 27551 esrouter.2016-04-24.dpkg
     create 644 0/0 56090628 esrouter.2016-04-26.evh.tar.xz
     create 644 0/0 56095068 esrouter.2016-04-25.evh.tar.xz
   tarExtract: Done: 0 errors, 4 filesExist, 327800 sizeExist, 77902 
sizeExistComp, 12 filesTotal, 224900956 sizeTotal
   Got fatal error during xfer (No files dumped for share backups)
   Backup aborted (No files dumped for share backups)
   Saving this as a partial backup, replacing the prior one (got 12 and 0 files 
versus 0)
   Running: /usr/bin/smbclient \\\\esrouter\\backups -U backup -E -d 1 -c 
tarmode\ full\ verbose -TcrX - \*.sysdmp.tar.xz
   full backup started for share backups
   Xfer PIDs are now 23275,23274
   Domain=[E_SPIRIT] OS=[Windows 6.1] Server=[Samba 4.3.8-Ubuntu]
   tar:316 tarmode is now full, system, hidden, noreset, verbose
   tar:712 Total bytes received: 225006494
     create 644 0/0 56140872 esrouter.2016-04-27.evh.tar.xz
     pool 644 0/0 138326 esrouter.2016-04-26.packages
     pool 644 0/0 56017156 esrouter.2016-04-24.evh.tar.xz
     pool 644 0/0 138326 esrouter.2016-04-27.packages
     pool 644 0/0 27964 esrouter.2016-04-26.dpkg
     pool 644 0/0 27964 esrouter.2016-04-27.dpkg
     pool 644 0/0 136349 esrouter.2016-04-24.packages
     pool 644 0/0 138326 esrouter.2016-04-25.packages
     pool 644 0/0 27964 esrouter.2016-04-25.dpkg
     pool 644 0/0 27551 esrouter.2016-04-24.dpkg
     pool 644 0/0 56090628 esrouter.2016-04-26.evh.tar.xz
     pool 644 0/0 56095068 esrouter.2016-04-25.evh.tar.xz
   tarExtract: Done: 0 errors, 11 filesExist, 168865622 sizeExist, 168378417 
sizeExistComp, 12 filesTotal, 225006494 sizeTotal
   Got fatal error during xfer (No files dumped for share backups)
   Backup aborted (No files dumped for share backups)
   Not saving this as a partial backup since it has fewer files than the prior 
one (got 12 and 0 files versus 12)
  
  Log of working backup:
  
   Running: /usr/bin/smbclient \\\\esrouter\\backups -U backup -E -d 1 -c 
tarmode\ full -TcrX - \*.sysdmp.tar.xz
   full backup started for share backups
   Xfer PIDs are now 20343,20342
   tar_re_search set
   Domain=[E_SPIRIT] OS=[Unix] Server=[Samba 4.1.6-Ubuntu]
   tarmode is now full, system, hidden, noreset, verbose
   tar: dumped 12 files and directories
   Total bytes written: 223928320
     pool 644 0/0 55839072 esrouter.2016-04-13.evh.tar.xz
     pool 644 0/0 124612 esrouter.2016-04-13.packages
     pool 644 0/0 124612 esrouter.2016-04-14.packages
     pool 644 0/0 25011 esrouter.2016-04-11.dpkg
     pool 644 0/0 25011 esrouter.2016-04-12.dpkg
     pool 644 0/0 55829392 esrouter.2016-04-11.evh.tar.xz
     pool 644 0/0 25011 esrouter.2016-04-13.dpkg
     pool 644 0/0 124612 esrouter.2016-04-12.packages
     pool 644 0/0 124612 esrouter.2016-04-11.packages
     pool 644 0/0 25011 esrouter.2016-04-14.dpkg
     pool 644 0/0 55820624 esrouter.2016-04-12.evh.tar.xz
     create 644 0/0 55838452 esrouter.2016-04-14.evh.tar.xz
   tarExtract: Done: 0 errors, 11 filesExist, 168087580 sizeExist, 167649233 
sizeExistComp, 12 filesTotal, 223926032 sizeTotal

-- 
You received this bug notification because you are a member of Ubuntu
Server, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1576187

Title:
  backuppc/smb: BackupPC failes to backup SMB shares after smbclient
  update

To manage notifications about this bug go to:
https://bugs.launchpad.net/backuppc/+bug/1576187/+subscriptions

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to