View Issue Details

IDProjectCategoryView StatusLast Update
0003254CentOS-5tarpublic2011-01-26 20:20
Status newResolutionopen 
Product Version5.2 
Target VersionFixed in Version 
Summary0003254: Error Message: "tar: <path_to_file>: Warning: Cannot acl_from_text: Invalid argument" when extrating from tar-archive.
Description0. using "tar-1.15.1-23.0.1.el5"
1. creating e.g. a tar-archive by
   "tar -cf test.tar --directory=/usr/share/icons --acls --xattrs . "
   * "--acls" is it seems to be mandatory for the error.
2. extracting the tar archive by "tar -xf test.tar"
   --> the error (see Summary) occurs on many but not all files of the archive.
3. i propose the error to have a random Reproducibility because of my analysis
   of the source files.
Additional InformationAnalysis of the source-files:

1. install "tar-1.15.1-23.0.1.el5.src.rpm"
   by "rpm -ivh tar-1.15.1-23.0.1.el5.src.rpm".

2. run "rpmbuild -bp /usr/src/redhat/SPECS/tar.spec"

3. the file "/usr/src/redhat/BUILD/tar-1.15.1/src/extract.c" is now called
   "extract.c" .

4. the file "/usr/src/redhat/BUILD/tar-1.15.1/src/xheader.c" is now called
   "xheader.c" .

5. see lines# 1191 and 1192 of "xheader.c":
   "st->acls_a_ptr = xmemdup (arg, size + 1);
    st->acls_a_len = size;":
   "st->acls_a_ptr" is a zero terminated string (char*). so the trailing zero
   has to be copied too ("size + 1");

6. in "extract.c" line# 351 the same kind of string is duplicated by:
   "data->acls_a_ptr = xmemdup(st->acls_a_ptr, st->acls_a_len);"; the trailing
   zero is not copied.

7. on my opinion, line# 351 of "extract.c" should be replaced by the following
      data->acls_a_ptr = xmemdup(st->acls_a_ptr, st->acls_a_len + 1);
      data->acls_a_len = st->acls_a_len;

8. on my opinion for analogue reasons, line# 358:
   "data->acls_d_ptr = xmemdup(st->acls_d_ptr, st->acls_d_len);"
   should be replaced by the lines:
      data->acls_d_ptr = xmemdup(st->acls_d_ptr, st->acls_d_len + 1);
      data->acls_d_len = st->acls_d_len;

9. most probably, analogue changes should be applied to the file
   "/usr/src/redhat/BUILD/tar-1.15.1/src/extract.c.mangling" .
10. i am not an expert, consider the above propositions as hints.

11. after changing the source code according to the above propositions, the
    errors did no longer occur.

TagsNo tags attached.




2011-01-26 20:20

reporter   ~0012373

The bug has been resolved in "tar-1.15.1-30.el5.src.rpm" and the corresponding
"compiled" rpms.

Issue History

Date Modified Username Field Change
2008-11-19 22:26 tbruecker New Issue
2011-01-26 20:20 tbruecker Note Added: 0012373