DragonFly BSD
DragonFly submit List (threaded) for 2010-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: patch: fix apache-ant in linux emulation


From: Johannes Hofmann <johannes.hofmann@xxxxxx>
Date: 10 Apr 2010 22:47:40 GMT

Jonas Trollvik <jontro@gmail.com> wrote:
> On Thu, Apr 8, 2010 at 10:56 PM, Johannes Hofmann
> <johannes.hofmann@gmx.de> wrote:
>> However it would probabely better - though more invasive to add
>> O_DIRECTORY to native open(2) and simply pass the flag.
> 
> As far as I can tell only opendir should be using the O_DIRECTORY flag in open.
> 
> From the man page: "If pathname is not a directory, cause the open to
> fail. This flag is Linux-specific,
> and was added in kernel version 2.1.126, to avoid denial-of-service
> problems if opendir(3) is called on
> a FIFO or tape device, but should not be used outside of the
> implementation of opendir."
> 
> Does this race exist in BSD opendir?
> 
> If ant is using this, is it through opendir?
> 
> Only reason I can see to introduce this in the base is if this problem
> also exists on dragonflybsd.

I have to admit that I don't fully understand the details of the race
in opendir that is supposed to be fixed by using O_DIRECTORY, however
the flag seems to be in some standard:
http://www.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html#tag_13_10
and FreeBSD also introduced the flag recently.

Regards,
Johannes



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