You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Marc Slemko <ma...@worldgate.com> on 1997/12/22 22:37:03 UTC

Re: cvs commit: apachen/htdocs/manual/mod core.html

On 22 Dec 1997 marc@hyperreal.org wrote:

>   	- add warning about possible denial of service attack with
>   	  LockFile in world writable directory

This is only possible with fcntl serialized accept because 
flock serialized accept does an explicit unlink().

Is probably worth fixing by having flock serialized accept unlink
it as well before starting.  The only risk here is that we could
unlink a file we shouldn't, but...


Re: cvs commit: apachen/htdocs/manual/mod core.html

Posted by Marc Slemko <ma...@worldgate.com>.
On Mon, 22 Dec 1997, Dean Gaudet wrote:

> I think you have fcntl() and flock() backwards.  fcntl() is the sane one
> that we can unlink() immediately.  flock() is the insane one that we have
> to keep around the file and re-open in each child.

No, flock() _right now_ unlinks before it tries to open the file.  It has
to because otherwise on your typical server, booting, hitting the power
button, then rebooting would kill it if it didn't.

fcntl doesn't.

> 
> I'm not happy with the server unlink()ing files it didn't create. 
> 
> Dean
> 
> On Mon, 22 Dec 1997, Marc Slemko wrote:
> 
> > On 22 Dec 1997 marc@hyperreal.org wrote:
> > 
> > >   	- add warning about possible denial of service attack with
> > >   	  LockFile in world writable directory
> > 
> > This is only possible with fcntl serialized accept because 
> > flock serialized accept does an explicit unlink().
> > 
> > Is probably worth fixing by having flock serialized accept unlink
> > it as well before starting.  The only risk here is that we could
> > unlink a file we shouldn't, but...
> > 
> > 
> 


Re: cvs commit: apachen/htdocs/manual/mod core.html

Posted by Dean Gaudet <dg...@arctic.org>.
I think you have fcntl() and flock() backwards.  fcntl() is the sane one
that we can unlink() immediately.  flock() is the insane one that we have
to keep around the file and re-open in each child.

I'm not happy with the server unlink()ing files it didn't create. 

Dean

On Mon, 22 Dec 1997, Marc Slemko wrote:

> On 22 Dec 1997 marc@hyperreal.org wrote:
> 
> >   	- add warning about possible denial of service attack with
> >   	  LockFile in world writable directory
> 
> This is only possible with fcntl serialized accept because 
> flock serialized accept does an explicit unlink().
> 
> Is probably worth fixing by having flock serialized accept unlink
> it as well before starting.  The only risk here is that we could
> unlink a file we shouldn't, but...
> 
>