home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / mod.std.unix.v5 / text0040.txt < prev    next >
Encoding:
Internet Message Format  |  1987-06-30  |  2.5 KB

  1. Date: Thu, 6 Feb 86 06:06:25 EST
  2. >From: Alex Dupuy <dupuy%garfield@COLUMBIA.EDU>
  3.  
  4. Organization: Columbia University
  5.  
  6. In <4103@ut-sally.UUCP> std-unix@ut-sally.UUCP (John Quarterman) writes:
  7. > The more interesting question is *how* do you set a umask on a directory?  Do
  8. > you try to derive the bits from the directory mode bits in some way? ...  And
  9. > how do you get the umask inherited by child directories?
  10. > I would think the preferred approach would be to somehow derive the umask
  11. > from the directory mode bits.  Inheriting could be done by just setting the
  12. > umask for all the subdirectories with find.  Except that mkdir should likely
  13. > make sure the umask were inherited.
  14.  
  15. Having primarily used bsd Unix for a few years, and before that, Twenex, which
  16. has default file protections on a per-directory basis, I would agree that
  17. keeping the protection masks in the directory tree is better than the Unix's
  18. umask.  Still, as some have pointed out, for reasons of compatibility with tar
  19. and cpio, adding information to the directory structures would be a mistake.
  20. Also, switching over to a purely directory based umask would cause security
  21. problems with existing programs expecting umask to work properly.
  22.  
  23. A directory/process based umask scheme which provides compatibility with the
  24. normal Unix filesystems, and allows naive programs to operate securely (when
  25. opening files in /tmp or /usr/tmp, say) is still possible, and would provide a
  26. more flexible mechanism than the common directory based systems.  It might
  27. work like this:
  28.  
  29.   The setuid and setgid bits in the mode of a directory would be used to
  30.   specify which logical combination of umask and directory mode access bits
  31.   should be used as the mask when creating files or directories.  The logical
  32.   combinations would be
  33.  
  34.     00 mask = umask
  35.     01 mask = umask | ~directory mode
  36.     10 mask = umask & ~directory mode
  37.     11 mask = ~directory mode
  38.  
  39. Users would set their umasks much as they do now, to cover the default case.
  40. Directories like /tmp would be set 00 for security compatibility, while mail
  41. directories would be set 01 for greater protection, project directories would
  42. be set 10 to ensure that files and subdirectories were group writable, and
  43. home directories might be set 11.
  44.  
  45. For the benefit of really paranoid programs/users, two bits could be added to
  46. the umask to override the directory combination bits, although doing so would
  47. add to the complexity of the system without really increasing security or
  48. flexibility.
  49.  
  50.  
  51. @alex
  52.  
  53. Volume-Number: Volume 5, Number 41
  54.  
  55.