opnsense-src/usr.sbin
Robert Wing 6830340cfa fstyp: search for file system headers with the largest offset first
fstyp can misidentify a UFS file system as MS-DOS if the device was
repurposed from MS-DOS to UFS via newfs.

This happens for the following reasons:
    - the header for MS-DOS begins at offset 0
    - the superblock for UFS begins at offset 64k, 8k, 0k, or 256k
    - newfs does not clear the area in front of UFS's superblock,
      leaving the MS-DOS header intact.
    - fstyp searches for file system headers alphabetically

To avoid this misidentification, have fstyp search for file system
headers with the largest offset first instead of alphabetically.

The implemented fix was suggested by reporter, Richard M. Kreuter.

PR:             252787
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D47855
2024-12-03 23:45:09 -09:00
..
ac Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
accton Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
acpi acpidump(8): add const qualifier to the known tables array 2024-10-23 23:00:10 +03:00
adduser pw: set the user's home directory mode if it existed 2024-12-01 13:08:31 -06:00
apm Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
apmd Update Makefile.depend files 2024-10-14 10:26:17 -07:00
arp arp(8): Complete libxo transition 2024-10-13 02:21:45 +08:00
audit package: move OpenBSM auditing into its own package 2024-04-28 22:33:06 -06:00
auditd package: move OpenBSM auditing into its own package 2024-04-28 22:33:06 -06:00
auditdistd package: move OpenBSM auditing into its own package 2024-04-28 22:33:06 -06:00
auditreduce package: move OpenBSM auditing into its own package 2024-04-28 22:33:06 -06:00
authpf Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
autofs Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
bhyve bhyve: Convert to using vm_openf() 2024-11-05 01:40:41 +00:00
bhyvectl bhyvectl: Convert to use vm_openf() 2024-11-05 01:40:41 +00:00
bhyveload Update Makefile.depend files 2024-10-14 10:26:17 -07:00
binmiscctl manuals: Fix typos in -offset for .Bd and .Bl 2024-10-03 14:49:31 -03:00
blacklistctl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
blacklistd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
bluetooth rtlbtfw: Firmware loader for Realtek 87XX/88XX bluetooth USB adaptors 2024-11-07 02:30:29 +03:00
boot0cfg Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
bootparamd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
boottrace spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
bsdconfig Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
bsdinstall bsdinstall: add menu to install firmware 2024-11-20 13:06:06 +00:00
bsnmpd bsnmpd: FreeBSD has strlcpy(3) 2024-07-16 00:12:29 -05:00
btxld Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
camdd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
cdcontrol Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
certctl Update Makefile.depend files 2024-10-14 10:26:17 -07:00
chkgrp Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
chown Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
chroot Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ckdist Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
clear_locks Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
config config: Remove a stray semicolon 2024-10-24 23:04:48 +08:00
cpucontrol Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
crashinfo Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
cron Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
crunch Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ctladm Update Makefile.depend files 2024-10-14 10:26:17 -07:00
ctld ctld: fix several process setup/teardown bugs 2024-09-18 14:06:31 -06:00
cxgbetool Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
daemon daemon: tests: add a test for missed SIGTERM 2024-11-19 13:51:27 -06:00
dconschat dconschat: Increase WARNS to 2 2024-11-03 15:18:39 -05:00
devctl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
devinfo devinfo: Output device description in verbose mode 2024-10-16 14:09:05 -04:00
diskinfo Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
dumpcis Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
editmap Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
edquota Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
efibootmgr manuals: Fix "unusual .Xr" warnings with a script 2024-10-15 17:18:14 -03:00
efidp Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
efitable Update Makefile.depend files 2024-10-14 10:26:17 -07:00
efivar Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
efiwake Update Makefile.depend files 2024-10-14 10:26:17 -07:00
etcupdate etcupdate(8): improve phrasing 2024-07-16 15:17:31 -04:00
extattr Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
extattrctl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
fdcontrol Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
fdformat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
fdread Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
fdwrite fdwrite.c: initialize pointers to NULL and a few other cleanups 2024-04-11 12:24:36 -06:00
fifolog Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
flowctl Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
freebsd-update freebsd-update: improve pkgbase check 2024-11-02 15:24:39 -04:00
fstyp fstyp: search for file system headers with the largest offset first 2024-12-03 23:45:09 -09:00
ftp-proxy Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
fwcontrol fwcontrol: Allocate full fw_asyreq structures passed to the kernel 2024-07-19 13:09:32 -04:00
fwget fwget: add -q for quiet output 2024-11-08 18:13:54 +00:00
getfmac Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
getpmac Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
gpioctl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
gssd manuals: Fix dates 2024-10-28 12:26:03 -03:00
gstat usr.sbin/gstat: add microsecond precision for disk latency 2024-08-04 11:31:06 +03:00
hyperv Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
i2c manuals: Remove trailing spaces 2024-11-04 11:26:14 -04:00
ifmcstat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
inetd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
iostat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
iovctl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ip6addrctl getaddrinfo.{1,3}: Cross-reference ip6addrctl(8) 2024-09-06 12:34:32 -06:00
ipfwpcap Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
iscsid Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
jail jail: Let a couple of parameter types be specified as lists 2024-11-19 21:05:24 +00:00
jexec jail: only chdir to user's home directory when user is specified 2024-08-12 15:23:28 -07:00
jls jls(8): Complete libxo transition 2024-10-13 02:21:47 +08:00
kbdcontrol kbdcontrol: correct bell frequency for vt(4) 2024-11-01 11:54:40 -04:00
kbdmap Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
keyserv Fix enum warning in keyserv 2024-07-31 21:28:42 +02:00
kldxref libkldelf: add a private library for kernel/kld-related ELF parsing 2024-10-18 20:20:13 +00:00
lastlogin manuals: Fix "unusual .Xr" warnings with a script 2024-10-15 17:18:14 -03:00
lpr lpd: Tighten permissions on /var/run/printer 2024-10-11 09:50:08 -06:00
lptcontrol Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mailstats Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mailwrapper manuals: Fix "unusual .Xr" warnings with a script 2024-10-15 17:18:14 -03:00
makefs makefs.8: Clarify that makefs-generated zpools always have the same GUID 2024-11-19 21:18:38 +00:00
makemap Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
manctl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
memcontrol Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mfiutil manuals: Misc macro typos 2024-09-21 05:25:15 -06:00
mixer mixer: Fix a bogus free() call in the main loop 2024-10-23 22:12:45 +00:00
mld6query usr.sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
mlx5tool manuals: Misc macro typos 2024-09-21 05:25:15 -06:00
mlxcontrol Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mount_smbfs Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mountd mountd: Add check for "=" after exports(5) options 2024-09-06 16:41:12 -07:00
moused Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mpsutil mpsutil: Clean up libutil deps 2024-01-24 17:10:24 -05:00
mptable Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mptutil Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mtest Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ndp ndp: Bring back the -A option for the netlink implementation 2024-11-01 00:32:14 +08:00
newsyslog newsyslog.conf(5): Remove duplicate word 2024-11-29 13:00:54 +08:00
nfscbd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
nfsd nfsd.c: Synchronize error handling 2024-09-29 13:11:54 -07:00
nfsdumpstate Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
nfsrevoke Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
nfsuserd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ngctl usr.sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
nghook Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
nmtree Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
nologin Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
nscd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ntp ntp: Switch to upstream man pages 2024-11-11 19:10:04 -08:00
nvmfd Update Makefile.depend files 2024-10-14 10:26:17 -07:00
nvram Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ofwdump Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
pciconf pciconf(8): dump AMD IOMMU Base Capability 2024-04-10 08:28:24 +03:00
periodic Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
pkg pkg: improve error message 2024-10-07 13:05:07 -04:00
pmc pmc: Fix some problems with the makefile 2024-02-16 09:50:43 -05:00
pmcannotate usr.sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
pmccontrol usr.sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
pmcstat usr.sbin: Remove repeated words 2024-04-11 11:53:37 -06:00
pmcstudy Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
pnfsdscopymr Update Makefile.depend files 2024-10-14 10:26:17 -07:00
pnfsdsfile Update Makefile.depend files 2024-10-14 10:26:17 -07:00
pnfsdskill Update Makefile.depend files 2024-10-14 10:26:17 -07:00
pnpinfo Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
powerd powerd: use nlsysevent if possible 2024-10-08 08:40:58 +02:00
ppp tcp: add TH_AE capabilities to ppp and pf 2024-11-29 10:04:31 +01:00
pppctl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
praliases Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
praudit praudit: correct test case 2024-11-04 08:57:13 -05:00
prometheus_sysctl_exporter Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
pstat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
pw pw: tests: add a test for -M with a pre-existing home directory 2024-12-01 13:10:35 -06:00
pwd_mkdb manuals: Fix typos in -offset for .Bd and .Bl 2024-10-03 14:49:31 -03:00
pwm Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
quot Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
quotaon Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rarpd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
repquota Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rip6query Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rmt Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
route6d Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.lockd Add man page for nfslockd. 2024-05-10 11:23:13 +02:00
rpc.statd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.tlsclntd manuals: Fix "unusual .Xr" warnings with a script 2024-10-15 17:18:14 -03:00
rpc.tlsservd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.umntall Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.yppasswdd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.ypupdated Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.ypxfrd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpcbind Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rrenumd Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
rtadvctl rtadvctl: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) 2024-04-28 21:24:46 -06:00
rtadvd rtadvd(8): support PREF64 (RFC 8781) 2024-05-23 14:40:48 -06:00
rtprio Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rtsold usr.sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
rwhod Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
sa Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
sendmail Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
service manuals: Fix typos in -offset for .Bd and .Bl 2024-10-03 14:49:31 -03:00
services_mkdb services: fix typo ucp -> udp 2024-12-01 00:53:47 +03:00
sesutil sesutil(8): Complete libxo transition 2024-10-13 02:21:46 +08:00
setfib Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
setfmac Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
setpmac Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
smbmsg Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
snapinfo man filesystems: fix xrefs after move to section 4 2024-05-16 10:25:29 -06:00
spi Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
spkrtest Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
spray Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
syslogd syslogd: Fix issues reported by gcc 2024-11-30 18:52:34 +00:00
sysrc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
tcpdchk Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
tcpdmatch Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
tcpdrop usr.sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
tcpdump tcpdump: Update to 4.99.5 2024-09-23 20:23:25 +01:00
tcpsso tcpsso: remove support for some IPPROTO_TCP-level socket option names 2024-08-30 09:32:50 +02:00
tests Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
traceroute tcp: extend the use of the th_flags accessor function 2024-11-29 09:48:23 +01:00
traceroute6 tcp: extend the use of the th_flags accessor function 2024-11-29 09:48:23 +01:00
trim Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
tzsetup tzsetup: correct timezone symlink target 2024-09-30 10:22:34 -04:00
uathload Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
uefisign Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ugidfw Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
uhsoctl usr.sbin/uhsoctl: correct SIOCDIFADDR calls to use ifreq 2024-07-22 14:58:19 +00:00
unbound Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
usbconfig usbconfig: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) 2024-04-28 21:30:55 -06:00
usbdump Give usbdump a '-u' option for unbuffered output. 2024-10-21 11:21:05 +00:00
utx Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
valectl Update Makefile.depend files 2024-10-14 10:26:17 -07:00
vidcontrol Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
vigr Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
vipw Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
wake Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
watch Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
watchdogd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
wlandebug Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
wpa wpa_supplicant: xref relevant wpa_passphrase(8) 2024-10-15 17:18:02 -03:00
yp_mkdb Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ypbind Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ypldap ypldap(8): Fix grammar in ypldap.c 2024-02-13 14:11:07 +08:00
yppoll Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
yppush Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ypserv Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ypset Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
zdump Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
zic Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
zonectl Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
zzz Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile mergemaster: remove from the tree 2024-07-16 08:25:54 -04:00
Makefile.aarch64 bhyvectl: Add arm64 bits and hook it up to the build 2024-05-01 08:33:23 -04:00
Makefile.amd64 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.i386 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.inc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.powerpc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.riscv bhyve/riscv: Initial import. 2024-10-31 20:24:12 +00:00