HardenedBSD/usr.sbin
Ed Maste 856e158dc4 freebsd-update: improve pkgbase check
The previous version used a case-insensitive match (default for -x).
The presence of packages like freebsd-git-devtools and freebsd-ftpd
would falsely trigger the packaged base check.

Instead, just use `pkg which /usr/bin/uname` as a packaged base
indication.  pkg uses /usr/bin/uname to determine ABI, so we can rely on
it existing.  If it comes from a package then packaged base is in use.

Also, extend the check to all freebsd-update commands.  It is easier to
just disallow all commands, and easier to test.

Reported by: Mark Millard
Reviewed by: manu
Fixes: cf1aba2857 ("freebsd-update: refuse to operate on a pkgbase system")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47378
2024-11-02 15:24:39 -04: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 adduser.8: update log location + spdx 2024-09-06 12:34: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
auditd
auditdistd
auditreduce
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/riscv: Initial import. 2024-10-31 20:24:12 +00:00
bhyvectl bhyve/riscv: Initial import. 2024-10-31 20:24:12 +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 Update Makefile.depend files 2024-10-14 10:26:17 -07: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
bsdconfig Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
bsdinstall Update Makefile.depend files 2024-10-14 10:26:17 -07: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 Update Makefile.depend files 2024-10-14 10:26:17 -07:00
dconschat manuals: Fix syntax of list width 2024-10-08 16:16:26 -03: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
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
fifolog Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
flowctl
freebsd-update freebsd-update: improve pkgbase check 2024-11-02 15:24:39 -04:00
fstyp fstyp: Fix some memory safety bugs 2024-10-28 15:03:53 +00: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 iwlwifi: update Intel's iwlwifi/mvm driver. 2024-10-28 14:42:25 +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: Fix "unusual .Xr" warnings with a script 2024-10-15 17:18:14 -03: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
iscsid Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
jail manuals: Fix "unusual .Xr" warnings with a script 2024-10-15 17:18:14 -03: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: Remove a stray semicolon 2024-10-24 23:04:48 +08: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
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
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 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06: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
nghook
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 Update Makefile.depend files 2024-10-14 10:26:17 -07: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
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
pmcannotate
pmccontrol
pmcstat
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 usr.sbin/ppp: correct SIOCDIFADDR{,_IN6} calls to use {,in6_}ifreq 2024-07-22 10:03:37 +00: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 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06: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 Update Makefile.depend files 2024-10-14 10:26:17 -07: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
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
rtadvctl
rtadvd
rtprio Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rtsold
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 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06: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
snapinfo
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: Ignore getaddrinfo() errors if -ss is specified 2024-09-19 10:01:37 +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
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 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
traceroute6
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
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
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
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