smbclient tar problem

root ngoldber at mitre.org
Fri Mar 16 16:17:06 GMT 2001


Hello all.

I'm using Samba 2.0.7 on Linux, and I've been having a problem I can't
figure out. I was backing up a coworker's machine using the smbclient
tar capability. He's got Win2k. I was looking at the tar file that was
generated, and in some of the deeply nested directories, I'd get stuff
like this:

./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/_vti_cnf/activem.gif
./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/_vti_cnf/activep.gif
./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/_vti_cnf/collapse.gif
./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/_vti_cnf/expand.gif
./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/_vti_cnf/first.gifY\031
./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/_vti_cnf/home.giffé\030
./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/_vti_cnf/ielogo.gif\\030
./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/_vti_cnf/img001.GIF\\\\030
./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/_vti_cnf/img002.GIF\\\\\\\\030\201

./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/_vti_cnf/img003.GIF
./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/_vti_cnf/img004.GIFg002.GI\201

I examined the .tar file, at the names that had garbage trailing did not
have the NULL at the end of the name. Additionally, you'd get truncated
file names too:

./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/collapse.gif
./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/expand.gi
./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/first.gif
./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/home.gif
./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/ielogo.gi
./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/img001.GI

I'm fairly sure it has nothing to do with the way clitar.c handles long
filenames with extension blocks, because we created a fake, deeply
nested test directory that worked fine.
What is really weird is that in the debugged output, all of these files
are listed correctly, both in the name reported by the SMB protocol and
in the names passed to the tar functions.
Observe (corresponds to last 4 files listed in top tar file output):

dos_clean_name [\Projects\From MM58836\SPC internal Web\New
Site\groups\SLPG\projects\STRICOM_TIE_speech\_vti_cnf\img001.GIF]
file \Projects\From MM58836\SPC internal Web\New
Site\groups\SLPG\projects\STRICOM_TIE_speech\_vti_cnf\img001.GIF attrib
0x1
getting file \Projects\From MM58836\SPC internal Web\New
Site\groups\SLPG\projects\STRICOM_TIE_speech\_vti_cnf\img001.GIF of size
639 bytes as a tar file img001.GIFWriteTarHdr, Type = 0, Size= 639, Name
= \Projects\From MM58836\SPC internal Web\New
Site\groups\SLPG\projects\STRICOM_TIE_speech\_vti_cnf\img001.GIF
WriteTarHdr, Type = L, Size= 109, Name = /./@LongLink
File name in tar file: ./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/_vti_cnf/img001.GIF,
size=109,
nread=0
write_socket(4,59)
write_socket(4,59) wrote 59
size=699
smb_com=0x2e
--
smb_bcc=0
dos_clean_name [\Projects\From MM58836\SPC internal Web\New
Site\groups\SLPG\projects\STRICOM_TIE_speech\_vti_cnf\img002.GIF]
file \Projects\From MM58836\SPC internal Web\New
Site\groups\SLPG\projects\STRICOM_TIE_speech\_vti_cnf\img002.GIF attrib
0x1
getting file \Projects\From MM58836\SPC internal Web\New
Site\groups\SLPG\projects\STRICOM_TIE_speech\_vti_cnf\img002.GIF of size
639 bytes as a tar file img002.GIFWriteTarHdr, Type = 0, Size= 639, Name
= \Projects\From MM58836\SPC internal Web\New
Site\groups\SLPG\projects\STRICOM_TIE_speech\_vti_cnf\img002.GIF
WriteTarHdr, Type = L, Size= 109, Name = /./@LongLink
File name in tar file: ./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/_vti_cnf/img002.GIF,
size=109,
nread=0
write_socket(4,59)
write_socket(4,59) wrote 59
size=699
smb_com=0x2e
--
smb_bcc=0
dos_clean_name [\Projects\From MM58836\SPC internal Web\New
Site\groups\SLPG\projects\STRICOM_TIE_speech\_vti_cnf\img003.GIF]
file \Projects\From MM58836\SPC internal Web\New
Site\groups\SLPG\projects\STRICOM_TIE_speech\_vti_cnf\img003.GIF attrib
0x1
getting file \Projects\From MM58836\SPC internal Web\New
Site\groups\SLPG\projects\STRICOM_TIE_speech\_vti_cnf\img003.GIF of size
639 bytes as a tar file img003.GIFWriteTarHdr, Type = 0, Size= 639, Name
= \Projects\From MM58836\SPC internal Web\New
Site\groups\SLPG\projects\STRICOM_TIE_speech\_vti_cnf\img003.GIF
WriteTarHdr, Type = L, Size= 109, Name = /./@LongLink
File name in tar file: ./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/_vti_cnf/img003.GIF,
size=109,
nread=0
write_socket(4,59)
write_socket(4,59) wrote 59
size=699
smb_com=0x2e
--
smb_bcc=0
dos_clean_name [\Projects\From MM58836\SPC internal Web\New
Site\groups\SLPG\projects\STRICOM_TIE_speech\_vti_cnf\img004.GIF]
file \Projects\From MM58836\SPC internal Web\New
Site\groups\SLPG\projects\STRICOM_TIE_speech\_vti_cnf\img004.GIF attrib
0x1
getting file \Projects\From MM58836\SPC internal Web\New
Site\groups\SLPG\projects\STRICOM_TIE_speech\_vti_cnf\img004.GIF of size
639 bytes as a tar file img004.GIFWriteTarHdr, Type = 0, Size= 639, Name
= \Projects\From MM58836\SPC internal Web\New
Site\groups\SLPG\projects\STRICOM_TIE_speech\_vti_cnf\img004.GIF
WriteTarHdr, Type = L, Size= 109, Name = /./@LongLink
File name in tar file: ./Projects/From MM58836/SPC internal Web/New
Site/groups/SLPG/projects/STRICOM_TIE_speech/_vti_cnf/img004.GIF,
size=109,
nread=0
write_socket(4,59)
write_socket(4,59) wrote 59
size=699
smb_com=0x2e

Anyone have any ideas on why this is happening? It's a real problem.

Thanks,
Neil Goldberg






More information about the samba mailing list