home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / bsd / 10951 < prev    next >
Encoding:
Text File  |  1993-01-06  |  1.4 KB  |  32 lines

  1. Newsgroups: comp.unix.bsd
  2. Path: sparky!uunet!munnari.oz.au!metro!ipso!runxtsa!bde
  3. From: bde@runx.oz.au (Bruce Evans)
  4. Subject: Re: [386 BSD] Permissions set wrong - HELP
  5. Message-ID: <1993Jan6.124711.8827@runx.oz.au>
  6. Organization: RUNX Un*x Timeshare.  Sydney, Australia.
  7. References: <C0618x.6uL@ais.org> <1993Jan1.105359.4807@runx.oz.au> <1id1uiINN6n7@manuel.anu.edu.au>
  8. Date: Wed, 6 Jan 93 12:47:11 GMT
  9. Lines: 21
  10.  
  11. In article <1id1uiINN6n7@manuel.anu.edu.au> titus@coombs.anu.edu.au (titus chiu) writes:
  12. >bde@runx.oz.au (Bruce Evans) writes:
  13. >
  14. >>zip).  One advantage of cpio over tar is that it restores directory
  15. >>permissions so the default /tmp permissions would get fixed up by a
  16. >>/tmp with the correct permissions in another archive.
  17. >
  18. >that is incorrect i am afraid ;) .. tar will restore permission for
  19. >root if the -p flag is used (i am pretty sure gnu tar has this flag) ..
  20.  
  21. Nope.  gnu tar-1.10 only restores the permission if the directory doesn't
  22. already exist.  This seems to be a bug in gnu tar.  tar calls mkdir(),
  23. which fails when the directory already exists.  It then calls make_dirs()
  24. which returns early when errno != ENOENT.  Apparently too early.  The
  25. errno from mkdir is EEXISTS.
  26.  
  27. For directories not explicitly mentioned in the tar file, the -p flag
  28. causes the umask to be ignored, so the directories get permissions 777.
  29. I think ~umask is a better guess for the right permissions in this case.
  30. -- 
  31. Bruce Evans  (bde@runx.oz.au)
  32.