summaryrefslogtreecommitdiff
path: root/hostmux
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-09-05 21:38:40 +0000
committerMiles Bader <miles@gnu.org>1997-09-05 21:38:40 +0000
commita2d6c2ad28481412ddeeb0a5b4c646cdf82e5c60 (patch)
treeaa3518d06a54f236b7f8ec17e578ef7eb44b3a8b /hostmux
parentd1cbd43cae516d643d3635fa47821c1c0a4bec42 (diff)
(main):
If the underlying node isn't a directory, propagate read permission to execute permission.
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);