9ns: Sort out when to not follow symlinks
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 27 Feb 2018 19:13:28 +0000 (14:13 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 6 Apr 2018 19:23:01 +0000 (15:23 -0400)
commitd8d8945778ff4db4806e65be0533a93cd2cbf6dc
tree506faad89294149e13d2f28be2049037450f0c70
parent3ad9671c5943a78174f30b58afb62fc76de1d2b5
9ns: Sort out when to not follow symlinks

The classic example is unlink/remove: the operation targets the symlink
itself, not its target.

I figure any of the bind/mount family of calls also want to target the
symlink.  They are changing the namespace, and operate on names, regardless
of directories/files/whatever.

Note that if you try to remove a symlink with a trailing slash with our
busybox, it *won't* fail.  e.g.

$ rm some_link_to_dir/

That should fail, but busybox won't send the trailing slash.  If you
manually call unlink/remove, we'll catch it and you'll get an error.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/ns/chan.c
kern/src/ns/sysfile.c