Allow O_PATH for symlinks
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 13 Mar 2011 20:42:14 +0000 (16:42 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 15 Mar 2011 06:21:45 +0000 (02:21 -0400)
commitbcda76524cd1fa32af748536f27f674a13e56700
tree37dbc7fb50b515f3dff820e14d92e768fb1cda31
parent1abf0c718f15a56a0a435588d1b104c7a37dc9bd
Allow O_PATH for symlinks

At that point we can't do almost nothing with them.  They can be opened
with O_PATH, we can manipulate such descriptors with dup(), etc. and
we can see them in /proc/*/{fd,fdinfo}/*.

We can't (and won't be able to) follow /proc/*/fd/* symlinks for those;
there's simply not enough information for pathname resolution to go on
from such point - to resolve a symlink we need to know which directory
does it live in.

We will be able to do useful things with them after the next commit, though -
readlinkat() and fchownat() will be possible to use with dfd being an
O_PATH-opened symlink and empty relative pathname.  Combined with
open_by_handle() it'll give us a way to do realink-by-handle and
lchown-by-handle without messing with more redundant syscalls.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c