lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev REUSE_TEMPFILES problem (more)


From: Klaus Weide
Subject: Re: lynx-dev REUSE_TEMPFILES problem (more)
Date: Sat, 17 Jul 1999 05:16:02 -0500 (CDT)

On Fri, 16 Jul 1999, Leonid Pauzner wrote:

> I know no reason for this low level programming around LYOpenTempRewrite(),
> why not remove the file and create new tempfile with the same file name
> and permissions. 

That's what it should essientially do for DOS.

> Perhaps multitasking force us to be sure
> nobody will use our file name within short timeslot after removing
> but before creating another...

Yes, for Unix somebody could write a program to create the file in
that timeslot, possibly as a symbolic link pointing somewhere else for
malicious purposes.  The code in OpenHiddenFile() should still be
able to detect this and fail, but then LYOpenTempRewrite() would
have to add code to deal with failue of OpenHiddenFile().  It seemed
better to me to just keep the file around if it exists, ie. just
truncate it, so no window occurs in which a symlink can be put in
its place.  (Assuming generally sane conditions, i.e 'sticky bit'
semantics in case of a world-writable shared directory).

This may not be the best way, feel free to submit something better.

   Klaus


reply via email to

[Prev in Thread] Current Thread [Next in Thread]