From a2d6c2ad28481412ddeeb0a5b4c646cdf82e5c60 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Fri, 5 Sep 1997 21:38:40 +0000 Subject: (main): If the underlying node isn't a directory, propagate read permission to execute permission. --- hostmux/hostmux.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'hostmux') diff --git a/hostmux/hostmux.c b/hostmux/hostmux.c index c925cdfcd..a69b7cf43 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); -- cgit v1.2.3