Bug 308 - when tar-ing with smbclient i get errors with long names
when tar-ing with smbclient i get errors with long names
Product: Samba 3.0
Classification: Unclassified
Component: smbclient
All Linux
: P2 regression
: none
Assigned To: Jeremy Allison
Depends on:
  Show dependency treegraph
Reported: 2003-08-17 02:37 UTC by Gregor
Modified: 2005-11-14 09:27 UTC (History)
0 users

See Also:

proposed patch against 3.0.0rc2 (1.18 KB, patch)
2003-09-02 08:51 UTC, Craig Barratt
no flags Details
New proposed patch. (2.10 KB, patch)
2003-09-02 16:58 UTC, Jeremy Allison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gregor 2003-08-17 02:37:15 UTC
i tried to raise  NAMSIZ in clitar.h
but it didnt help

[2003/08/17 08:07:38, 5] client/clitar.c:writetarheader(186)
  File name in tar file: ./Zelo dolgo ime imenika/In se eno daljse ime, - ki ima
pikice notri napisane in se malo podaljsano tako da pride cez 100 crk/New Text
Document.txt, size=147,
[2003/08/17 08:07:38, 0] lib/util_str.c:safe_strcpy_fn(515)
  ERROR: string overflow by 1 (101 - 100) in safe_strcpy [\Zelo dolgo ime
imenika\In se eno daljse ime, - ki]
[2003/08/17 08:07:38, 3] client/clitar.c:do_atar(690)
Comment 1 Gerald (Jerry) Carter 2003-08-25 09:04:00 UTC
how long?  Please provide more details.  I'm assuming 
that there are non-ascii characters in the filenames (based
on you email address).  Is this true.
Comment 2 Gregor 2003-08-25 09:49:44 UTC
I get errors with filenames (full paths) if they are longer than 100 chars. 
Files get tar-ed ok, I can untar them also, but the error is signaled.
I tried with nonalfanumeric chars, but this is not the case. I get the error 
also with only alfanumeric chars filename.
Comment 3 Gerald (Jerry) Carter 2003-08-25 21:51:43 UTC
Jeremy,  Can you take a look at these when you get a chance? Thanks.
Comment 4 Gerald (Jerry) Carter 2003-08-27 13:05:16 UTC
RC2 will ship with this issue unresolved.  We'll put it on 
the plate for RC3 and hope to resolve it by then.
Comment 5 Craig Barratt 2003-09-02 08:51:59 UTC
Created attachment 117 [details]
proposed patch against 3.0.0rc2
Comment 6 Craig Barratt 2003-09-02 08:52:41 UTC
This problem happens for me any time there are paths longer
than 100 bytes.

The problem is that the new fixtarname() is passed a string longer
than the indicated length.  The safe_strcpy in the 3.0.0 fixtarname()
at clitar.c line 428 gives an error because strlen(fp) is bigger than
length l.  (In 2.2.x it used the length l rather than the strlen() of
the string so it was fine.)

The attached patch is one way to fix the problem.  Also, the explicit
\0 termination of hb.dbuf.name[] is moved above the optional lowercase
since the string might not be null terminated at that point.
Comment 7 Gregor 2003-09-02 10:34:22 UTC
But this patch limits the filename to NAMSIZ. The purpose of this bug is to 
enable to TAR also long filenames.
Comment 8 Jeremy Allison 2003-09-02 16:58:13 UTC
Created attachment 120 [details]
New proposed patch.

I think this is the correct patch. Please check. JRA.
Comment 9 Gerald (Jerry) Carter 2003-09-23 18:08:19 UTC
marking it as fixed in 3.0.0.  Please test after release and
reopen if it is not fixed.
Comment 10 Gerald (Jerry) Carter 2005-02-07 09:06:17 UTC
originally reported against one of the 3.0.0rc[1-4] releases.
Cleaning up non-production versions.
Comment 11 Gerald (Jerry) Carter 2005-08-24 10:23:47 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.
Comment 12 Gerald (Jerry) Carter 2005-11-14 09:27:52 UTC
database cleanup