summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #28428 from ldv-alt/ERRNO_ISLuca Boccassi2023-07-3018-151/+189
|\ | | | | treewide: cleanup use of ERRNO_IS_*(r)
| * nspawn,shared: cleanup use of ERRNO_IS_SECCOMP_FATAL()Dmitry V. Levin2023-07-283-48/+64
| | | | | | | | | | | | | | | | | | | | | | | | Given that ERRNO_IS_SECCOMP_FATAL() also matches positive values, make sure this macro is not called with arguments that do not have errno semantics. In this case the arguments passed to ERRNO_IS_SECCOMP_FATAL() are the values returned by external libseccomp function seccomp_load() which is not expected to return any positive values, but let's be consistent anyway and move ERRNO_IS_SECCOMP_FATAL() invocations to the branches where the return values are known to be negative.
| * homework: cleanup use of ERRNO_IS_DEVICE_ABSENT()Dmitry V. Levin2023-07-281-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Given that ERRNO_IS_DEVICE_ABSENT() also matches positive values, make sure this macro is not called with arguments that do not have errno semantics. In this case the arguments passed to ERRNO_IS_DEVICE_ABSENT() are the values returned by external cryptsetup functions sym_crypt_init_by_name() and sym_crypt_deactivate_by_name() which are not expected to return any positive values, but let's be consistent anyway and move ERRNO_IS_DEVICE_ABSENT() invocations to the branches where the return values are known to be negative.
| * test: cleanup use of ERRNO_IS_PRIVILEGE()Dmitry V. Levin2023-07-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Given that ERRNO_IS_PRIVILEGE() also matches positive values, make sure this macro is not called with arguments that do not have errno semantics. In this case the arguments passed to ERRNO_IS_PRIVILEGE() are the values returned by procfs_get_pid_max() and procfs_get_threads_max() which are not expected to return any positive values, but let's be consistent anyway and move ERRNO_IS_PRIVILEGE() invocations to the branches where the return values are known to be negative.
| * userdb: cleanup use of ERRNO_IS_PRIVILEGE()Dmitry V. Levin2023-07-281-14/+16
| | | | | | | | | | | | | | | | | | | | | | Given that ERRNO_IS_PRIVILEGE() also matches positive values, make sure this macro is not called with arguments that do not have errno semantics. In this case the argument passed to ERRNO_IS_PRIVILEGE() is the value returned by json_parse_file() which is not expected to return any positive values, but let's be consistent anyway and move the ERRNO_IS_PRIVILEGE() invocation to the branch where the return value is known to be negative.
| * coredumpctl: cleanup use of ERRNO_IS_PRIVILEGE()Dmitry V. Levin2023-07-281-7/+8
| | | | | | | | | | | | | | | | | | | | | | Given that ERRNO_IS_PRIVILEGE() also matches positive values, make sure this macro is not called with arguments that do not have errno semantics. In this case the argument passed to ERRNO_IS_PRIVILEGE() is the value returned by access_fd() which is not expected to return any positive values, but let's be consistent anyway and move the ERRNO_IS_PRIVILEGE() invocation to the branch where the return value is known to be negative.
| * execute: cleanup use of ERRNO_IS_PRIVILEGE()Dmitry V. Levin2023-07-281-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | Given that ERRNO_IS_PRIVILEGE() also matches positive values, make sure this macro is not called with arguments that do not have errno semantics. In this case the arguments passed to ERRNO_IS_PRIVILEGE() are the values returned by set_oom_score_adjust() and set_coredump_filter() which are not expected to return any positive values, but let's be consistent anyway and move the ERRNO_IS_PRIVILEGE() invocations to the branches where the return values are known to be negative.
| * btrfs-util,tmpfiles: cleanup use of ERRNO_IS_NOT_SUPPORTED()Dmitry V. Levin2023-07-282-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | Given that ERRNO_IS_NOT_SUPPORTED() also matches positive values, make sure this macro is not called with arguments that do not have errno semantics. In this case the arguments passed to ERRNO_IS_NOT_SUPPORTED() are the values returned by btrfs_subvol_make_fd() which is not expected to return any positive values, but let's be consistent anyway and move ERRNO_IS_NOT_SUPPORTED() invocations to the branches where the return values are known to be negative.
| * repart: cleanup use of ERRNO_IS_NOT_SUPPORTED()Dmitry V. Levin2023-07-281-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | Given that ERRNO_IS_NOT_SUPPORTED() also matches positive values, make sure this macro is not called with arguments that do not have errno semantics. In this case the arguments passed to ERRNO_IS_NOT_SUPPORTED() are the values returned by efi_get_variable_string() and efi_set_variable() which are not expected to return any positive values, but let's be consistent anyway and move ERRNO_IS_NOT_SUPPORTED() invocations to the branches where the return values are known to be negative.
| * nspawn: cleanup use of ERRNO_IS_NOT_SUPPORTED()Dmitry V. Levin2023-07-281-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | Given that ERRNO_IS_NOT_SUPPORTED() also matches positive values, make sure this macro is not called with arguments that do not have errno semantics. In this case the argument passed to ERRNO_IS_NOT_SUPPORTED() is the value returned by remount_idmap() which is not expected to return any positive values, but let's be consistent anyway and move the ERRNO_IS_NOT_SUPPORTED() invocation to the branch where the return value is known to be negative.
| * logind: cleanup use of ERRNO_IS_NOT_SUPPORTED()Dmitry V. Levin2023-07-281-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | Given that ERRNO_IS_NOT_SUPPORTED() also matches positive values, make sure this macro is not called with arguments that do not have errno semantics. In this case the argument passed to ERRNO_IS_NOT_SUPPORTED() is the value returned by efi_loader_get_entries() which is not expected to return any positive values, but let's be consistent anyway and move the ERRNO_IS_NOT_SUPPORTED() invocation to the branch where the return value is known to be negative.
| * homework: cleanup use of ERRNO_IS_NOT_SUPPORTED()Dmitry V. Levin2023-07-281-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Given that ERRNO_IS_NOT_SUPPORTED() also matches positive values, make sure this macro is not called with arguments that do not have errno semantics. In this case the argument passed to ERRNO_IS_NOT_SUPPORTED() is the value returned by home_update_quota_auto() which is not expected to return any positive values, but let's be consistent anyway and move the ERRNO_IS_NOT_SUPPORTED() invocation to the branch where the return value is known to be negative.
| * cryptsetup: cleanup use of ERRNO_IS_NOT_SUPPORTED()Dmitry V. Levin2023-07-281-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Given that ERRNO_IS_NOT_SUPPORTED() also matches positive values, make sure this macro is not called with arguments that do not have errno semantics. In this case the argument passed to ERRNO_IS_NOT_SUPPORTED() is the value returned by find_tpm2_auto_data() which is not expected to return any positive values, but let's be consistent anyway and move the ERRNO_IS_NOT_SUPPORTED() invocation to the branch where the return value is known to be negative.
| * bootctl: cleanup use of ERRNO_IS_NOT_SUPPORTED()Dmitry V. Levin2023-07-281-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | Given that ERRNO_IS_NOT_SUPPORTED() also matches positive values, make sure this macro is not called with arguments that do not have errno semantics. In this case the argument passed to ERRNO_IS_NOT_SUPPORTED() is the value returned by efi_loader_get_entries() which is not expected to return any positive values, but let's be consistent anyway and move the ERRNO_IS_NOT_SUPPORTED() invocation to the branch where the return value is known to be negative.
| * varlink: cleanup use of ERRNO_IS_DISCONNECT()Dmitry V. Levin2023-07-281-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | Given that ERRNO_IS_DISCONNECT() also matches positive values, make sure this macro is not called with arguments that do not have errno semantics. In this case the argument passed to ERRNO_IS_DISCONNECT() is the value returned by varlink_connect_address() which is not expected to return any positive values, but let's be consistent anyway and move the ERRNO_IS_DISCONNECT() invocation to the branch where the return value is known to be negative.
| * resolved: cleanup use of ERRNO_IS_DISCONNECT()Dmitry V. Levin2023-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Given that ERRNO_IS_DISCONNECT() also matches positive values, make sure this macro is not called with arguments that do not have errno semantics. In this case the argument passed to ERRNO_IS_DISCONNECT() is the value returned by dns_transaction_emit_tcp() and dns_transaction_emit_udp() which are not expected to return any positive values, but let's be consistent anyway and move the ERRNO_IS_DISCONNECT() invocation to the branch where the return value is known to be negative.
| * socket: cleanup use of ERRNO_IS_DISCONNECT()Dmitry V. Levin2023-07-281-13/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Given that ERRNO_IS_DISCONNECT() also matches positive values, make sure this macro is not called with arguments that do not have errno semantics. In this case the arguments passed to ERRNO_IS_DISCONNECT() are the values returned by instance_from_socket(), socket_load_service_unit(), and service_set_socket_fd() which are not expected to return any positive values, but let's be consistent anyway and move ERRNO_IS_DISCONNECT() invocations to the branches where the return values are known to be negative.
* | network: ndisc - Honour CurHopLimitSusant Sahani2023-07-307-0/+28
| | | | | | | | | | | | | | | | | | | | | | RFC4861 Neighbor Discovery – Sections 4.2 and 6.3.4 From section 4.2. Router Advertisement Message Format: Cur Hop Limit 8-bit unsigned integer. The default value that should be placed in the Hop Count field of the IP header for outgoing IP packets. A value of zero means unspecified (by this router).
* | network/address: merge address_needs_to_set_broadcast() with ↵Yu Watanabe2023-07-302-20/+38
| | | | | | | | | | | | address_get_broadcast() No functional change, preparation for later commits.
* | Merge pull request #28574 from yuwata/network-queue-nextLuca Boccassi2023-07-303-7/+28
|\ \ | | | | | | network/queue: preparations
| * | network/queue: detach request from queue when netlink reply receivedYu Watanabe2023-07-292-4/+22
| | | | | | | | | | | | | | | | | | | | | Then, we can find and use the Request object after sending netlink message. Preparation for later commits.
| * | network/queue: free assigned userdata only when a new request is queuedYu Watanabe2023-07-292-3/+6
| | |
* | | Merge pull request #28571 from yuwata/network-address-next-part1Luca Boccassi2023-07-3012-44/+43
|\ \ \ | | | | | | | | network: several trivial cleanups
| * | | network/address: split-out address_match_null()Yu Watanabe2023-07-291-11/+22
| | | | | | | | | | | | | | | | No functional change, preparation for later commits.
| * | | network: drop unnecessary conditionsYu Watanabe2023-07-294-5/+5
| | | | | | | | | | | | | | | | When link_get_by_index() succeeds, the result is always non-NULL.
| * | | network: use address_remove_and_drop()Yu Watanabe2023-07-293-9/+3
| | | |
| * | | network/address: free Address object by caller that passed to ↵Yu Watanabe2023-07-299-19/+13
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | link_request_address() Follow-up for 9684a8ded083dd427f843b0c40aa0292e6c7ae06. Now, the input Address object is always copied, hence it is not necessary to free it in link_request_address().
* | | network/neighbor: drop IPv6 settings when the kernel does not support IPv6Yu Watanabe2023-07-301-0/+7
| | |
* | | network: rename sd_netlink_message* req -> mYu Watanabe2023-07-302-27/+17
| | | | | | | | | | | | This also merges neighbor_configure_message() with neighbor_configure().
* | | Merge pull request #28564 from YHNdnzj/gpt-auto-kill-more-duplicateYu Watanabe2023-07-303-21/+22
|\ \ \ | | | | | | | | gpt-auto: don't mount ESP if there's an fstab entry for it
| * | | gpt-auto: don't mount ESP if there's an fstab entry for itMike Yuan2023-07-291-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | Follow-up for #28511 Fixes #28550
| * | | fstab-util: add fstab_has_nodeMike Yuan2023-07-292-9/+13
| | | |
* | | | meson: use kwargs to declare efi binariesYu Watanabe2023-07-301-29/+18
| | | | | | | | | | | | | | | | No functional change, just refactoring.
* | | | analyze: fix pcrs verb output without TPM supportFrantisek Sumsal2023-07-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we don't have TPM support then `alg` is NULL and passing this to table_new() means we'd get a table with only two columns instead of three, leading up to a very confusing output: $ build/systemd-analyze pcrs System lacks full TPM2 support, not showing PCR state. NR NAME 0 platform-code - 1 platform-config - 2 external-code - 3 external-config - 4 boot-loader-code - 5 boot-loader-config - 6 - - 7 ... Let's name the header in this case with a simple dash, as it's going to be hidden anyway, to make the table nice again: $ build/systemd-analyze pcrs System lacks full TPM2 support, not showing PCR state. NR NAME 0 platform-code 1 platform-config 2 external-code 3 external-config 4 boot-loader-code 5 boot-loader-config 6 - 7 secure-boot-policy ...
* | | | tree-wide: fix typoYu Watanabe2023-07-292-2/+2
| |/ / |/| |
* | | Merge pull request #28562 from yuwata/ukify-option-lengthYu Watanabe2023-07-292-1/+6
|\ \ \ | | | | | | | | ukify: check option length
| * | | test-ukify: add tests for an empty argumentYu Watanabe2023-07-291-0/+5
| | | |
| * | | ukify: check option lengthYu Watanabe2023-07-291-1/+1
| | | | | | | | | | | | | | | | Follow-up for df4a46733a609f1673de0bebb38e89fffd70c16c.
* | | | Merge pull request #28563 from keszybz/configure-mesonYu Watanabe2023-07-292-1/+6
|\ \ \ \ | |_|/ / |/| | | configure: update meson invocation
| * | | labeller: add build-system labelZbigniew Jędrzejewski-Szmek2023-07-291-0/+5
| | | |
| * | | configure: update meson invocationZbigniew Jędrzejewski-Szmek2023-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | New meson says: WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated. Inspired by https://github.com/systemd/systemd/issues/28482.
* | | | Merge pull request #28557 from bluca/utilsLuca Boccassi2023-07-295-3/+223
|\ \ \ \ | | | | | | | | | | utils: add serialize_bool_elide() and send/receive helpers for FD array
| * | | | serialize: add serialize_bool_elide() helperLuca Boccassi2023-07-292-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In many case we serialize into objects that have been zero-initialized. To save some time and resources when there are a lot of booleans, add a helper that serializes only when the boolean is true.
| * | | | socket-util: add send/receive helpers for FD arrayLuca Boccassi2023-07-293-0/+213
| |/ / /
* | | | Merge pull request #28508 from yuwata/network-next-dhcp4Luca Boccassi2023-07-296-214/+351
|\ \ \ \ | | | | | | | | | | network: several cleanups and fixes for DHCPv4 client
| * | | | network/dhcp4: drop unused logic of finding default gatewayYu Watanabe2023-07-271-83/+21
| | | | |
| * | | | network/dhcp4: always honor specified gateway addressYu Watanabe2023-07-272-32/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow-up for 77451f654a89d822cd288883edfac315949d1cb6. Now, gateway for routes to DNS or NTP servers should be correctly picked, hence it is not necessary to adjust the gateway address in dhcp4_request_route_auto() again. Also, similar for classless static routes, let's always honor gateway address specified in (non-classless) static routes.
| * | | | network/dhcp4: always find suitable gateway for destination addressYu Watanabe2023-07-272-23/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And if not found, refuse to configure the route. If a DHCP server provides classless static or static routes, then we should use the gateway for accessing a node in the range specified in the route. E.g. if a DHCP server provides the default gateway is 192.168.0.1, and classless static route for 8.0.0.0/8 with gateway 192.168.0.2, then we should access 8.8.8.8 through 192.168.0.2 rather than 192.168.0.1, but should use 192.168.0.1 for 9.9.9.9. Fixes #28358.
| * | | | network/dhcp4: introduce dhcp4_prefix_covers() helper functionYu Watanabe2023-07-271-7/+27
| | | | | | | | | | | | | | | | | | | | No functional change, just refactoring.
| * | | | network/dhcp4: introduce dhcp4_get_router() helper functionYu Watanabe2023-07-271-13/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we use the first router address, and if it is null, we ignore the address. Now, we use the first non-null address. That is, if the first router address is null, but the second is not, then we use the second one. That should not cause functional change in most cases, except for the case when a DHCP server provides such spurious reply. This is mostly for refactoring and preparation for later commits.