home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / gnu / utils / bug / 1981 < prev    next >
Encoding:
Internet Message Format  |  1992-11-07  |  2.0 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!hal.com!olivea!charnel!rat!usc!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ohm.york.ac.UK!nigelm
  2. From: nigelm@ohm.york.ac.UK (Nigel Metheringham)
  3. Newsgroups: gnu.utils.bug
  4. Subject: Directory extract ownership bug in gnu tar 1.11.1
  5. Message-ID: <m0mn5PO-000F0hC@glenlivet.ohm.york.ac.uk>
  6. Date: 5 Nov 92 11:29:53 GMT
  7. Sender: gnulists@ai.mit.edu
  8. Distribution: gnu
  9. Organization: GNUs Not Usenet
  10. Lines: 41
  11. Approved: bug-gnu-utils@prep.ai.mit.edu
  12.  
  13. Gnu tar 1.11.1 does not set the ownership of extracted directories - no
  14. matter whether you are root or how many preserve type options you add.
  15.  
  16. The included patch fixes this, but is just a very fast workround - ie I
  17. haven't checked it in detail to make sure it doesn't break anything
  18. else.  The code to do the chown is (obviously) stolen from slightly
  19. further up the file (in the file extract code!).
  20.  
  21.     Nigel.
  22.  
  23. --- extract.c~    Wed Sep 16 00:54:58 1992
  24. +++ extract.c    Thu Nov  5 11:21:34 1992
  25. @@ -649,6 +649,21 @@
  26.              msg("Added write and execute permission to directory %s",
  27.                skipcrud+current_file_name);
  28.          }
  29. +        /*
  30. +         * If we are root, set the owner and group of the extracted
  31. +         * dir.  This does what is wanted both on real Unix and on
  32. +         * System V.  If we are running as a user, we extract as that
  33. +         * user; if running as root, we extract as the original owner.
  34. +         * *** Missing on distribution 1.11.1 version - added by nigelm.
  35. +         */
  36. +        if (we_are_root || f_do_chown) {
  37. +            if (chown(skipcrud + current_file_name,
  38. +                   hstat.st_uid, hstat.st_gid) < 0) {
  39. +               msg_perror("cannot chown dir %s to uid %d gid %d",
  40. +                      skipcrud + current_file_name,
  41. +                      hstat.st_uid,hstat.st_gid);
  42. +            }
  43. +        }
  44.  
  45.          if (f_modified)
  46.            goto set_filestat;
  47.  
  48.  
  49.  -- 
  50. # Nigel Metheringham         #  EMail: nigelm@ohm.york.ac.uk #
  51. # System Administrator       #  Phone: +44 904 432374        #
  52. # Department of Electronics  #  Fax:   +44 904 432335        #
  53. #     University of York, Heslington, York, UK, YO1 5DD      #
  54.