KSaveFile

Stephan Kulow coolo at kde.org
Mon Feb 23 13:48:07 GMT 2004


On Sunday 22 February 2004 17:05, Julian Rockey wrote:
> On Sunday 22 Feb 2004 14:32, Dirk Mueller wrote:
> > On Sunday 22 February 2004 13:51, Julian Rockey wrote:
> > > OK to commit this?
> >
> > - use fchmod instead of chmod, otherwise its vulnerable to a rename race..
> > - why lstat? when the original file is a symlink then the permissions will
> > be world read/writeable.
> 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. 
> Still,  I supposed it's better to use fchmod as good practice.
> 
> Point taken about the sym links, and in fact we should go further and avoid 
> clobbering them (as it does now, with or without the previous patch). Revised 
> patch attached.
Your patch is broken. Now KSaveFile won't create new files anymore as your
symlink clobbering prevention prevents all files. And I'm not sure if QDir::canonialPath
is the right way - this is a rather expensive call for what you want to achieve.
I reverted for now

Greetings, Stephan

-- 
There may be no I in TEAM, but a M and an E.




More information about the kde-core-devel mailing list