summaryrefslogtreecommitdiff
path: root/sbin
AgeCommit message (Collapse)Author
2023-01-05Make free_chunks() return 'const struct chunk *' since we don'tKenneth R Westerback
modify chunks outside of free_chunks(). Adjust local variables taking the return value as needed. No intentional functional change.
2023-01-04Use 'const struct disklabel *' parameters where the disklabel isKenneth R Westerback
not altered. And 'const struct partition *' for pointers into newly const disklabels. No intentional functional change.
2023-01-04Eliminate two unnecessary 'i' loop variables by incrementingKenneth R Westerback
the pointer instead. No intentional functional change.
2023-01-04Replace p_fstype to/from FS_UNUSED dances around invocations ofKenneth R Westerback
free_chunks() with a parameter that names the partition to treat as FS_UNUSED when building the list of free space chunks. With -1 indicating that no partition should be ignored. Simplifies code and enables further simplifications and a raft of const'ifications. No intentional functional change. Regress still happy. SUN_CYLCHECK, SUN_AAT0 and D_VENDOR still happy.
2023-01-04Christos Zoulas agreed to rescind clause 3 and 4 inJonathan Gray
NetBSD fsck.8 rev 1.35 fsutil.h rev 1.14 pathnames.h rev 1.2 netgroup_mkdb.8 rev 1.9 netgroup_mkdb.c rev 1.18 str.c rev 1.7 str.h rev 1.4 rdate.8 rev 1.11 rdate.c rev 1.19 extern.h rev 1.14 getnetgrent.c rev 1.41 netgroup.h rev 1.10 fparseln.3 rev 1.4 fparseln.c rev 1.10 our stringlist.c/stringlist.h are derived from getnetgrent.c rfc868time.c from rdate.c newfs/pathnames.h from fsck/pathnames.h https://mail-index.netbsd.org/source-changes/2009/10/21/msg002182.html Not all files are covered as some had copyright assigned to TNF in 1998.
2023-01-04Shuffle code a bit to eliminate need for inner loopKenneth R Westerback
variable 'j' in editor_allocspace(). No intentional functional change. Regress still happy.
2023-01-03No need to call editor_countfree() when displaying all the freeKenneth R Westerback
chunks in the 'r' editor command. Just add up chunks as they are displayed. Eliminates pointless second invocation of free_chunks(). Increment the chunk pointer rather than using iteration variable + indexing. No intentional functional change.
2023-01-03do not mention dhclient as a dhcp route message senderTheo de Raadt
2022-12-23point readers, where relevant, to route(8) rather than netstat(1) or route(4);Jason McIntyre
remove some redundant info regarding netstat -r from ipcomp/ipsec feedback claudio sthen ok claudio kn sthen
2022-12-22Denote multiple arguments with 'arg ...' not 'args'Klemens Nanni
A few programs used the plural in their synopsis which doesn't read as clear as the obvious triple-dot notation. mdoc(7) .Ar defaults to "file ..." if no arguments are given and consistent use of 'arg ...' matches that behaviour. Cleanup a few markups of the same argument so the text keeps reading naturally; omit unhelpful parts like 'if optional arguments are given, they are passed along' for tools like time(1) and timeout(1) that obviously execute commands with whatever arguments where given -- just like doas(1) which doesn't mention arguments in its DESCRIPTION in the first place. For expr(1) the difference between 'expressions' and 'expression ...' is crucial, as arguments must be passed as individual words. Feedback millert jmc schwarze deraadt OK jmc
2022-12-22it seems we made a separate list for the two sourceaddr commands,Jason McIntyre
just to remove some vertical spacing; that is unfortunate because when i adjusted the list spacing it did not affect this second list, and logically it is one list (route commands) not two; resolve this by having one -compact list, and inserting Pp between list items where needed;
2022-12-22move the flag mappings displayed by "route show" from netstat(1) to route(8):Jason McIntyre
diff from paul tagliamonte, who was surprised to find them not documented in route(8); claudio agreed placement was not ideal; deraadt confirmed users better served by route(8) than netstat(1); i've tweaked some of the spacing and text so it displays better, and removed some macros incorrectly associated with the "nameserver" list item, which was messing up the formatting. should display better now
2022-12-18Unify RSSI checkKlemens Nanni
Two spots in ifconfig print the signal strength, one for the "ieee80211: " line and one for each SSID in scan output. Only the former checks nr_rssi, which is not needed as nr_max_rssi alone indicates whether the driver reports signal strength in percentage or dBm. Zap the nr_rssi check to simplify; "worst case" we display 0% or 0dBm instead of nothing. Feedback OK stsp
2022-12-11Balance a getifaddrs() with a freeifaddrs(); plugs a leak seen byOtto Moerbeek
florian@ and myself. ok florian@
2022-12-09resolvd: fix leaks of line and fpTheo Buehler
In case asprintf() fails or the iov overflows, the file and the line read would be leaked. also noted by otto ok deraadt millert
2022-12-09iovcnt can be zero, writev does not like that and O_CREATE isOtto Moerbeek
not needed, we just renamed sucessfully to that file. ok deraadt@ florian@
2022-12-06Print size_t with %zu.Tobias Heider
ok patrick@
2022-12-04userspace: remove vestigial '?' cases from top-level getopt(3) loopsScott Soule Cheloha
getopt(3) returns '?' when it encounters a flag not present in the in the optstring or if a flag is missing its option argument. We can handle this case with the "default" failure case with no loss of legibility. Hence, remove all the redundant "case '?':" lines. Prompted by dlg@. With help from dlg@ and millert@. Link: https://marc.info/?l=openbsd-tech&m=167011979726449&w=2 ok naddy@ millert@ dlg@
2022-12-04Rename sun to s_un for portability.Tobias Heider
ok patrick@
2022-12-03Consistently use uintXX_t from <stdint.h> instead of u_intXX_t.Tobias Heider
2022-12-03Include endian.h where needed for betohXX functions.Tobias Heider
2022-12-01Oops, the tweak was not correct, go with my original version.Florian Obser
Pointed out by tb.
2022-12-01Make sure the length of an unknown IP option is sensible.Florian Obser
For example, an unknown option with length 0 would result in an infinite loop. bluhm points out that the network stack in the kernel would not let such packets through to userland. tweak & OK miod OK bluhm
2022-11-30Switch idiom of d2i_ECDSA_SIG() invocationTheo Buehler
Instead of the discouraged obj = NULL; d2i_ECDSA_SIG(&obj, ...); use the recommended obj = d2i_ECDSA_SIG(NULL, ...);. While it makes no difference here, it's better practice. suggested by & ok markus
2022-11-29Ignore late check results for resolvers we no longer use.Florian Obser
Since we no longer use that specific resolver there is also no need to re-check it. tb pointed out that prev_state might be used uninitialized in this case. OK tb
2022-11-27Provide more accurate lock error messageKlemens Nanni
When started manuall from single-user mode (/ still read-only), the current error is misleading: # slaacd -dv slaacd: already running The lock was specifically added to prevent multiple instances in the installer, which discards the error message entirely anyway. Retain the useful EAGAIN/"already running" message, but otherwise print the real error reason: # slaacd -dv slaacd: /dev/slaacd.lock: Read-only file system Feedback OK deraadt millert
2022-11-27Plug leak of tmp in case allocation of pq->abuf failsTheo Buehler
ok florian
2022-11-27KNF nit: place brace correctlyTheo Buehler
ok florian
2022-11-26Bump to 7.2Tobias Heider
2022-11-26- in SYNOPSIS, redo the formatting for "address" and "dest address" to avoidJason McIntyre
an ugly line split on narrower terminals - in usage(), match the output
2022-11-25ifconfig -M <mac> finds the address on an interface and prints it.Theo de Raadt
cloned (virtual) interfaces are skipped, and if the MAC is on more than 1 interface, no answer either. The mac must be in same format as the ifconfig lladdr output (complete lowercase with :) idea from florian, ok afresh1
2022-11-25Do not crash when a tcp query is larger than the length fieldAlexander Bluhm
indicated. Found by kn with amap. Input bluhm. OK deraadt, tb, otto, kn from florian@
2022-11-23iked(8) is proposing as wellKlemens Nanni
Since sbin/iked/vroute.c r1.13 (sep 2021): Add client side support for DNS configuration. Use RTM_PROPOSAL_STATIC route messages to propose the name server to resolvd(8).
2022-11-21Fix DIOCIGETIFACES ioctl so all network interfacesAlexandr Nedvedicky
and interface groups are reported. The bug allowed to enumerate the first 64 interfaces only. The issue has been noticed and bug kindly reported by Olivier Croquin. OK kn@
2022-11-19fix vertical spacing in previousKlemens Nanni
2022-11-19Prettify expired rules printingKlemens Nanni
"pfctl -s rules" omits expired rules but print newlines for them. "pfctl -s rules -v" omits expired rules but print their stats. Add the existing skip check to those two missing print logic places such that expired rules won't cause any output at all, as expected, unless debug ("-g") or more verbose ("-vv") mode are given, as documented. OK sashan
2022-11-19Add O: to the getopt string for newfs in mount_mfs mode, allowing it toStuart Henderson
optionally use FFS2 (stu@ ran into a problem when running some tests on an MFS filesystem that involved future dates). Correct the manual which said that FFS2 is the default, which isn't the case for mount_mfs. lgtm miod@
2022-11-18Revert my last two changes.Moritz Buhl
If csa_bundled is set, exactly two csas exist and they point to each other. Therefore childsa_free already sets the bundled csa pointer to NULL and it shouldn't be done after calling childsa_free. ok tobhe@
2022-11-18Improve "once" bitsKlemens Nanni
- use imperative tense in the pf.conf(5) "once" part - leave printing implementation details to pfctl(8)'s "-s rules" part - use more markup - debug mode also prints expired rules OK jmc sashan
2022-11-14fix swapped user/group introduced in sync-with-mount_tmpfs commit;Stuart Henderson
from Josiah Frentsos
2022-11-14Preserve original order of nameserversKlemens Nanni
RFC 2132 "DHCP Options and BOOTP Vendor Extensions" 3.8. Domain Name Server Option says Servers SHOULD be listed in order of preference. tcpdump(8), route(8) monitor and dhcpleasectl(8) -l athn0 show servers from the DHCP OFFER in their original order, as expected. resolvd(8) however sorts proposals by priority and IP address before writing them to resolv.conf(5). But as the system resolver tries this file's `nameserver' options in the order appearance, sorting by IP breaks DHCP's intended order and thus may result in the wrong nameserver being queried. Sorting by IP is done to later remove duplicates from the file. Sort by priority alone and ensure uniqueness by iterating over the list of of proposals and zeroeing duplicates instead to preserve any proposal's original order. Spotted on a public wifi OFFERing two local IPs plus 8.8.8.8 in this order which ended up with 8.8.8.8 being the first entry in my /etc/resolv.conf. In other words, `route nameserver lo0 2.2.2.2 1.1.1.1 1.1.1.1' now yields nameserver 2.2.2.2 # resolvd: lo0 nameserver 1.1.1.1 # resolvd: lo0 rather than nameserver 1.1.1.1 # resolvd: lo0 nameserver 2.2.2.2 # resolvd: lo0 Feedback OK deraadt
2022-11-14- show -R with -s in options listJason McIntyre
- show -t with -T in options list - sort the -T commands - small text/formatting tweaks ok sthen ok kn on an earlier version
2022-11-13Make sure csa->csa_bundled is NULL after freeing to prevent aMoritz Buhl
possible use after free. ok tobhe@
2022-11-13Sync config.h, we have ed25519 support now.Florian Obser
2022-11-11Make sure csa->csa_bundled is NULL after freeing to prevent aMoritz Buhl
possible use after free. ok tobhe@
2022-11-11In case of an invalid SA resp is passed to ikev2_msg_cleanup withoutMoritz Buhl
initialization where the msg_parent field is accessed. ok tobhe
2022-11-10HP-300's hd is now gone. svnd transmorgified into vnd in 2011. NoKenneth R Westerback
need to keep checking for these device names.
2022-11-09simplify expiration of 'once' rules.Alexandr Nedvedicky
let packet to mark 'once' rule as expired. The rule will be removed by pfctl(8) when rules are updated. OK kn@
2022-11-09No more xd/xy devs.Kenneth R Westerback
2022-11-09ndp, route, netstat: adjust ipv6 address widthKlemens Nanni
It has been annoying me for too long that fully specififed GUAs (2001:0db8:3333:4444:5555:6666:7777:8888) mess up alignment. systat(1)'s netstat is the only view that has a big enough limit and thus never misaligns. Unify ndp(8), route(8) and netstat(1) views to always align nicely. Feedback OK claudio