home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / gnu / utils / bug / 2365 < prev    next >
Encoding:
Text File  |  1993-01-10  |  2.7 KB  |  68 lines

  1. Newsgroups: gnu.utils.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!mtholyoke.EDU!jbotz
  3. From: jbotz@mtholyoke.EDU (Jurgen Botz)
  4. Subject: Re: tar-1.11.1: directory owner/modes don't get restored
  5. Message-ID: <1iqjakINN4hb@slab.mtholyoke.edu>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: Mount Holyoke College
  8. References: <9301041508.AA27693@orixa.mtholyoke.edu>
  9. Distribution: gnu
  10. Date: Sun, 10 Jan 1993 15:42:44 GMT
  11. Approved: bug-gnu-utils@prep.ai.mit.edu
  12. Lines: 54
  13.  
  14. In article <9301041508.AA27693@orixa.mtholyoke.edu> I wrote:
  15. >I'm using tar-1.11.1 on a DECstation under Ultrix 4.2 and I'm finding
  16. >that directory ownerships/modes don't get restored (i.e. when running
  17. >as root and with -p).  Instead directories are created with owner root
  18. >and mode 700.  Files are restored properly.
  19.  
  20. Included is a fix for this problem.  The interesting thing was that
  21. directory ownerships /were/ restored properly when the '-m' flag
  22. (don't restore modification times) was given.  The reason is that
  23. with the -m flag the code that set owner, modes, and modification
  24. times was executed and modes/times were not saved for restoring after
  25. the contents of the directory were restored.  Without the -m flag
  26. the owner/times/mode code was /not/ executed when directory was
  27. created, but the modes/times but no ownership were saved to be set
  28. after the dir's contents were restored.  With my fix ownership is
  29. set correctly, but I'm not sure about whether the -m flag still
  30. behaves as intended, because I don't really understand /exactly/
  31. how it was intended to work.  There is some confusion in the overall
  32. structure of the extract.c code with regard to when what should be
  33. done.  I think to really fix this code the mega-switch in
  34. extract_archive() needs to be decomposed some more.  Anyway, for
  35. most people this patch is probably a sufficient "fix".
  36.  
  37. - Jurgen Botz
  38.  
  39. Note: if you applied Jonathan Kamen's recent fix to check the
  40. malloc return values, change the references to malloc in this
  41. fragment to 'ck_malloc' before applying this patch.
  42.  
  43. ---- snip ----------------------------------------------------- 
  44. --- extract.c.orig    Sun Jan 10 17:10:13 1993
  45. +++ extract.c    Sun Jan 10 17:36:31 1993
  46. @@ -649,9 +649,6 @@
  47.              msg("Added write and execute permission to directory %s",
  48.                skipcrud+current_file_name);
  49.          }
  50. -
  51. -        if (f_modified)
  52. -          goto set_filestat;
  53.          tmp = (struct saved_dir_info *) malloc (sizeof (struct saved_dir_info));
  54.          tmp->path = malloc (strlen (skipcrud + current_file_name) + 1);
  55.          strcpy (tmp->path, skipcrud + current_file_name);
  56. @@ -660,6 +657,7 @@
  57.          tmp->mtime = hstat.st_mtime;
  58.          tmp->next = saved_dir_info_head;
  59.          saved_dir_info_head = tmp;
  60. +        goto set_filestat;
  61.      case LF_VOLHDR:
  62.          if(f_verbose) {
  63.              printf("Reading %s\n", current_file_name);
  64. -- 
  65. Jurgen Botz, jbotz@mtholyoke.edu
  66. Northampton, MA, USA
  67.  
  68.