summaryrefslogtreecommitdiff
path: root/sbin
AgeCommit message (Collapse)Author
2023-01-20editor_name() and get_mp() don't change the disklabel soKenneth R Westerback
const'ify some parameters and local variables.
2023-01-20char * -> const char * parameters where clang doesn't complain.Kenneth R Westerback
2023-01-18remove redundant SIOCS80211JOIN ioctl call in ifconfig delifjoinlist()Stefan Sperling
Found by Mathias Koehler, thanks!
2023-01-18Use ROUNDDOWN() to round down to cylinder boundary.Kenneth R Westerback
2023-01-18Use ROUNDUP() to round up to cylinder boundary.Kenneth R Westerback
2023-01-17Nuke unused MAXIMUM(). Add ROUNDUP() and ROUNDDOWN().Kenneth R Westerback
2023-01-16Use size of largest chunk of free space, not total of all chunksKenneth R Westerback
of free space, when checking for sufficient space to add a partition. As a side-benefit the list of free chunks only needs to be built once.
2023-01-14Replace comparisons/assignments to '3' with equivalent comparisons to RAW_PARTKenneth R Westerback
and assignment to RAW_PART + 1.
2023-01-13Fix a couple of auto allocation corner cases.Kenneth R Westerback
Don't stop counting free partitions just because a spoofed partition is encountered. Always check for (end - start) underflow after rounding start/end to cylinder boundaries.
2023-01-13shutdown(8): sig_atomic_t variables should be qualified 'volatile'Scott Soule Cheloha
2023-01-09disklabel appeared in tahoeJonathan Gray
ok krw@
2023-01-06PF_ANCHOR_STACK_MAX is insufficient protection against stack overflow.Alexandr Nedvedicky
On amd64 stack overflows for anchor rule with depth ~30. The tricky thing is the 'safe' depth varies depending on kind of packet processed by pf_match_rule(). For example for local outbound TCP packet stack overflows when recursion if pf_match_rule() reaches depth 24. Instead of lowering PF_ANCHOR_STACK_MAX to 20 and hoping it will be enough on all platforms and for all packets I'd like to stop calling pf_match_rule() recursively. This commit brings back pf_anchor_stackframe array we used to have back in 2017. It also revives patrick@'s idea to pre-allocate stack frame arrays from per-cpu. OK kn@
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@