Thread View: gnu.utils.bug
2 messages
2 total messages
Started by Jurgen Botz
Mon, 04 Jan 1993 05:08
tar-1.11.1: directory owner/modes don't get restored
Author: Jurgen Botz
Date: Mon, 04 Jan 1993 05:08
Date: Mon, 04 Jan 1993 05:08
14 lines
975 bytes
975 bytes
I'm using tar-1.11.1 on a DECstation under Ultrix 4.2 and I'm finding that directory ownerships/modes don't get restored (i.e. when running as root and with -p). Instead directories are created with owner root and mode 700. Files are restored properly. Anybody have a fix for this? Please? Are we going to see a bug-fix release for tar any time soon? A tar 1.11.2 would be nice... I know quite a few serious bugs have been reported since 1.11.1 was released in September. -- Jurgen Botz, jbotz@mtholyoke.edu Northampton, MA, USA
Re: tar-1.11.1: directory owner/modes don't get restored
Author: Jurgen Botz
Date: Sun, 10 Jan 1993 15:42
Date: Sun, 10 Jan 1993 15:42
53 lines
2872 bytes
2872 bytes
In article <9301041508.AA27693@orixa.mtholyoke.edu> I wrote:
>I'm using tar-1.11.1 on a DECstation under Ultrix 4.2 and I'm finding
>that directory ownerships/modes don't get restored (i.e. when running
>as root and with -p). Instead directories are created with owner root
>and mode 700. Files are restored properly.
Included is a fix for this problem. The interesting thing was that
directory ownerships /were/ restored properly when the '-m' flag
(don't restore modification times) was given. The reason is that
with the -m flag the code that set owner, modes, and modification
times was executed and modes/times were not saved for restoring after
the contents of the directory were restored. Without the -m flag
the owner/times/mode code was /not/ executed when directory was
created, but the modes/times but no ownership were saved to be set
after the dir's contents were restored. With my fix ownership is
set correctly, but I'm not sure about whether the -m flag still
behaves as intended, because I don't really understand /exactly/
how it was intended to work. There is some confusion in the overall
structure of the extract.c code with regard to when what should be
done. I think to really fix this code the mega-switch in
extract_archive() needs to be decomposed some more. Anyway, for
most people this patch is probably a sufficient "fix".
- Jurgen Botz
Note: if you applied Jonathan Kamen's recent fix to check the
malloc return values, change the references to malloc in this
fragment to 'ck_malloc' before applying this patch.
---- snip -----------------------------------------------------
--- extract.c.orig Sun Jan 10 17:10:13 1993
+++ extract.c Sun Jan 10 17:36:31 1993
@@ -649,9 +649,6 @@
msg("Added write and execute permission to directory %s",
skipcrud+current_file_name);
}
-
- if (f_modified)
- goto set_filestat;
tmp = (struct saved_dir_info *) malloc (sizeof (struct saved_dir_info));
tmp->path = malloc (strlen (skipcrud + current_file_name) + 1);
strcpy (tmp->path, skipcrud + current_file_name);
@@ -660,6 +657,7 @@
tmp->mtime = hstat.st_mtime;
tmp->next = saved_dir_info_head;
saved_dir_info_head = tmp;
+ goto set_filestat;
case LF_VOLHDR:
if(f_verbose) {
printf("Reading %s\n", current_file_name);
--
Jurgen Botz, jbotz@mtholyoke.edu
Northampton, MA, USA
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads