Closed outpaddling closed 4 years ago
The problem is hard-coded umasks under the exfat case. There's a similar issue for msdosfs.
Here's a fix that respects MNT_MODE:
--- automount.orig 2020-01-16 11:46:56.550185000 -0600
+++ automount 2020-01-16 12:04:53.615976000 -0600
@@ -498,14 +498,17 @@
FS_CHECK_CMD='fsck_msdosfs'
FS_CHECK_ARGS="-C -y"
FS_MOUNT_CMD='mount_msdosfs'
- FS_MOUNT_ARGS="-o longnames -m 644 -M ${MNT_MODE} -D ${FAT_CODEPAGE} -L ${FAT_ENCODING} -u ${UID} -g ${GID} ${OPTS} ${LARGE} ${DEV} ${MNT}"
+ FS_FILE_PERMS=`printf "%03o" $((0${MNT_MODE} & 0666))`
+ FS_MOUNT_ARGS="-o longnames -m ${FS_FILE_PERMS} -M ${MNT_MODE} -D ${FAT_CODEPAGE} -L ${FAT_ENCODING} -u ${UID} -g ${GID} ${OPTS} ${LARGE} ${DEV} ${MNT}"
;;
(${FS_TYPE_EXFAT})
# sysutils/fusefs-exfat
FS_CHECK_CMD='fsck.exfat'
FS_CHECK_ARGS="-y"
FS_MOUNT_CMD='mount.exfat'
- FS_MOUNT_ARGS="-o uid=${UID} -o gid=${GID} -o dmask=022 -o fmask=133 ${OPTS} ${DEV} ${MNT}"
+ FS_MOUNT_DMASK=`printf "%03o" $((~0${MNT_MODE} & 0777))`
+ FS_MOUNT_FMASK=`printf "%03o" $((0${FS_MOUNT_DMASK} | 0111))`
+ FS_MOUNT_ARGS="-o uid=${UID} -o gid=${GID} -o dmask=${FS_MOUNT_DMASK} -o fmask=${FS_MOUNT_FMASK} ${OPTS} ${DEV} ${MNT}"
;;
(${FS_TYPE_NTFS})
# sysutils/fusefs-ntfs
Auerlab is me, BTW.
It occurred to me since that we might also consider splitting MNT_MODE into separate directory and file modes. I don't personally foresee much value in it, but it might head off a future feature request.
Fixed along with several other things :)
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246026
Regards.
Permissons do not get set properly when mounting an exFAT USB stick. Oddly, they get set after the drive is unmounted:
After mount:
After unmount:
FAT32 drives get set to proper permissions upon mounting.