🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #1108

Gnutar 1.11.1 bug - ownership of directories when extracted as root

#1108
From: Joseph Tam
Date: Tue, 17 Nov 1992 01:46
76 lines
3186 bytes
You have probably got many reports of this bug, but I'll report it just
in case nobody else has.  Gnutar 1.11.1 doesn't set the ownership correctly
for explicitly created directories when the user is root.  The following
results are from a Sun SparcStation and an SGI Indigo.

Here is the contents of a test archive.

	gnutar tvZf test.tar.Z

	drwxr-xr-x 210/19            0 Nov 17 09:29 1992 test/
	-rw-r--r-- 210/19            0 Nov 17 09:29 1992 test/f1
	drwxr-xr-x 210/19            0 Nov 17 09:29 1992 test/d1/
	drwxr-xr-x 210/19            0 Nov 17 09:29 1992 test/d1/d2/
	-rw-r--r-- 210/19            0 Nov 17 09:29 1992 test/d1/d2/f5
	-rw-r--r-- 210/19            0 Nov 17 09:29 1992 test/d1/d2/f6
	-rw-r--r-- 210/19            0 Nov 17 09:29 1992 test/d1/f4
	-rw-r--r-- 210/19            0 Nov 17 09:29 1992 test/d1/f3
	-rw-r--r-- 210/19            0 Nov 17 09:29 1992 test/f2

user #210 = tam
group #19 = atmos

When extracting the archive as root, I get

	gnutar xZf test.tar.Z
	ls -lR test

	total 1
	drwxr-xr-x   3 root     wheel        512 Nov 17 09:29 d1
	-rw-r--r--   1 tam      atmos          0 Nov 17 09:29 f1
	-rw-r--r--   1 tam      atmos          0 Nov 17 09:29 f2

	test/d1:
	total 1
	drwxr-xr-x   2 root     wheel        512 Nov 17 09:29 d2
	-rw-r--r--   1 tam      atmos          0 Nov 17 09:29 f3
	-rw-r--r--   1 tam      atmos          0 Nov 17 09:29 f4

	test/d1/d2:
	total 0
	-rw-r--r--   1 tam      atmos          0 Nov 17 09:29 f5
	-rw-r--r--   1 tam      atmos          0 Nov 17 09:29 f6


As you can see, the directories have ownership root/wheel.  However, if
you add the f_modified flag, you get the correct ownership at the cost
of changing the original modification time:

	gnutar xmZf test.tar.Z
	ls -lR test

	total 1
	drwxr-xr-x   3 tam      atmos        512 Nov 17 09:40 d1
	-rw-r--r--   1 tam      atmos          0 Nov 17 09:40 f1
	-rw-r--r--   1 tam      atmos          0 Nov 17 09:40 f2

	test/d1:
	total 1
	drwxr-xr-x   2 tam      atmos        512 Nov 17 09:40 d2
	-rw-r--r--   1 tam      atmos          0 Nov 17 09:40 f3
	-rw-r--r--   1 tam      atmos          0 Nov 17 09:40 f4

	test/d1/d2:
	total 0
	-rw-r--r--   1 tam      atmos          0 Nov 17 09:40 f5
	-rw-r--r--   1 tam      atmos          0 Nov 17 09:40 f6


Joseph Tam <tam@ocgy.ubc.ca>   \___ \___________
Department of Oceanography     \___ \___________
University of British Columbia \___ \___________
Vancouver, BC, Canada          \___     \___
V6T 1W5                \___    \___     \___
                       \___    \___     \___
Phone: (604) 822-3911   \_________  \__ \___ \__
Fax:   (604) 822-6091    \______    \__ \___ \__
Technical Details
Message-ID: <846*tam@ocgy.ubc.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ocgy.ubc.ca!tam

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ocgy.ubc.ca!tam
From: tam@ocgy.ubc.ca (Joseph Tam)
Subject: Gnutar 1.11.1 bug - ownership of directories when extracted as root
Message-ID: <846*tam@ocgy.ubc.ca>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Tue, 17 Nov 1992 01:46:00 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 77