KSaveFile

Dirk Mueller mueller at kde.org
Sun Feb 22 16:27:08 GMT 2004


On Sunday 22 February 2004 17:05, Julian Rockey wrote:

> I don't think there can be a rename race as the temp file being chmodded
> was created by KTempFile, and has not been closed, so is still open O_EXCL.

sorry? what does O_EXCL have to do with the rename race? O_EXCL doesn't forbid 
renaming of the file while it is open: 

process A:

open(file.new, .. O_EXCL)
..
chmod(file.new, .. | S_IROTH)


process B:

rename(file.new, file.new2);
rename(somefile, file.new)


Now somefile (which was previously not world readable) is world readable. 


Dirk




More information about the kde-core-devel mailing list