summaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* logs-show: move journal_find_boot_by_offset() and friends from journalctl.cYu Watanabe2023-09-263-213/+217
|
* journalctl: several cleanups for find_boot_by_offset()/_by_id()Yu Watanabe2023-09-261-21/+26
| | | | | | - their names are prefixed with "journal_", - make them not directly use global variables, - simplifies the loop counter in find_boot_by_offset().
* sd-journal: refuse to write entry without boot IDYu Watanabe2023-09-261-1/+5
| | | | To make journal entries always contain valid boot ID.
* sd-journal: boot_id is always non-NULLYu Watanabe2023-09-261-4/+3
| | | | | The two callers of journal_file_append_entry_internal() always pass non-NULL boot ID.
* sd-journal: also verify tail_entry_boot_id and friends in ↵Yu Watanabe2023-09-262-10/+28
| | | | | | journal_file_verify_header() Then, we can drop the redundant check in journal_file_read_tail_timestamp().
* test: fix header verificationYu Watanabe2023-09-261-3/+6
|
* Merge pull request #29314 from YHNdnzj/firstboot-fixupLuca Boccassi2023-09-251-1/+1
|\ | | | | Small fixups for first boot
| * core/main: log that we assume first boot if failed to read machine-idMike Yuan2023-09-251-1/+1
| |
* | Merge pull request #29309 from poettering/resolved-varlink-tweaksLennart Poettering2023-09-253-5/+17
|\ \ | | | | | | resolved: minor varlink API tweaks
| * | resolved: rename varlink function to match exposed method nameLennart Poettering2023-09-251-2/+2
| | |
| * | resolved: also expose interface index in server JSON dataLennart Poettering2023-09-252-3/+15
| | |
* | | oomd: correct listening socketsLennart Poettering2023-09-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So, unfortunately oomd uses "io.system." rather than "io.systemd." as prefix for its sockets. This is a mistake, and doesn't match the Varlink interface naming or anything else in oomd. hence, let's fix that. Given that this is an internal protocol between PID1 and oomd let's simply change this without retaining compat.
* | | varlink: move O_NONBLOCK setting to varlink_server_listen_fd(), and set ↵Lennart Poettering2023-09-251-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | O_CLOEXEC too Let's move setting of O_NONBLOCK into varlink_server_listen_fd() and out of varlink_server_create_listen_fd_socket(). The latter has two callers: varlink_server_listen_fd() and varlink_server_listen_address(), which guarantees O_CLOEXEC+O_NONBLOCK anyway, hence no neet to repeat the logic.
* | | repart: add extra safety check that the verity signature fits in the ↵Lennart Poettering2023-09-251-0/+3
| | | | | | | | | | | | partition we want to write
* | | string-util: make strgrowpad0() a bit saferLennart Poettering2023-09-251-1/+10
| |/ |/| | | | | | | Let#s make sure we never shorten the allocation leaving an invalid string (i.e. a memory allocation without a trailing NUL) around.
* | alloc-util: remove duplicate empty lineLennart Poettering2023-09-251-1/+0
|/
* pcrextend: make PCR index configurableLennart Poettering2023-09-251-10/+24
| | | | | Let's make the tool a tiny bit more generic by allowing the PCR index to measure into to be configurable.
* pcrphase: rename binary to pcrextendLennart Poettering2023-09-253-17/+21
| | | | | | | | | | | | | | | | | | | The tool initially just measured the boot phase, but was subsequently extended to measure file system and machine IDs, too. At AllSystemsGo there were request to add more, and make the tool generically accessible. Hence, let's rename the binary (but not the pcrphase services), to make clear the tool is not just measureing the boot phase, but a lot of other things too. The tool is located in /usr/lib/ and still relatively new, hence let's just rename the binary and be done with it, while keeping the unit names stable. While we are at it, also move the tool out of src/boot/ and into its own src/pcrextend/ dir, since it's not really doing boot related stuff anymore.
* sd-dhcp-client: reject NAKs from servers that we did not send an offer to ↵Alexandre Peixoto Ferreira2023-09-251-1/+6
| | | | | (#29290) To support multiple DHCP servers in a network.
* Merge pull request #29254 from yuwata/sd-ndisc-use-usec_tLuca Boccassi2023-09-226-159/+150
|\ | | | | sd-ndisc: make sd_ndisc return time values in usec
| * sd-ndisc: make sd_ndisc return time values in usecYu Watanabe2023-09-226-121/+111
| | | | | | | | | | This also introduces sd_ndisc_router_get_lifetime_timestamp() and friends that return timestamp rather than timespan.
| * sd-ndisc: rename function arguments for storing resultsYu Watanabe2023-09-212-43/+44
| |
* | sd-dhcp-client: split out client_parse_message()Yu Watanabe2023-09-222-51/+70
| | | | | | | | | | No functional change, just refactoring and preparation for later commits.
* | sd-dhcp-client: introduce dhcp_lease_unref_and_replace()Yu Watanabe2023-09-222-14/+12
| |
* | sd-dhcp-client: do not set fallback subnet mask if it is already setYu Watanabe2023-09-222-14/+11
| |
* | sd-dhcp-client: split out client_enter_requesting()Yu Watanabe2023-09-221-8/+15
| | | | | | | | | | No functional change, just refactoring and preparation for later commits.
* | sd-dhcp-client: split out client_enter_bound()Yu Watanabe2023-09-221-39/+41
| | | | | | | | | | No functional change, just refactoring and preparation for later commits.
* | btrfs-util: fix one memory leakMike Yuan2023-09-221-0/+2
| | | | | | | | Follow-up for efb6a76a2a097132087ee30720421136cba9e708
* | repart: Don't fail on boot if we can't find the root block deviceDaan De Meyer2023-09-221-0/+3
| | | | | | | | | | | | When booting from virtiofs, we won't be able to find a root block device. Let's gracefully handle this similar to how we don't fail if we can't find a GPT partition table.
* | hibernate-resume: add missing #pragma onceMike Yuan2023-09-221-0/+1
| |
* | hibernate-resume: break lines in meson.build files()Mike Yuan2023-09-221-2/+8
| |
* | Merge pull request #29224 from keszybz/netdev-config-parsingZbigniew Jędrzejewski-Szmek2023-09-2235-975/+584
|\ \ | | | | | | Use a helper to simplify parsing of ranges in netdev config and related changes
| * | netdev/wireguard: define iterator variable in the loopZbigniew Jędrzejewski-Szmek2023-09-221-2/+1
| | |
| * | network: make DEFINE_NETDEV_CAST() assert on input and outputZbigniew Jędrzejewski-Szmek2023-09-2223-446/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The macro used to return NULL if input was NULL or had the wrong type. Now it asserts that input is nonnull and it has the expected type. There are a few places where a missing or mismatched type was OK, but in a majority of places, we would do both of the asserts. In various places we'd only do one, but that was by ommission/mistake. So moving the asserts into the macro allows us to save some lines.
| * | network/netdev: align tablesZbigniew Jędrzejewski-Szmek2023-09-224-10/+10
| | |
| * | network/netdev: fix resetting of 'inherit' fieldZbigniew Jędrzejewski-Szmek2023-09-222-21/+20
| | | | | | | | | | | | | | | | | | We have two fields: inherit and ttl, and ttl is ignored if inherit is true. Setting TTL=inherit and later TTL=n would not work because we didn't unset inherit.
| * | network: refusing parsing negative flow labelsZbigniew Jędrzejewski-Szmek2023-09-221-14/+9
| | | | | | | | | | | | | | | The docs for FlowLabel= said that the range is 0..1048575, but the code did not reject negative numbers.
| * | network/fou-tunnel: simplify parsing of protocol numberZbigniew Jędrzejewski-Szmek2023-09-221-20/+15
| | | | | | | | | | | | | | | | | | Previously, we would call parse_ip_protocol(), which internally calls safe_atoi(), and then call safe_atou(). This isn't terrible, but it's also slightly confusing. Use parse_ip_protocol_full() to avoid the second call.
| * | shared/ip-procotol-list: generalize and rework parse_ip_protocol()Zbigniew Jędrzejewski-Szmek2023-09-223-36/+50
| | | | | | | | | | | | | | | | | | | | | | | | Optionally, accept protocols that don't have a known name. Avoid any allocations in the common case. Return more granular error codes: -ERANGE for negative values, -EOPNOTSUPP if the protocol is a valid number, but we don't know the protocol, and -EINVAL only if it's not a numerical string.
| * | network/vxlan: avoid unneccesary temporary variablesZbigniew Jędrzejewski-Szmek2023-09-221-12/+5
| | | | | | | | | | | | parse_ip_port_range() DTRT and only sets the output on success.
| * | network/netdev: use ASSERT_PTR() more, adjust indentationZbigniew Jędrzejewski-Szmek2023-09-228-166/+86
| | |
| * | network: use a common helper to parse bounded rangesZbigniew Jędrzejewski-Szmek2023-09-228-249/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This compresses repetetive code and makes it easier to add new options in networkd. The formatting of error messages becomes uniform. The error message always specifies the rvalue literally, instead of using a "descriptive name". This makes the message much easier to handle for the user. I opted to add just one parser, and wrap it with inline functions to proxy the type. This is less verbose than copying functions for each type separately, and the compiler should be able to get rid of the inline wrapper almost entirely. asserts are reordered to use the same order as the parameter list. This makes the code easier to read. No functional change intended, apart from the difference in error message formatting.
| * | basic/parse-util: add helper to parse bounded unsigned valuesZbigniew Jędrzejewski-Szmek2023-09-193-1/+43
| | | | | | | | | | | | | | | "parse_range" is already used for stuff like "a-b", so use "bounded" here to avoid confusion.
| * | sd-network: modernize log error messagesZbigniew Jędrzejewski-Szmek2023-09-193-40/+30
| | | | | | | | | | | | | | | | | | | | | SYNTHETIC_ERRNO() is used where appropriate. Splits in message format strings are removed, so that it's easier to read/grep/copy them.
* | | find_legacy_keymap: extend variant match bonus againAdam Williamson2023-09-222-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the column is "-" and the X context variant specifer only contains commas, we should also give the match bonus. The variant string is supposed to be a comma-separated list as long as the list of layouts, so it's quite natural for consumers to be written in such a way that they pass a string only containing commas if there are multiple layouts and no variants. anaconda is a real world case that does this. Signed-off-by: Adam Williamson <awilliam@redhat.com>
* | | sd-journal: refuse entry objects with an empty boot IDYu Watanabe2023-09-221-0/+5
| |/ |/| | | | | | | | | | | | | | | Otherwise, e.g. sd_journal_get_monotonic_usec() return an empty boot ID when called for such a broken entry object. Such a broken object may be stored when the system was not cleanly shutdown. Fixes #29167.
* | systemctl: link to all non-man-page files in helpZbigniew Jędrzejewski-Szmek2023-09-211-5/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For file:// links, we urlify the link so that the user can click and either open the file in a editor or some viewer. The detection is chosen via some mechanism implemented by the terminal emulator. This seems too DTRT for text files and PDFs, which should cover the majority of realistic cases. If the file is not viable, the terminal emulator will say "Could not open file://…. No application is registered to view this file type." or similar. For all other links, which are primarily http:// and https://, we just show the link, letting the terminal handle the hyperlinking. The user can then ctrl-click and open the file it their browser. If we tried to open the files automatically, we'd would need to open many pages, and we'd need to figure out what browser to use, etc. When the user picks whether to open the file, this leads to a nicer user experience. Man pages are separated by an empty line from preceding in and following output. In my testing, this makes the output easier to read. A bit of explicit flushing is needed to make sure that various outputs are not interleaved. Fixes https://github.com/systemd/systemd/issues/29061.
* | meson: do not explicitly specify ownership of /var/log/journal/Zbigniew Jędrzejewski-Szmek2023-09-212-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 9289e093ae6fd5484f9119e1ee07d1dffe37cd10 we started using install_emptydir(). When running unprivileged, 'DESTDIR=… meson install -C build --quiet --no-rebuild' would emit two warnings: '…/var/log/journal': Unable to set owner 'root' and group 'root': Operation not permitted, ignoring... '…/var/log/journal/remote': Unable to set owner 'root' and group 'root': Operation not permitted, ignoring... Those were the only two install_emptydir()s that specified ownership. Let's drop the user/group specification to get rid of the warning. When installing as root, we will create a root-owned directory anyway. When not running as root, we cannot create a root-owned directory. So this specification only makes a difference if we are running as root, and the directory already existed, and was not owned by root. In that case, I think it's actually better to leave the existing modification in place. (E.g. maybe the admin chgrp'ed the ownership for whatever reason. We might just as well leave that in place.)
* | Merge pull request #29253 from yuwata/sd-radv-use-usec_tLuca Boccassi2023-09-215-59/+124
|\ \ | | | | | | sd-radv: use usec_t
| * | test-ndisc-ra: add tests for recently added functionsYu Watanabe2023-09-201-2/+66
| | |