summaryrefslogtreecommitdiff
path: root/sbin
AgeCommit message (Collapse)Author
2022-08-31If a partition both starts and ends beyond the end of the unitKenneth R Westerback
only warn about the start. ok millert@
2022-08-30sync to libunbound 1.16.2; heavy lifting by sthenFlorian Obser
2022-08-29Print warning when a GPT partition start or end is outside theKenneth R Westerback
usable LBA area of the device the GPT is currently inhabiting. Makes GPT display as informative as MBR display. In passing, eliminate possible underflow in partition size calculation. ok deraadt@
2022-08-29Dynamically link these /sbin daemons: dhcpleased, mountd, nfsd, pflogd,Theo de Raadt
resolvd, slaacd, unwind. The mitigation story is way better: syscalls are in a randomly located libc, and every syscall stub is randomly located inside that due to random relinking. As opposed to fixed offset inside a release binary. There is one known consequence: /usr nfs mounting must use statically configured IP addresses. ok kettenis florian, others
2022-08-29Print warning when an MBR partition starts or extends past theKenneth R Westerback
end of the device the MBR is currently inhabiting. Prompted by some interesting MBR's from France, verbiage suggestion from deraadt@, ok miod@
2022-08-26Sync usage with manualKlemens Nanni
-l takes chunks not specials; while here, simplify markup for optional parts. Feedback OK jmc
2022-08-26Move (unused) functions under !SMALLKlemens Nanni
if_state_name() and proposal_state_name() are only uesd in log_debug() calls which are NOOPs in SMALL builds. Seen with -Wunused-function warnings in distrib/special/slaacd. OK deraadt
2022-08-20Align description of -g and -u with mount_tmpfs.8Theo Buehler
"Reads better indeed" otto
2022-08-20-k and -K are mutually exclusive, make usage match manualKlemens Nanni
OK millert
2022-08-20Accept both names and ids for -g and -u and implement missing errorOtto Moerbeek
handling. Code from mount_msdos (which got it from chmod/chown). ok tb@ deraadt@
2022-08-19Zap useless castKlemens Nanni
opendev(3) takes a const char * (since 2012, thanks tb), just what getinfo() provides. No amd64 object change. OK millert tb
2022-08-19Improve RAID level parsingKlemens Nanni
Check for numeric levels before checking for single-character ones ("c" and "C") such that a) invalid synopsis (no "-l") is detected as such # bioctl -c 10 vnd0 softraid0 bioctl: Invalid RAID level # ./obj/bioctl -c 10 vnd0 softraid0 usage: bioctl ... and b) ten is correctly treated as valid but unsupported level: # bioctl -c 10 -l vnd0a softraid0 bioctl: Invalid RAID level # ./obj/bioctl -c 10 -l vnd0a softraid0 bioctl: unsupported RAID level Uppercase the abbreviation while here. Feedback OK tb
2022-08-19Document lease filesKlemens Nanni
Feedback OK jmc
2022-08-16Remove -c compatKlemens Nanni
Ought to go in 2020 already. OK deraadt
2022-08-16-v prints to standard error not outputKlemens Nanni
stderr is expected and stdout would break vnconfig(8)'s usage where vnd_dev is omitted and a new one is printed on stdout.
2022-08-05Among published AT&T UNIX releases, a shutdown(8) command was containedIngo Schwarze
in PWB/UNIX 1.0 (July 1977) and in System III (1982), but not in v7 (Jan 1979) nor in 32v (May 1979). According to the Australian UNIX User Group Newsletter Vol. I No. I https://www.tuhs.org/Archive/Documentation/AUUGN/AUUGN-V01.1.pdf , (October 1978), Letter from John Lions on page 20, UNIX/TS 1.0 (late 1978 or early 1979) also contained an implementation of shutdown(8). So it is unlikely it came from the CSRC and more likely it was invented either by the PWB or by the USG group. Since we don't know for sure, only cite the first public release. It was a mistake to say "appeared in 4.0BSD". That release only contained a stub manual page (without a DESCRIPTION), and the file man8/BUGS in 4.0BSD mentions it without giving details, presumably trying to indicate it wasn't really available yet. The is no shutdown(8) implementation in BSD before 4.1cBSD. OK jsg@
2022-08-03dmesg(8): don't accept positional argumentsScott Soule Cheloha
dmesg(8) doesn't use any positional arguments. If we see any, it's a usage error. ok florian@, "Sure" deraadt@ millert@
2022-07-31The geometry information in stuct disklabel is not used forKenneth R Westerback
anything. Allowing modifications to it or displaying whatever geometry was in use when the label was created leads to needless inconsistency with the kernel and with the values displayed by, e.g., fdisk(8). Always set label fields d_secsize, d_nsectors, d_ntracks, d_secpercyl, d_ncylinders to the current values used by the kernel, obtained via DIOCGPDINFO. Ignore any values from the on-disk label or the file -R uses. Nuke editor command 'g' and restrict editor command 'e' to changing d_type and d_packname.
2022-07-30we mention interim BSD releases so change some 4.4BSD use to 4.3BSD-RenoJonathan Gray
ok jmc@ schwarze@
2022-07-29Mention id(1) -R, reference rtable(4) in route(8)Klemens Nanni
Fix "ps -o rtable" example description while here. Initial idea to mention id -R in route(8) from sthen Feedback OK sthen
2022-07-27Remove redundant bzero, the pfctl struct memset later on.Moritz Buhl
Also memset the pfctl struct in pfctl_reset. OK jan@
2022-07-26Allow editing of an MBR of all zeros.Kenneth R Westerback
Fallout from regress failure spotted by anton@.
2022-07-25Only MBR and GPT structures can be edited by fdisk.Kenneth R Westerback
If neither are found, restrict user actions to printing basic information on the disk, reading the man page, initializing an MBR or GPT, or terminating fdisk without changing anything. Feedback on earlier attempt by miod@ and brynet@.
2022-07-23Delete autoconf or temporary address if flag is removed.Florian Obser
OK kn
2022-07-23Let the kernel delete the (default) route when we deconfigure theFlorian Obser
interface. This works around a problem where the kernel always deletes the first default route if there are multiple present with the same gateway. This only fixes the problem when running ifconfig inet -autoconf. There are other cases where we call configure_rotures(RTM_DELETE), for example when setting ignore routes in dhcpleased.conf and issuing a reload. To fix that we either need help from the kernel to distinguish routes by IFP or track priorities and hope they are unique. Problem reported by mbuhl. OK claudio
2022-07-23Send an IFP to distinguish (default) routes over different interfacesFlorian Obser
to the same gateway. Unfortunately this doesn't help with deleting the correct route when issuing ifconfig inet -autoconf, the kernel always deletes the first route. This is the one with the lowest priority if the routes have different priorities. What does work is identifying routes by priority but dhcpleased(8) doesn't set the priority so that the kernel choses the right one when adding a route and it doesn't yet track the priority the kernel set. Another issue is that we might end up with routes having the same gateway and same priority pointing out of different interfaces. For example when two ethernet interfaces are set to autoconf and they are connected to the layer 2 network. This seems like a bad idea but it is something that could be configured. Problem reported by mbuhl, claudio suggested to try to send an IFP. Even though it doesn't work, it seems worthwhile to send the IFP for when the kernel gains the ability to distinguish routes by IFP.
2022-07-23Delete addresses when interface is no longer autoconf.Florian Obser
This brings it in line with dhcpleased(8) as well as what we do for the default route and DNS proposals. I missed this when I rewrote the state machine to match dhcpleased(8).
2022-07-22add missing full stop;Jason McIntyre
2022-07-22Include an OpenIKED Vendor ID payload in the initial handshake. This willTobias Heider
make it easier to handle interoperability problems with older versions in the future. The ID is constructed from the string "OpenIKED-" followed by the version number. Sending of the vendor ID payload can be disabled by specifying "set novendorid" in iked.conf(5). ok markus@ bluhm@
2022-07-22Fix potential leak of reply in error case.Tobias Heider
From markus@ ok bluhm@
2022-07-22fix use after free in debug pathJonathan Gray
ok jan@ miod@
2022-07-21Set the default pool size for the new anchors pool otherwise it's set to 0.Moritz Buhl
2022-07-20Add a pool for the allocation of the pf_anchor struct.Moritz Buhl
It was possible to exhaust kernel memory by repeatedly calling pfioctl DIOCXBEGIN with different anchor names. OK bluhm@ Reported-by: syzbot+9dd98cbce69e26f0fc11@syzkaller.appspotmail.com
2022-07-18Check if there is a locally cached nameserver to send before respondingTobias Heider
to RTP_PROPOSAL_SOLICIT. Fixes a crash when resolvd is restarted but no name server is set.
2022-07-18Synch 'help' command descriptions with man page descriptions.Kenneth R Westerback
Put 'setpid' description in correct place in COMMAND MODE command list. i.e. in same order as ask_cmd() will parse it. Simplify ask_cmd() by displaying prompt in edit loop rather than passing editlevel to ask_cmd(). No intentional functional change.
2022-07-18'quit' and 'exit' descriptions were reversed.Kenneth R Westerback
Tweak 'abort' description to emphasize discarding of changes.
2022-07-17Modernize and cleanse fdisk.8, making it more concise andKenneth R Westerback
aligned with the code. Tweak usage() to stay in step. Usual cogent feedback, tweaks and ok jmc@
2022-07-14When the autoconf flag flaps around we might end up with multiple bpfFlorian Obser
FDs in flight. Things then get confusing. The kernel tells us we can read from the bpf FD but the data is actually "on the other FD", so read(2) returns 0. Found the hard way by, and patiently debugged with weerd@ One way to trigger this is booting a vmm VM where dhcpleased(8)'s init_ifaces() loses a race against netstart(8). init_ifaces() would already see the autoconf flag and request a bpf FD. But then it would receive a RTM_IFINFO message without the autoconf flag set from when the interface came up. Then it will see another RTM_IFINFO message with the autoconf flag set and request yet another bpf FD. If the first bpf FD had not arrived yet we ended up with two in the frontend process. While here make sure a bpf FD has been received for an iface before trying to close(2) it. tweak & OK dv
2022-07-12Rewrite state machine in the style of dhcpleased(8).Florian Obser
It is less cluttered, easier to reason about and fixes some bugs in passing that would have been difficult in the old state machine. Stale IPv6 addresses, default routes and nameservers are now correctly removed when moving from one IPv6 enabled network to another IPv6 enabled network. Default routes and nameservers correctly expire when they are not refreshed and nameservers are updated when router advertisements change the nameserver option. Testing & input caspar@ Putting it in now to get wider testing and shake out bugs, discussed with deraadt@ at r2k22.
2022-07-10Add some anti-feline input protection by refusing to processKenneth R Westerback
input of excessive length. Make 'args' parameter to Xfuncs const char * and do the multiple argument parsing in Xswap() and Xflag() on a local copy.
2022-07-10Use nice #define's for input buf size and output help buf size.Kenneth R Westerback
No functional change.
2022-07-08Support sending certificate chains with intermediate CAs in multiple CERTTobias Heider
payloads. Local certificate chains as required with LetsEncrypt certs will work between iked and other IKEv2 implementations, iked to iked connections won't work yet because of missing support to receive multiple CERT payloads. from Katsuhiro Ueno tested by and ok sthen@
2022-07-08remove unused variablesJonathan Gray
2022-07-04Ignore any CERT payload after the first instead of failing the exchangeTobias Heider
when more than one is received. The first CERT is always the leaf certificate, additional payloads can be used to send intermediate certs which iked can not handle at the moment. This fixes exchanges where the certificate chain is still valid because matching intermediate certs are available locally in /etc/iked. Reported and tested by Loïc Revest <l.revest (at) apc.fr> ok mbuhl@
2022-07-04Fix error in the comparison of the Child SA nonces to decide whichTobias Heider
SA shall be deleted. ni should be set to the minimum nonce for the exchange intitiated by us while nr should be the smaller of the nonces of the simultaneous exchange initiated by the peer, which is stored in sa_simulat. This fixes the ni < nr comparison below and makes sure our Child SA is only deleted in the correct case as specified in RFC 7296. Reported by and fix from Sibar Soumi <sibar.soumi (at) achelos.de> ok mbuhl@
2022-07-02dhclient(8) has been undergoing replacement with "ifconfig xxx inet auto"Theo de Raadt
for a couple of years, backed by dhcpleased(8), which provides much better dns handling. The next step is to make the dhclient simply execve ifconfig in that way, and provide syslog warnings about deprecated options along the way. This way, we can find the last few dhclient users, and what they are missing. ok florian krw
2022-06-28Move debug-only variable 'i' to be with the other debug-onlyKenneth R Westerback
variables inside the #ifdef DEBUG block using them.
2022-06-28unbreak build; found the hard way by stspFlorian Obser
2022-06-28gc timeout_count, it's unused and I don't remember what I wanted toFlorian Obser
use it for.
2022-06-27tweak the tso text a little;Jason McIntyre