The bug is that this will successfully open a regular file, despite the
O_DIRECTORY assertion.
The combination O_NOFOLLOW | O_DIRECTORY is actually quite useful, for
programs that search directory trees.
The form O_DIRECTORY _without_ O_NOFOLLOW is equivalent to appending "/"
to the path name, so that is far less useful. But there is no good
equivalent to O_NOFOLLOW | O_DIRECTORY that works.
The bug is in fs/namei.c:lookup_dentry(), and quite obvious. Do you
want me to write a patch?
-- Jamie
-
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/