NetBSD-Bugs archive

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

bin/54467: new tar overwrites symlinks to directories



>Number:         54467
>Category:       bin
>Synopsis:       new tar overwrites symlinks to directories
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 15 16:25:00 +0000 2019
>Originator:     Martin Husemann
>Release:        NetBSD 9.99.7
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD whoever-brings-the-night.aprisoft.de 9.99.7 NetBSD 9.99.7 (WHOEVER) #293: Mon Aug 12 12:59:36 CEST 2019 martin%seven-days-to-the-wolves.aprisoft.de@localhost:/work/src/sys/arch/sparc64/compile/WHOEVER sparc64
Architecture: sparc64
Machine: sparc64
>Description:

The new tar(1) is overeager in restoring directories if those already exist
as a symlink to another directory.

This kills updates on machines that have /usr as a symlink to someplace else
with our base.tgz containing

	 drwxr-xr-x  0 root   wheel        0 Jul 14 16:36 ./usr

>How-To-Repeat:

Try this:

	cd /tmp
	mkdir test
	cd test
	mkdir a b b/c
	tar cvf /tmp/test.tar .
	mv b d
	ln -s d b
	tar xvf /tmp/test.tar
	ls -l

It should show something like:

total 8
drwxr-xr-x  2 martin  wheel   0 Aug 15 18:20 a/
lrwxr-xr-x  1 martin  wheel   1 Aug 15 18:20 b@ -> d
drwxr-xr-x  3 martin  wheel  48 Aug 15 18:20 d/

but in -current it shows:

total 16
drwxr-xr-x  2 martin  wheel   0 Aug 15 18:22 a/
drwxr-xr-x  3 martin  wheel  48 Aug 15 18:22 b/
drwxr-xr-x  3 martin  wheel  48 Aug 15 18:22 d/


>Fix:
n/a



Home | Main Index | Thread Index | Old Index