home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.23 / text0002.txt < prev    next >
Encoding:
Text File  |  1991-06-15  |  1.8 KB  |  42 lines

  1. Submitted-by: martelli@cadlab.sublink.ORG (Alex Martelli)
  2.  
  3. Thanks to Donn Terry and the others responding, both here and by Email;
  4. now I understand the S_ISUID/S_ISGID issue better!
  5.  
  6. donn@hpfcrn.fc.hp.com (Donn Terry) writes:
  7.     ...
  8. :POSIX.1 says "On a regular file, [the S_ISUID] bit should be cleared
  9. :on any write."  (P102, L684 and 688).  
  10. :
  11. :Two key things here:  "should" (not "shall") and "write" (not write() in
  12. :italics). 
  13. :
  14. :"Should" is a recommendation, not a requirement.  Thus, a conforming
  15. :system doesn't have to do it.  This is compromise wording, as some
  16. :existing implementations would not conform if that was a requirement.
  17. :(This is a consequence of the definition of "should".)
  18.     ...
  19. :If you care, it's perfectly reasonable in a RFP (or any other purchase)
  20. :to specify any "should" as a "shall" (or "shall not").  NIST did that in
  21. :one place in FIPS 151-1.  X/Open has done it in several places.  In the
  22.  
  23. ...but NOT here; indeed, digging into XPG3 I find in vol 2 pg 519 at the
  24. end of the Description of write():  "...and if the file is a regular
  25. file, the S_ISUID and S_ISGID bits of the file mode may be cleared".
  26.  
  27. Indeed, the "may" sounds to my non-native-speaker ears as even weaker
  28. than the "should"...  so I guess that as a multiplatform application
  29. developer I definitely HAVE TO learn to live with both behaviors (the
  30. chmod() page of XPG3 also has threateninly mysterious caveats about what
  31. is or is not done with S_ISUID/S_ISGID, so it won't necessarily be easy
  32. to compensate for varying behavior of write() in this respect, alas...).
  33.  
  34. -- 
  35. Alex Martelli - CAD.LAB s.p.a., v. Stalingrado 53, Bologna, Italia
  36. Email: (work:) martelli@cadlab.sublink.org, (home:) alex@am.sublink.org
  37. Phone: (work:) ++39 (51) 371099, (home:) ++39 (51) 250434; 
  38. Fax: ++39 (51) 366964 (work only), Fidonet: 332/401.3 (home only).
  39.  
  40. Volume-Number: Volume 23, Number 3
  41.  
  42.