> 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/