Bug 6161 - smbclient corrupts source path in tar mode
smbclient corrupts source path in tar mode
Product: Samba 3.2
Classification: Unclassified
Component: Client tools
x86 Linux
: P3 normal
: ---
Assigned To: Samba Bugzilla Account
Samba QA Contact
: 5921 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2009-03-04 22:52 UTC by Dan Singletary
Modified: 2009-08-23 02:39 UTC (History)
2 users (show)

See Also:

Patch for 3.2.x (1.03 KB, patch)
2009-03-05 19:17 UTC, Jeremy Allison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Singletary 2009-03-04 22:52:07 UTC
Using BackupPC and smbclient to pull files from hosts for backup.  Isolated a problem to smbclient corrupting the source path that BackupPC is specifying to it.

For example, if I issue the command:
/usr/bin/smbclient \\\\buster\\C\$ -U dvsing -E -d 2 -c tarmode\ full -Tc t.tar 'Documents and Settings\Administrator\My Documents\*'

I get the output:
added interface eth2 ip=fe80::221:85ff:fe64:3fcf%eth2 bcast=fe80::ffff:ffff:ffff:ffff%eth2 netmask=ffff:ffff:ffff:ffff::
added interface eth2:0 ip= bcast= netmask=
added interface lo ip=::1 bcast=::1 netmask=ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
added interface lo ip= bcast= netmask=
tdb(unnamed): tdb_open_ex: could not open file /var/lib/samba/gencache.tdb: Permission denied
Got a positive name query response from ( )
Enter dvsing's password: 
Domain=[BUSTER] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
tarmode is now full, system, hidden, noreset, verbose
                directory \Documents and Settings\Administrator\My Documents\My Documents\
NT_STATUS_OBJECT_NAME_NOT_FOUND listing \Documents and Settings\Administrator\My Documents\My Documents\*
tar: dumped 1 files and directories
Total bytes written: 0

Notice that "My Documents" appears twice (My Documents\My Documents) in the path that's in the debug output.  It was only specified once in the source path.

This bug breaks (among other things) BackupPC's ability to run backups over smb.
Comment 1 Jeremy Allison 2009-03-04 23:39:39 UTC
Can you try and reproduce this with 3.3.1 please ? That's the current stable release tree and will tell me if we've already fixed it in later code.
Comment 2 Dan Singletary 2009-03-05 00:10:52 UTC
I'm using Fedora Core 10, so 3.2.8 is the current working version for FC10 although I do understand you've moved on to 3.3.x.

I'll try and get my hands on the fc11 3.3.1 RPM...
Comment 3 Derrell Lipman 2009-03-05 07:30:56 UTC
corrected component
Comment 4 Derrell Lipman 2009-03-05 07:31:32 UTC
reassign to default assignee
Comment 5 Volker Lendecke 2009-03-05 08:41:31 UTC
Reproduced with master. No patch yet, looking at it.

Thanks for the report,

Comment 6 Jeremy Allison 2009-03-05 19:17:09 UTC
Created attachment 3979 [details]
Patch for 3.2.x

Patch for 3.2.x (should apply also to 3.3.x and above). This was my fault. I broke the argument processing in creating the string for chdir when removing pstrings. This fixes it again. Sorry about that.
Comment 7 Dan Singletary 2009-03-05 19:33:15 UTC
Thanks for fixing this so quickly.

Hopefully the ones that maintain the fc10 repository will grab onto this fix and release a new RPM soon.

Is 3.2.8 the final version for the 3.2 series?
Comment 8 Jeremy Allison 2009-03-05 19:41:56 UTC
We might do another one once pressure of patches builds up, but this has also gone into the 3.3.x tree as the problem still exists there and will be in 3.3.2 (due soon-ish).
Bug Simo or Guenther (Samba Team @ RedHat) to get this into FC.
Comment 9 Guenther Deschner 2009-03-10 06:55:56 UTC
Dan, can you please open a Bug on RH BZ simply pointing to this one ? Then I can provide an update for F10. Thanks.
Comment 10 Guenther Deschner 2009-04-02 16:05:34 UTC
Closing, as Samba rpms containing this fix are provided now in Fedora testing.
Comment 11 Volker Lendecke 2009-08-23 02:39:23 UTC
*** Bug 5921 has been marked as a duplicate of this bug. ***