Re: [dev] [sbase] [tar] some errors
On Fri, Dec 23, 2016 at 08:07:11PM +0000, Cág wrote:
> Hi,
>
> I was trying to create an archive with my gtk themes with
> "tar -c themes | xz > themes.tar.xz"
> and it says "tar:strlcpy: input string too long".
>
> The same happens without piping. BusyBox' tar did this
> fine.
>
> Also, when trying to extract the created archive (tar -xvf),
> it says "malformed tar archive". I've tried creating an
> archive from a single file, tar does it but when trying to
> extract it I get the error above.
>
>
> Cág
>
Hello,
the above error message appears if estrlcpy() is called with an input
string of greater length than the output buffer. estrlcpy() is called
three times from within tar.c (I am uncertain as to whether tar.c calls
library functions that might call estrlcpy(), but that is of little
consequence). One instance is
estrlcpy(h->name, path, sizeof(h->name));
Well, that looks like it might be problematic, doesn't it? Especially
when you find out, that the size of h->name there is 100 bytes. path
contains, of course, the entire file path relative to the starting
directory. In short, you will get this error message whenever trying to
package files with a total relative path length of more than 100
characters.
sbase tar does not appear to implement any of the existing schemes for
handling long file names, probably because those "suck". Except of
course that a tar program which fails if tasked with abnormal workload
sucks way more than kludgy file formats.
Some further reading revealed GNU tar's trick to be to insert a file of
type 'L' (76), call it "././_AT_LongLink" or something (name isn't really
important) and write the file name into that file's content. Then add
the file as normal, truncating the name to 100 characters. Is that a
viable option for sbase tar?
Ciao,
Markus
Received on Sat Dec 24 2016 - 11:27:22 CET
This archive was generated by hypermail 2.3.0
: Sat Dec 24 2016 - 11:36:13 CET