summaryrefslogtreecommitdiff
path: root/hostmux
diff options
context:
space:
mode:
Diffstat (limited to 'hostmux')
-rw-r--r--hostmux/mux.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/hostmux/mux.c b/hostmux/mux.c
index 8dc11fc2..50c8e8e1 100644
--- a/hostmux/mux.c
+++ b/hostmux/mux.c
@@ -58,24 +58,31 @@ netfs_attempt_lookup (struct iouser *user, struct node *dir,
if (dir->nn->name)
err = ENOTDIR;
- else if (strcmp (name, ".") == 0)
- /* Current directory -- just add an additional reference to DIR and
- return it. */
- {
- netfs_nref (dir);
- *node = dir;
- err = 0;
- }
- else if (strcmp (name, "..") == 0)
- err = EAGAIN;
else
- err = lookup_host (dir->nn->mux, name, node);
+ err = fshelp_access (&dir->nn_stat, S_IEXEC, user);
- fshelp_touch (&dir->nn_stat, TOUCH_ATIME, hostmux_maptime);
+ if (! err)
+ {
+ if (strcmp (name, ".") == 0)
+ /* Current directory -- just add an additional reference to DIR and
+ return it. */
+ {
+ netfs_nref (dir);
+ *node = dir;
+ err = 0;
+ }
+ else if (strcmp (name, "..") == 0)
+ err = EAGAIN;
+ else
+ err = lookup_host (dir->nn->mux, name, node);
- mutex_unlock (&dir->lock);
+ fshelp_touch (&dir->nn_stat, TOUCH_ATIME, hostmux_maptime);
+ }
- if (! err)
+ mutex_unlock (&dir->lock);
+ if (err)
+ *node = 0;
+ else
mutex_lock (&(*node)->lock);
return err;