Index: unionfs/union_vfsops.c =================================================================== --- unionfs/union_vfsops.c (revision 183266) +++ unionfs/union_vfsops.c (working copy) @@ -67,43 +67,6 @@ static struct vfsops unionfs_vfsops; /* - * Exchange from userland file mode to vmode. - */ -static u_short -mode2vmode(mode_t mode) -{ - u_short ret; - - ret = 0; - - /* other */ - if (mode & S_IXOTH) - ret |= VEXEC >> 6; - if (mode & S_IWOTH) - ret |= VWRITE >> 6; - if (mode & S_IROTH) - ret |= VREAD >> 6; - - /* group */ - if (mode & S_IXGRP) - ret |= VEXEC >> 3; - if (mode & S_IWGRP) - ret |= VWRITE >> 3; - if (mode & S_IRGRP) - ret |= VREAD >> 3; - - /* owner */ - if (mode & S_IXUSR) - ret |= VEXEC; - if (mode & S_IWUSR) - ret |= VWRITE; - if (mode & S_IRUSR) - ret |= VREAD; - - return (ret); -} - -/* * Mount unionfs layer. */ static int @@ -174,7 +137,7 @@ vfs_mount_error(mp, "Invalid udir"); return (EINVAL); } - udir = mode2vmode(udir); + udir &= S_IRWXU | S_IRWXG | S_IRWXO; } if (vfs_getopt(mp->mnt_optnew, "ufile", (void **)&tmp, NULL) == 0) { if (tmp != NULL) @@ -183,7 +146,7 @@ vfs_mount_error(mp, "Invalid ufile"); return (EINVAL); } - ufile = mode2vmode(ufile); + ufile &= S_IRWXU | S_IRWXG | S_IRWXO; } /* check umask, uid and gid */ if (udir == 0 && ufile != 0)