Re: Linux 2.1.125 doesn't dump core on SIGSEGV

Chris Wedgwood (chris@cybernet.co.nz)
Wed, 21 Oct 1998 12:25:43 +1300


On Wed, Oct 21, 1998 at 12:42:47AM +0100, Alan Cox wrote:

> To wear a linus impersonator hat
> O_NOFOLLOW is the generic solution to that and a pile of other link handling
> problems

O_CREAT|O_EXCL won't follow links - so we can create core that way,
and not dump if it fails.

I've also got a three liner to implement O_NOFOLLOW that may or may
not work (kernel being recompiled now). It seemed to trivial to
implement, so I'm not sure its `correct':

open_namei uses a macro lookup_flags(x) to generate a lookup
condition based upon the open flags - if O_CREAT|O_EXCL are both set,
we don't follow links.

So, adding O_NOFOLLOW to asm/fcntl.h and changing this macro to
reflect this, we get O_NOFOLLOW semantics for free (well, one
instruction, maybe two).

-cw

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/