Bug 4393 - smbclient does not store files with zero filesize in tar-archives
Summary: smbclient does not store files with zero filesize in tar-archives
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: smbclient (show other bugs)
Version: 3.0.23c
Hardware: x86 Linux
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-13 08:50 UTC by Axel Betanski
Modified: 2009-10-20 02:59 UTC (History)
1 user (show)

See Also:


Attachments
clitar.c:do_atar() - include empty files (1.01 KB, patch)
2007-11-16 04:19 UTC, Tomasz Ostrowski
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Axel Betanski 2007-02-13 08:50:03 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.
Comment 1 Tomasz Ostrowski 2007-11-16 04:19:57 UTC
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 2.6.23.1 kernel).
Comment 2 Karolin Seeger 2009-10-20 02:59:29 UTC
Patch was shipped with Samba 3.0.27a.
Closing out bug report.

Thanks a lot for the patch!