summaryrefslogtreecommitdiff
path: root/hostmux
diff options
context:
space:
mode:
Diffstat (limited to 'hostmux')
-rw-r--r--hostmux/hostmux.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hostmux/hostmux.c b/hostmux/hostmux.c
index c925cdfc..a69b7cf4 100644
--- a/hostmux/hostmux.c
+++ b/hostmux/hostmux.c
@@ -142,6 +142,18 @@ main (int argc, char **argv)
netfs_root_node->nn_stat.st_mode =
S_IFDIR | (ul_stat.st_mode & ~S_IFMT & ~S_ITRANS);
+ /* If the underlying node isn't a directory, propagate read permission to
+ execute permission since we need that for lookups. */
+ if (! S_ISDIR (ul_stat.st_mode))
+ {
+ if (ul_stat.st_mode & S_IRUSR)
+ netfs_root_node->nn_stat.st_mode |= S_IXUSR;
+ if (ul_stat.st_mode & S_IRGRP)
+ netfs_root_node->nn_stat.st_mode |= S_IXGRP;
+ if (ul_stat.st_mode & S_IROTH)
+ netfs_root_node->nn_stat.st_mode |= S_IXOTH;
+ }
+
fshelp_touch (&netfs_root_node->nn_stat, TOUCH_ATIME|TOUCH_MTIME|TOUCH_CTIME,
hostmux_maptime);