home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.13 / text0009.txt < prev    next >
Encoding:
Internet Message Format  |  1988-04-18  |  2.1 KB

  1. From: ahby@bungia.bungia.mn.org (Shane P. McCarron)
  2.  
  3.  
  4. In article <116@longway.TIC.COM> guy@sun.com (Guy Harris) writes:
  5. >From: uunet!Sun.COM!guy (Guy Harris)
  6. >
  7. >This may want to be forwarded to Shane, rather than posted; unfortunately,
  8. >I don't remember his email address.
  9. >
  10. >[ He's ahby@bungia.mn.org or uunet!rutgers!umn-cs!bungia!ahby,
  11. >but this looks like a useful correction of a technical detail
  12. >(one I missed on review) that should be posted. -mod ]
  13. >
  14. >        - Only the super-user shall be allowed to link or
  15. >          unlink directories (2.10.4, lines 938 - 939).
  16. >
  17. >          Another useful option.  A portable application may
  18. >          need to know whether it requires "approprite
  19. >          privileges" to move directories around.
  20. >
  21. >No portable application needs "appropriate privileges" to move directories
  22. >around; it can use "rename()".  The correct way to move anything under a POSIX
  23. >implementation is to use "rename()", not "link()" and "unlink()".
  24.  
  25. Mea culpa, mea culpa :-) 
  26.  
  27. Of course Guy is right.  No portable application may ever require
  28. appropriate privilege and still be portable.  Especially since that
  29. privilege will be very hard to define (or come by) in a trusted
  30. environment.
  31.  
  32. What I was trying to imply was that if appropriate privilege is
  33. required to link() and unlink() directories, and an application needs
  34. that ability for some unforseeable reason, then it should probably
  35. fail to compile on that instance of that implementation.  
  36.  
  37. The rename() call is sufficient for changing the name of a directory, 
  38. but is hardly sufficient for creating multiple links to the same 
  39. directory, or some other arcane use.  It occurs to me that this may
  40. only be possible today using symbolic links, but you get the idea.  My
  41. advice to application developers is to not even try to write code that
  42. requires anything that could be percieved as an option under POSIX.
  43. If you stick to the minimal set, you will be safe.  Your application
  44. won't do anything, but... :-)
  45.  
  46. Thanks for pointing out that rather glaring error.  I must be getting
  47. senile.
  48. -- 
  49. Shane P. McCarron            UUCP: ahby@bungia.mn.org
  50. Systems Analyst                ATT: +1 612 224-9239
  51.  
  52. Volume-Number: Volume 13, Number 10
  53.  
  54.