In pumount, use O_PATH when opening the mount point to try to avoid
RPCs from permission or atomic_open.
Test-Parameters: trivial testlist=sanity-pumount clientextra_install_params="--packages pumount"
Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: Ibd66579d9b5ecef724334c01d90367af4bd93179
Reviewed-on: https://review.whamcloud.com/47323
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
PU_FATAL("cannot open '%s': %s\n", "/proc", strerror(errno));
if (do_open) {
- mount_dirfd = open(mount_point, O_RDONLY|O_DIRECTORY);
+ /* We open the mount point to prevent a mount ID reuse
+ * race. Use O_PATH to avoid invoking permission or
+ * atomic_open. */
+ mount_dirfd = open(mount_point, O_RDONLY|O_DIRECTORY|O_PATH);
if (mount_dirfd < 0)
PU_FATAL("cannot open '%s': %s\n", mount_point, strerror(errno));