🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #950

tar-1.11: No directory chown (report +fix)

#950
From: Seth Robertson
Date: Mon, 28 Sep 1992 01:34
31 lines
1543 bytes
My apologies if this has been reported before, but tar is not chowning
the directories to their owner as it creates the directories.  Note
that if tar is trying to extract a file to a directory which does not
exist, my reading of the code indicates that the chown is performed
then.

In any case, here is my fix:

                                        -Seth Robertson
                                         seth@ctr.columbia.edu

--- extract.c.orig	Tue Sep 15 19:54:58 1992
+++ extract.c	Fri Sep 25 06:26:13 1992
@@ -650,6 +650,17 @@
 			  skipcrud+current_file_name);
 		}
 
+#ifndef NODIRCHOWN
+		if (we_are_root || f_do_chown) {
+			 if (chown(skipcrud + current_file_name,
+				   hstat.st_uid, hstat.st_gid) < 0) {
+			   msg_perror("cannot chown file %s to uid %d gid %d",
+				      skipcrud + current_file_name,
+				      hstat.st_uid,hstat.st_gid);
+			 }
+		 }
+#endif
+
 		if (f_modified)
 		  goto set_filestat;
 		tmp = (struct saved_dir_info *) malloc (sizeof (struct saved_dir_info));
Technical Details
Message-ID: <1992Sep28.013403.24492@sol.ctr.columbia.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!uwm.edu!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!ctr.columbia.edu!seth

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!uwm.edu!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!ctr.columbia.edu!seth
From: seth@ctr.columbia.edu (Seth Robertson)
Subject: tar-1.11: No directory chown (report +fix)
Message-ID: <1992Sep28.013403.24492@sol.ctr.columbia.edu>
Sender: gnulists@ai.mit.edu
Organization: Columbia University Center for Telecommunications Research
Distribution: gnu
Date: Mon, 28 Sep 1992 01:34:03 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 33