bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] problem with one-line listing of ACLs (tar tvvvf - --acls)


From: Jim Lowe
Subject: [Bug-tar] problem with one-line listing of ACLs (tar tvvvf - --acls)
Date: Sun, 11 Nov 2018 11:11:41 -0500 (EST)
User-agent: Alpine 2.00 (LRH 1167 2008-08-23)



To: bug-tar
Bug:  Buffer overrun in acls_one_line() and comma missing in acl listing


Instructions to replicate:

make a directory MYDIRNAME with an access *and* a default acl

then process with the following

     star cf -  MY_DIRNAME -H=exustar -acl  | tar tvvvf - --acls


Garbage bytes (including non-printable chars FF FF) appear in the output at the 
end of the line.

Note, this is masked if GNU tar makes the archive such as

    tar cf - --acls  MY_DIRNAME | tar tvvvf - --acls

maybe because GNU tar puts an extra newline at the end of the acl in the 
extended header.


Also a comma is missing in the one-line listing between the
access and default acls.


Here a patches for both:

--- tar-1.30/src/xattrs.c       2017-01-02 07:43:50.000000000 -0500
+++ tar-1.30defbug1/src/xattrs.c        2018-11-08 20:40:14.171212754 -0500
@@ -740,6 +740,8 @@
     {
       fprintf (stdlis, "  a: ");
       acls_one_line ("", ',', st->acls_a_ptr, st->acls_a_len);
+      if (strlen(st->acls_a_ptr))
+          fprintf (stdlis, ",");
       acls_one_line ("default:", ',', st->acls_d_ptr, st->acls_d_len);
       fprintf (stdlis, "\n");
     }


--- tar-1.30/src/xattrs.c       2017-01-02 07:43:50.000000000 -0500
+++ tar-1.30_fix_oneline/src/xattrs.c   2018-11-11 11:04:17.770020637 -0500
@@ -337,6 +337,7 @@
       obstack_grow (&stk, aclstring, move);

       aclstring += move + 1;
+      pos = aclstring - oldstring;
     }








reply via email to

[Prev in Thread] Current Thread [Next in Thread]