[krbdev.mit.edu #6002] krb5_rc_io_creat should use mkstemp

Ken Raeburn via RT rt-comment at krbdev.mit.edu
Thu Jul 17 20:47:57 EDT 2008


On Jul 17, 2008, at 11:02, Tom Yu via RT wrote:
> mkstemp() does not take file mode flags, so to get the correct file
> permissions on the file, we need to either use umask() (not
> thread-friendly) or fchmod().

With fchmod, we would have a race condition where some other party  
could open the file after it was created but before the fchmod call.   
In the normal UNIX model, fchmod does not revoke access to an already  
opened file.




More information about the krb5-bugs mailing list