Bug#886352: tar: garbage instead of owner set in TAR_OPTIONS

2018-01-25 Thread Jakub Wilk

Control: forwarded -1 
https://lists.gnu.org/archive/html/bug-tar/2016-09/msg5.html
Tags: -1 + fixed-upstream

http://git.savannah.gnu.org/cgit/tar.git/commit/?id=c2886473a803 (which 
is included in tar 1.30) fixes it for me.


--
Jakub Wilk



Bug#886352: tar: garbage instead of owner set in TAR_OPTIONS

2018-01-04 Thread Jakub Wilk

* Jakub Wilk , 2018-01-04, 21:01:

$ export TAR_OPTIONS='--owner root --group root --mode go-r'
$ tar -cvvf foo.tar /dev/null
tar: Removing leading `/' from member names
crw--w--w- `/dev/null   1,3 2018-01-04 18:42 /dev/null


Valgrind suggests it's a use-after-free:

   Invalid read of size 1
  at 0x48323D8: strlen (in 
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
  by 0x14DBD9: xstrdup (xmalloc.c:121)
  by 0x116616: start_header (create.c:944)
  by 0x118070: dump_file0 (create.c:1951)
  by 0x118070: dump_file (create.c:1981)
  by 0x118C43: create_archive (create.c:1438)
  by 0x10E2DA: main (tar.c:2752)
Address 0x4b07280 is 0 bytes inside a block of size 5 free'd
  at 0x4830478: free (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
  by 0x13A222: wordsplit_free_words (wordsplit.c:1551)
  by 0x13A2D9: wordsplit_free (wordsplit.c:1561)
  by 0x10D6AB: parse_default_options (tar.c:2226)
  by 0x10D6AB: decode_options (tar.c:2331)
  by 0x10D6AB: main (tar.c:2726)
Block was alloc'd at
  at 0x482F2BC: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
  by 0x13AA45: wordsplit_finish (wordsplit.c:557)
  by 0x13AA45: wordsplit_len (wordsplit.c:1529)
  by 0x13AC22: wordsplit (wordsplit.c:1537)
  by 0x10D68C: parse_default_options (tar.c:2217)
  by 0x10D68C: decode_options (tar.c:2331)
  by 0x10D68C: main (tar.c:2726)

--
Jakub Wilk



Bug#886352: tar: garbage instead of owner set in TAR_OPTIONS

2018-01-04 Thread Jakub Wilk

Package: tar
Version: 1.29b-2

$ export TAR_OPTIONS='--owner root --group root --mode go-r'
$ tar -cvvf foo.tar /dev/null
tar: Removing leading `/' from member names
crw--w--w- `/dev/null   1,3 2018-01-04 18:42 /dev/null


-- System Information:
Architecture: i386

Versions of packages tar depends on:
ii  libacl1  2.2.52-3+b1
ii  libc62.26-1
ii  libselinux1  2.7-2

--
Jakub Wilk