summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKlemens Nanni <kn@cvs.openbsd.org>2021-11-13 18:19:00 +0000
committerKlemens Nanni <kn@cvs.openbsd.org>2021-11-13 18:19:00 +0000
commita134c7f7dc19dd759083fd0730081351373a57fe (patch)
tree96dbb975651c032ea9a4be8d2997c5bc5d3568be /sys
parent74774647810120f8f43db5b8cc07ce0d3dc93e75 (diff)
Use long filenames by default on FAT filesystems
These days, 8.3 filenames are often a problem, filesystems containing firmware with long names must not truncate them -- it's also a sane default as portable file system between OSes, anyway. Altough undocumented in mount_msdos(8), the default for FAT32 already is to use long filenames: ever since its import from NetBSD in 1998. Previously, mount_msdos would ignore long filenames and default to short filenames unless a flag was used or long ones were found on the filesystem prior to mounting it. Just always mount with support for long filenames (unless `-s' is used). As various install media use FAT filesystems, adjust the remaining ones to also pass explicit mount option reflecting the previous default. OK deraadt
Diffstat (limited to 'sys')
-rw-r--r--sys/msdosfs/msdosfs_vfsops.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c
index 5be9e107160..543854c7a7e 100644
--- a/sys/msdosfs/msdosfs_vfsops.c
+++ b/sys/msdosfs/msdosfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_vfsops.c,v 1.94 2020/08/10 05:18:46 jsg Exp $ */
+/* $OpenBSD: msdosfs_vfsops.c,v 1.95 2021/11/13 18:18:59 kn Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.48 1997/10/18 02:54:57 briggs Exp $ */
/*-
@@ -200,25 +200,8 @@ msdosfs_mount(struct mount *mp, const char *path, void *data,
if (pmp->pm_flags & MSDOSFSMNT_NOWIN95)
pmp->pm_flags |= MSDOSFSMNT_SHORTNAME;
else if (!(pmp->pm_flags &
- (MSDOSFSMNT_SHORTNAME | MSDOSFSMNT_LONGNAME))) {
- struct vnode *rvp;
-
- /*
- * Try to divine whether to support Win'95 long filenames
- */
- if (FAT32(pmp))
- pmp->pm_flags |= MSDOSFSMNT_LONGNAME;
- else {
- if ((error = msdosfs_root(mp, &rvp)) != 0) {
- msdosfs_unmount(mp, MNT_FORCE, p);
- goto error;
- }
- pmp->pm_flags |= findwin95(VTODE(rvp))
- ? MSDOSFSMNT_LONGNAME
- : MSDOSFSMNT_SHORTNAME;
- vput(rvp);
- }
- }
+ (MSDOSFSMNT_SHORTNAME | MSDOSFSMNT_LONGNAME)))
+ pmp->pm_flags |= MSDOSFSMNT_LONGNAME;
if (pmp->pm_flags & MSDOSFSMNT_LONGNAME)
mp->mnt_stat.f_namemax = WIN_MAXLEN;