summaryrefslogtreecommitdiff
path: root/sbin
AgeCommit message (Collapse)Author
2022-05-06When printing the GPT table, display "Microsoft basic data" instead ofKenneth R Westerback
"FAT12" for partition types that are mapped to GPT_UUID_MSDOS. No intentional functional change.
2022-05-05Add error handling if setting the keyboard encoding fails. AfterAlexander Bluhm
open of all /dev/wskbd* devices failed, report the error from the first one. Also wrap long lines. OK mpi@
2022-05-05Switch the log_warnx() about trailing garbage to log_debug(). After aTheo Buehler
maintenance window, my ISP started sending an unexpected 'ff' byte at the very end which created noise in the log. Apparently this came up before. From and ok florian
2022-05-04As found by n18fuhtm AT tutanota.com there are dhcp servers that send aFlorian Obser
domain name option with length 1 and a single \0. We strip trailing \0 and then end up with length 0. This is a protocol violation, the minimum length for domain name option is 1, and we ignore the lease. Since we are not going to get this fixed this server side, we might as well just pretend that we didn't receive a domain name (or host name). We only ever care about them in the installer anyway. Not getting a lease because of this corner case is not helpful. OK deraadt
2022-05-03Rework display of partition types, removing unnecessary trailingKenneth R Westerback
blanks in the arrays of type names, simplifying the code and making better use of printf(). Along the way discover that "APFS Recovery" fits, so nuke the annoying "AFPS Recovry" contraction. No intentional functional change. Some "APFS Recovery" nits pointed out by jsg@
2022-04-28Convert the internal GPT partition entries into host-endian formKenneth R Westerback
on input/initialization and back to little-endian when writing to disk. Easier to read the code when letoh*() and uuid_[enc|dec]_* invocations are minimized. No intentional functional change. ok jmatthew@
2022-04-26Do not send a hostname option when we don't have a hostname.Florian Obser
The minimum length of a hostname is 1 according to RFC 2132. Found the hard way by Ibrahim Khalifa (ibo AT trukonsult.se) with DHCP Relay on a Cisco ASA in the installer where we don't have a hostname yet. Ibrahim also provided a diff which I simplified a bit. OK tb
2022-04-25Push DISK_[read|write]sectors() down to disk.c local functionsKenneth R Westerback
and expose new DISK_[read|write]bytes() functions. Eliminates many bytes <-> sector i/o dances and makes the code much easier to understand. Be a bit more careful to consistently write only bytes that checksums are calculated over. No intentional functional change.
2022-04-25gh_csum an gh_part_csum are not used between initializingKenneth R Westerback
the GPT and calculating them when writing the GPT to disk. No need to update them in add_partition(). Pointed out by jmatthew@
2022-04-24Use warnx() if errno is not relevant. close() after errno ofKenneth R Westerback
interest is checked, not before. Less confusing error messages.
2022-04-23Add missing uuid_dec_le() to init_gp() so -A works onKenneth R Westerback
big-endian architectures too.
2022-04-20Refine the GPT partition entry table validity check to ensureKenneth R Westerback
that the partition entry table associated with the primary GPT header at sector 1 doesn't overwrite the header or intrude into the sectors available for partitions. Similarly ensure that the partition entry table associated with the alternate header does not overwrite that header or intrude into the sectors available for partitions.
2022-04-20Wrap a long line.Kenneth R Westerback
2022-04-20Sigh. Another forgotten header file.Kenneth R Westerback
2022-04-20Simpify code manipulating GPT partition names by coalescingKenneth R Westerback
logic into GPT_get_name(), string_to_name() and name_to_string() functions. Remove unnecessarily abstract functions ask_string(), utf16le_to_string() and string_to_utf16le(). No intentional functional change.
2022-04-20Eliminate some local pointers to gp[pn] and just use gp[pn].Kenneth R Westerback
Fix some whitespace and memset() parameters in passing. No intentional functional change.
2022-04-19Forgot a file for previous commit.Kenneth R Westerback
No functional change.
2022-04-19Bring GPT_print_partition() into line with other functions being passedKenneth R Westerback
an index to the gp[] array by calling said parameter 'pn' and making it const unsigned int. No functional change.
2022-04-19Move declaration of DEBUG-only variable inside #ifdef DEBUG.Kenneth R Westerback
No functional change.
2022-04-19Eliminate superfluous intermediate variables 'pncnt' now thatKenneth R Westerback
gh.gh_part_num does not need a letoh32(). No functional change.
2022-04-18Convert the GPT header read from disk into a host-endian version,Kenneth R Westerback
and then back to little-endian when writing to disk. Reduces the number of invocations of the letoh*() and htole*() functions by 90 or so. Also makes that code much easier to read. No intentional functional change.
2022-04-17When kbd -l was executed as regular user, it failed silently. TryAlexander Bluhm
to open all wskbd devices, but report the first error and exit if none was successful. OK deraadt@ espie@
2022-04-14Move ((gh_part_size % d_secsize) == 0) validity checkKenneth R Westerback
to get_header() with the rest of the header validity checks. No functional change.
2022-04-13Correct a gh_part_csum calculation used in debug output.Kenneth R Westerback
Always calculate the GPT partition entries checksum over gh_part_num * gh_part_size bytes, not the maximal size of the internal partition entries array. No functional change.
2022-04-13IKED_LIFETIME_BYTES is > 2GB, and potentially used in strange place,Theo de Raadt
it should really be marked ULL ok bluhm tobhe
2022-04-13Correct a gh_csum calculation used in debug output.Kenneth R Westerback
Always calculate the GPT header checksum over gh_size bytes (a.k.a. 92), not sizeof(struct gpt_header). Compilers in their wisdom may pad the struct to a nice round size, e.g. 96 bytes. No functional change.
2022-04-13Eliminate a couple of 'XXX' assumptions by calculating the actualKenneth R Westerback
number of sectors a given number of GPT partition entries require. No intentional functional change.
2022-04-13Document sntrup761x25519 key exchange.Tobias Heider
2022-04-11Fix leak of esnxf if esn ore noesn are configured explicitly.Tobias Heider
2022-04-09fix grammar in comment: successfully -> successfulDave Voutila
2022-04-07constify ifmedia descriptions; ok deraadt@ miod@Christian Weisgerber
2022-03-31man pages: add missing commas between subordinate and main clausesChristian Weisgerber
jmc@ dislikes a comma before "then" in a conditional, so leave those untouched. ok jmc@
2022-03-25Savecore uses its own private copy of compress, so it shouldTheo Buehler
not include <zlib.h> discussed with deraadt
2022-03-21Prevent crash of unprivileged engine process (pledged stdio).Florian Obser
The length field of a DNS label in the DNS search list option is an 8 bit unsigned value. parse_dnssl() treats the search list option as an array of char, which are signed on most archs. When we read this value into an int variable it gets sign extended, allowing it to bypass sanity checks and eventually we pass it as the length to memcpy which treats it as a huge unsigned value leading to a heap overflow. An easy fix would be change the signature of parse_dnssl to parse_dnssl(uint8_t* data, int datalen). However, the DNS search list option is unused and the function fails to check if the parsed value is a valid domain name. The function is also getting in the way of future work so it's best to just delete it. The problem was found and reported by qualys, thanks! OK bluhm
2022-03-21default the conffile variable to the default file name instead of NULL.David Gwynne
this avoids having to test for NULL and swap the right name in place in a bunch of places. it also avoids having NULL passed to format strings in the parser. the only place where it actually matters if we're using the default or not is when we're parsing the config. if you don't specify a config, and the default file doesnt exist, that's ok. ok florian@
2022-03-16Make sure contents of vroute messages are aligned properly.Tobias Heider
Fixes address autoconfiguration on octeon. Found by and ok mbuhl@
2022-03-16The 'status' parameter to uuid_* functions is uint32_t, not int.Kenneth R Westerback
No intentional functional change.
2022-03-15Always use letoh32(gh.gh_part_num) instead of NGPTPARTITIONS whenKenneth R Westerback
scanning the GPT partition table. gh.gh_part_num reflects the actual size of the table read from/written to the disk and scanning possible entries between this value and the maximum allowed size of a partition table is pointless. No intentional functional change.
2022-03-14Abstract duplicated code scanning gpt_types[] into a helperKenneth R Westerback
function find_gpt_type(). Use find_gpt_type() to simplify the functions obtaining information from gpt_types[]. Add not yet used PRT_uuid_to_protection() to allow simplification of GPT partition protection code.. No intentional functional change.
2022-03-14And the prototype too.Kenneth R Westerback
2022-03-14PRT_uuid_to_typename() can return const char *.Kenneth R Westerback
2022-03-14Nuke extraneous blank line.Kenneth R Westerback
2022-03-14Improve retransmission of message fragments. RFC 7383 states that loss ofTobias Heider
a single fragment results in a retransmit of all fragments belonging to the same message. Instead of treating each fragment as message with seperate retransmit timer, keep only a single timer for all fragments of a message and retransmit all fragments in order on timeout. Improves reliability in case of packet loss when fragmentation is enabled. Found by and diff from Daniel Herzinger ok patrick@
2022-03-13parse_packet() is used by unbound to parse response packets, notFlorian Obser
queries. There is no need to do all this work just to get access to the query id and flags. OK bket, sthen
2022-03-13Missing 'or'.Kenneth R Westerback
Pointed out by jmc@
2022-03-12Probe for DNS64 presence with an absolute name so that asr doesn't addFlorian Obser
search domains and retry.
2022-03-11Simple hack to preserve the EFI System partition whenKenneth R Westerback
auto-allocating the space on a disk whose GPT contains any of the magic Apple partitions. One step towards saving the firmware files on Apple M1 machines when installing OpenBSD. Tested & ok kettenis@
2022-03-07rename net80211 ioctl struct ieee80211_channel to struct ieee80211_chaninfoStefan Sperling
ioctls should use dedicated names for their structs, but SIOCG80211ALLCHANS duplicated struct ieee80211_channel. We cannot make changes to the kernel's version of ieee80211_channel while an ioctl is squatting on the struct name. Helpful guidance from deraadt@ Tested in a ports bulk build by sthen@, and tested by Mikhail. ok sthen@
2022-03-03Use LDNS_RCODE define; no functional changeFlorian Obser
2022-03-01Update to libunbound 1.15.0; heavy lifting by sthen in unbound(8).Florian Obser
Upstream renamed parse_edns_from_pkt to parse_edns_from_query_pkt and added two arguments (config_file and comm_point) that we don't use, adjust callers in frontend accordingly.