libnfs.c: Follow symlinks during path resolution
authorRoss Lagerwall <rosslagerwall@gmail.com>
Sun, 27 Jul 2014 17:01:25 +0000 (18:01 +0100)
committerRoss Lagerwall <rosslagerwall@gmail.com>
Sun, 27 Jul 2014 20:24:17 +0000 (21:24 +0100)
commit1d15199152e1dfab18b86f855301ac7a0c597fab
tree36c038e1b7417a2146c4b2ddb3611c7753dc899b
parentc4d5f5b874a10dfa71915a1e2c64cbe708db92ec
libnfs.c: Follow symlinks during path resolution

Follow symlinks during path resolution.  If the symlink points outside
the mount, -ENOENT is returned.  This is slightly different behavior
from the in-kernel NFS client where symlinks pointing outside the mount
get resolved to local paths.

The algorithm for symlink resolution is simple and stupid.  If a symlink
is encountered, the path is rewritten and path resolution begins again
from the root filehandle.  A count is kept to prevent loops.  This is
not particularly efficient but it is good enough for now.

Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
lib/libnfs.c