summaryrefslogtreecommitdiff
path: root/sbin
AgeCommit message (Collapse)Author
2021-10-06Remove autoconfprivacy deprecation warning.Florian Obser
OK deraadt
2021-09-29Don't constrain -b specified block count or block size to be greater than 63.Kenneth R Westerback
Allow any value from 1 to UINT32_MAX. MBR boot partition sizes/offsets are completely machine dependent. Pointed out by loongson.
2021-09-26Revert '-b' change. Forgot required bsd.rd tweak.Kenneth R Westerback
2021-09-26MBR partitions created with '-b' should be marked DOSACTIVE.Kenneth R Westerback
That's what 'bootable' means in the MBR world. GPT partitions created by '-b' are unaffected. Pointed out by kettenis@, obviating need for new option.
2021-09-22if the key is a secret to be cleared with explicit_bzero, then theTheo de Raadt
length of that key is also a secret, may as well clear it also
2021-09-21Use upercase DHCP and sprinkle in some ":".Florian Obser
Committing on behalf of jmc OK deraadt
2021-09-20jmc was a bit too eager and deleted the -DSUN_CYLCHECK -DSUN_AAT0Theo de Raadt
compile options required for sparc64 (partition alignment, in particular) noticed by bluhm during testing
2021-09-20Document how a 0 byte can be encoded for client-id.Florian Obser
Requested by & OK sthen mdoc clue by schwarze
2021-09-20According to RFC 2132 (9.14. Client identifier) a hardware type of 0Florian Obser
should be used when the client identifier is not a hardware address, for example if it's just a string. It turns out that the majority of dhcp clients (and possibly servers?) does not do this but rather transmits the client identifier verbatim if a string is configured. The first character becomes the hardware type. Make dhcpleased(8) behave the same. Difference in behavior with dhclient(8) and interoperability issues with dhcp(8) first pointed out by Olivier Cherrier on misc@ OK sthen fine to get it in for 7.0 deraadt
2021-09-18upon length check or other failure, explicit_bzero an object, because it mayTheo de Raadt
contain a partially copied password ok tobhe
2021-09-18freezero() instead of free(), because the object may contain a passwordTheo de Raadt
ok tobhe
2021-09-16dhcpleased(8) does not (yet?) track if routes it added are deletedFlorian Obser
behind its back. When a lease gets renewed dhcpleased simply adds all routes and lets the kernel sort duplicates out. This however leads to "failed to send route message: File exists" messages in /var/log/daemon which are confusing. Since this is expected do not log it as an error. While here change the error message when proposing nameservers so that it can be distinguished from failed routes. Pointed out by deraadt
2021-09-15Rewrite and simplify dhcpleasectl(8).Florian Obser
With this dhcpleasectl em0 does the same as dhclient em0 used to do. To please people's muscle memory one can be aliased to the other. earlier version OK benno with lots of help massaging the output & OK deraadt
2021-09-15Remove configured routes no longer present in lease.Florian Obser
Problem reported by claudio OK benno
2021-09-14When the dhcp server is unreachable via unicast UDP retry broadcast.Florian Obser
The only indication we get is sendto(2) failing, so if our UDP packet is silently dropped somewhere we won't notice. This has been observed in the wild with a dhcp server at the remote end of a VPN. The dhcp server is reachable via broadcast so we get an initial lease. However the server is not in the same subnet as the lease we are getting so to reach it unicast we depend on a default route being set. When the VPN goes down we lose the default route [*] and when dhcpleased then tries to renew the lease (unicast), sendto(2) fails with "network unreachable". [*] The exact mechanics on how this happens are unclear. I.e. why didn't dhcpleased(8) see a link-state change and transitioned to REBOOTING / INIT? Regardless, we shouldn't ignore sendto(2) errors. Reported by stsp, OK benno
2021-09-13disk.dk_size can't be 0 as we errx() if that happens duringKenneth R Westerback
DISK_open(). So eliminate pointless check when printing geometry. Replace unit_lookup() with units_size(), reducing four conversion dances to one. Return pointer to the unit_type used in the conversion. unit_types[] is now needed only in misc.c. Fewer variables make for cleaner logic. No intentional functional change.
2021-09-13Document that the editing command 'disk' takes an optional units argument.Kenneth R Westerback
2021-09-12Stop taking detour through unit_types[SECTORS] to findKenneth R Westerback
dl.d_secsize. Leave unit_types[SECTORS].ut_conversion at 0, and test that to determine if a size needs to be converted from a sectors value. Use consistent dance to find the desired size value to print. Logic is clearer, unit_types[] is now const, nobody but misc.c knows about SECTORS. No intentional functional change.
2021-09-10Stop using NULL as a synonym for "s" (SECTORS). Just use "s".Kenneth R Westerback
Remove now pointless NULL check in unit_lookup(). No intentional functional change.
2021-09-09Simplify logic in USER_edit() loop to eliminate unnecessaryKenneth R Westerback
goto's. Rename CMD_SAVE to CMD_QUIT to reflect actual command (Xquit) and help and man page verbiage. No intentional functional change.
2021-09-09Scan unit_types[] array using nitems() and eliminate the NULLKenneth R Westerback
sentinal entry. No functional change.
2021-09-07Fix leak of msg_cert.id_buf. ikev2_msg_cleanup() frees id_buf if weTobias Heider
don't delete the pointer. ok markus@
2021-09-07Fix leak of m if message initialization fails.Tobias Heider
ok markus@
2021-09-06Fix leaks in vroute addr and route caches.Tobias Heider
ok patrick@
2021-09-02styleTobias Heider
2021-09-02Split part_type into separate types 'mbr_type' and 'gpt_type',Kenneth R Westerback
shrinking static data demands. Split PRT_printall() into PRT_print_mbrtypes() and PRT_print_gpttypes() to eliminate pointless 'pseudo' MBR partition types and pointless display of MBR partition types with no associated GPT GUIDs. Eases future MBR and GPT partition type editing improvements. ok kettenis@
2021-09-02atactl(8): few printf("%s", NULL) cleanupSebastien Marie
ok deraadt@
2021-09-01Improve editing GPT partition type GUID's by rejecting partitionKenneth R Westerback
id's that have no associated GUID, rather than disabling the partition. If the current partition type is a GUID with no corresponding partition id, display and use that GUID as the default value. Less surprising behaviour all round.
2021-09-01Add client side support for DNS configuration. Use RTM_PROPOSAL_STATICTobias Heider
route messages to propose the name server to resolvd(8). For now, iked will only propose a single name server from the first established connection. Automatic name server configuration is enabled by default for policies using the 'iface' option. discussed with deraadt@ ok for the DNS parts florian@ ok for the rest patrick@
2021-08-31Adjust .Bl widthKlemens Nanni
2021-08-31Say autoconf not dhcpKlemens Nanni
Do not abuse "dhcp" to say "DHCP and SLAAC". unwind.conf(5) does so but unwindctl(8) does not; in fact, the latter already has `status autoconf' to Show nameservers learned from dhclient(8), dhcpleased(8) or slaacd(8). Adjust unwind's config manual and internal code accordingly; still accept the old keyword but do not document it. hostname.if(5) already advises for `inet[6] autoconf' instead of `dhcp' and other related daemons don't abuse the word "dhcp" like unwind does. Feedback sthen OK florian
2021-08-31shorten some codeTheo de Raadt
2021-08-30Accept dns proposals for the loopback addressesKlemens Nanni
Don't reserve^Wignore them for unwind(8); there are non-unwind use-cases and so far resolvd(8) always seems to do the right thing when proposing localhost while unwind is running. OK benno
2021-08-30Fix max nameserver proposals limitKlemens Nanni
Count the total number of proposals and not five per address family each. Don't print ignored addresses by default anymore and leave that to `-v'. OK benno
2021-08-30Clarify how dns proposals are replaced not added per interfaceKlemens Nanni
OK benno
2021-08-30INADDR_LOOPBACK check needs htonl(3) to workKlemens Nanni
Found in resolvd(8) which uses the same code.
2021-08-30INADDR_LOOPBACK check needs htonl(3) to workKlemens Nanni
2021-08-29nameserver command requires an interface argumentKlemens Nanni
2021-08-29Nuke unused variable and unnecessary initialization.Kenneth R Westerback
2021-08-28Add hex_octet() so the strtol(..,16) dance is done in just oneKenneth R Westerback
place. Allows single-digit partition id's in '-b' as a side benefit.
2021-08-27Replace stray hand-rolled nitems() with nitems().Kenneth R Westerback
2021-08-25Two more Capt. Obvious comments go away.Kenneth R Westerback
2021-08-25Don't use log_procname before it is initialized. In particularKenneth R Westerback
set_iff_up() is called from initialize_interface() and was using log_procname instead of ifi->name in its fatal()'s. Diagnosed by tb@ from a recent reddit post by zielonykid1234.
2021-08-25Consolidate '-e' edit command parsing into ask_cmd(), simplifyingKenneth R Westerback
the main '-e' loop. No functional change.
2021-08-24Add an #ifdef DEBUG/#endif chunk that dumps the entire GPT header whenKenneth R Westerback
printing a GPT. No functional change outside of DEBUG.
2021-08-24When an interface disappears, e.g. when a usb dongle gets unplugged,Florian Obser
we get a RTM_IFANNOUNCE message not a RTM_IFINFO message. Handle this message to not accumulate "unknown" interfaces. While here fix a bug where we would remove an interface only in the engine process but not in the frontend when an interfaces gets unplugged while we process a RTM_IFINFO message for it. OK benno
2021-08-24When an interface disappears, e.g. when a usb dongle gets unplugged,Florian Obser
we get a RTM_IFANNOUNCE message not a RTM_IFINFO message. Handle this message to not accumulate "unknown" interfaces. OK benno
2021-08-24use Pa for resolv.conf.tail, since there is no longer a man pageJason McIntyre
to Xr;
2021-08-24make SYNOPSIS match usage to indicate -l is optional in:Jason McIntyre
swapctl [[-l] | -s] [-k] from martin vahlensieck
2021-08-24A couple more Capt. Obvious comments can go.Kenneth R Westerback