From 6e35a947741cfdfedc9b5972627804fd184806dc Mon Sep 17 00:00:00 2001 From: christos Date: Sun, 4 Feb 2024 00:16:59 +0000 Subject: [PATCH] PR/57904: Ricardo Branco: Mask file permissions we get from mount_ntfs -m option --- sys/fs/ntfs/ntfs_vfsops.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/fs/ntfs/ntfs_vfsops.c b/sys/fs/ntfs/ntfs_vfsops.c index c4c7590c0293..efc7ba1289e9 100644 --- a/sys/fs/ntfs/ntfs_vfsops.c +++ b/sys/fs/ntfs/ntfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: ntfs_vfsops.c,v 1.110 2020/04/13 19:23:18 ad Exp $ */ +/* $NetBSD: ntfs_vfsops.c,v 1.111 2024/02/04 00:16:59 christos Exp $ */ /*- * Copyright (c) 1998, 1999 Semen Ustimenko @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.110 2020/04/13 19:23:18 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.111 2024/02/04 00:16:59 christos Exp $"); #include #include @@ -112,7 +112,7 @@ ntfs_mountroot(void) args.flag = 0; args.uid = 0; args.gid = 0; - args.mode = 0777; + args.mode = S_IRWXU|S_IRWXG|S_IRWXO; if ((error = ntfs_mountfs(rootvp, mp, &args, l)) != 0) { vfs_unbusy(mp); @@ -366,7 +366,7 @@ ntfs_mountfs(struct vnode *devvp, struct mount *mp, struct ntfs_args *argsp, str ntmp->ntm_devvp = devvp; ntmp->ntm_uid = argsp->uid; ntmp->ntm_gid = argsp->gid; - ntmp->ntm_mode = argsp->mode; + ntmp->ntm_mode = argsp->mode & (S_IRWXU|S_IRWXG|S_IRWXO); ntmp->ntm_flag = argsp->flag; mp->mnt_data = ntmp;