The Samba-Bugzilla – Bug 4393
smbclient does not store files with zero filesize in tar-archives
Last modified: 2009-10-20 02:59:29 UTC
After Upgrading from samba version 3.0.14a to 3.0.23c it is no longer
possible to backup files with size 0 byte using the smbclient tar-option.
I created a tar-file using smbclient 3.0.14a. After Upgrading
to 3.0.23c I created a second tar-file from the same share.
It seemed that there were some files missing in the second tar
file (created with smbclient 3.0.23c).
Comparing the filelists with "tar tf" and "diff" showed that all files
whith zero filesize were missing.
So I tried somthing like:
smbclient //server/share -U backupuser -E -d4 -Tqc - 2> debug.log | dd of=backup.tar
For every missing file I found an entry in the debug output like:
file <path/filename> attrib 0x80
getting file <path/filename> of size 0 bytes as a tar file <filename>skipping <path/filename> - initial read failed (file was locked ?)
This happened to all files with zero filesize. There were no other "initial
read failed" errors.
Created attachment 2973 [details]
clitar.c:do_atar() - include empty files
This is a proposed patch for this bug against samba-3.0.27. I've just got slightly bitten by this when my Windows file server disk died, and I had to restore backups created by smbclient in tar mode.
I've tested this in my environment (Fedora 7 i386 Linux on 22.214.171.124 kernel).
Patch was shipped with Samba 3.0.27a.
Closing out bug report.
Thanks a lot for the patch!