Commit graph

70485 commits

Author SHA1 Message Date
Yu Watanabe 2db2979505 sd-network: modernize parse_operational_state_range()
- rename 'out' -> 'ret',
- introduce LINK_OPERSTATE_RANGE_INVALID,
- constify LINK_OPERSTATE_RANGE_DEFAULT,
- drop spurious const specifier for allocated string,
- etc,.
2024-01-17 04:05:43 +09:00
Yu Watanabe 15f624f80f sd-network: introduce three helper functions for LinkOperationalState 2024-01-17 04:05:43 +09:00
A S Alam 04ba20a80a po: Translated using Weblate (Punjabi)
Currently translated at 32.1% (73 of 227 strings)

Co-authored-by: A S Alam <aalam@users.noreply.translate.fedoraproject.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/pa/
Translation: systemd/main
2024-01-16 19:54:17 +01:00
Ronan Pigott a9766d07b8 test-resolve: add basic test for SVCB/HTTPS RRs 2024-01-16 11:26:37 -07:00
Ronan Pigott 9c331dc3c8 resolvectl: add SVCB and HTTPS json format 2024-01-16 11:26:37 -07:00
Ronan Pigott f0d261a714 resolvectl: implement SVCB and HTTPS presentation format 2024-01-16 11:26:37 -07:00
Lennart Poettering b9b426b5b2
Merge pull request #30944 from CodethinkLabs/vmspawn/fix_fedora_issues
vmspawn: fix more issues
2024-01-16 18:57:56 +01:00
Ronan Pigott b699f5f2cd escape: introduce decescape
This 3-digit decimal escape style is useful when presenting DNS RR
information in zone-file presentation format.
2024-01-16 10:49:26 -07:00
Ronan Pigott e7634d6b05 resolved: enable RFC9460 SVCB and HTTPS records 2024-01-16 10:49:26 -07:00
Ronan Pigott ee9581e5e9 dns: add svcparam iana enum constants 2024-01-16 10:49:26 -07:00
Lennart Poettering 85978d296c varlink: restore debug output on incoming messages
Now that we can selectively suppress only sensitive fields in JSON
objects we can reenable debug logging for incoming messages, which was
removed in 2e3414660c.

This makes Varlink fully debuggable again: we'll see both incoming and
outgoing messages, only the sensitive fields are suppressed.

See: #30578
2024-01-16 17:17:19 +01:00
Lennart Poettering 9912897170 json: replace JSON_FORMAT_REFUSE_SENSITIVE with JSON_FORMAT_CENSOR_SENSITIVE
Previously, the flag would completely refuse formatting a JSON object if
any field of it was marked sensitive. With this change we'll simply
replace the subobject with the string "<sensitive data>", and show
everything else.

This is tremendously useful when debugging, since it means that we can
again trace varlink calls through the stack: we can show all the message
metadata and just suppress the actually sensitive parameters.

The ability to debug this matters, and we should not hide more
information that we can get away with, to keep things debuggable and
maintainable.
2024-01-16 17:17:19 +01:00
Lennart Poettering c609338b1d json: export json_variant_is_sensitive_recursive()
Let's export this function, so that we can use it elsewhere. Also, while
at it, let's cache the result in a flag. This is only safe if the result
is positive, since we allow the flag to be enabled at any time down thre
tree somewhere, which we need to look at. (We never allow it to be
turned off however)
2024-01-16 17:16:18 +01:00
Lennart Poettering a570877c12 varlink: optionally, mark all incoming message's "parameters" field as sensitive
So far the varlink logic honoured the "sensitive" flag of output
messages. Let's add something similar for input messages. Since we don't
really know incoming messages, the flag simply controls whether the
"parmaeters" field of all incoming messages should be marked as
sensitive.

Then, turn this on in the credentials logic and in homed, since both
deal with credentials.
2024-01-16 17:14:20 +01:00
Yu Watanabe 47420573a7 network/route: find/distinguish routes in the same way that the kernel uses
The kernel uses different logics to find or distinguish IPv4 and IPv6 routes.
Let's follow the same way that the kernel uses.
See comments in the code for more details.
2024-01-16 16:13:53 +00:00
Mike Yuan 50d5f64632 labeler: add bsod, hibernate-resume, nspawn and vmspawn 2024-01-16 16:13:26 +00:00
Lennart Poettering 598ef6e0e0
Merge pull request #30960 from poettering/get-user-creds-modernization
user-util: modernize get_user_creds() + get_group_creds()
2024-01-16 17:12:00 +01:00
Mike Yuan ff841d9877 logind: allow Sleep() and CanSleep() dbus calls
Follow-up for cd4dd90b99
2024-01-16 15:25:43 +00:00
Luca Boccassi 97cc54bffd
Merge pull request #30963 from poettering/creds-tweaks
two minor creds-util.c simplifications
2024-01-16 15:25:08 +00:00
Luca Boccassi 50f89c7d6d
Merge pull request #30961 from poettering/varlink-bus-polkit-fixes
varlink polkit client fixes
2024-01-16 15:24:22 +00:00
Luca Boccassi d62080e078
Merge pull request #30959 from poettering/varlink-debug-better
varlink tweaks for making debugging easier
2024-01-16 15:18:36 +00:00
Yu Watanabe b9b5096edb network/queue: detach request from the queue only when the request is actually queued
No effective functionality is changed in this commit.
Refactoring and preparation for later commits.
2024-01-16 23:25:32 +09:00
Yu Watanabe e30dc59c2e network/queue: increase the reference counter of the request before processing it
To prevent the request freed in req->process().

This also makes a request that is not requested by a link detached on failure.
Otherwise, the request may periodically processed and failed forever.
2024-01-16 23:25:32 +09:00
Lennart Poettering e9c974fd42 user-util: honour PREFER_NSS flag in get_group_creds() the same way as we already do in get_user_creds()
let's onour the PREFER_NSS flag also in get_group_creds() the same
way we honour it in get_user_creds().

Simply to remove surprises.
2024-01-16 14:56:25 +01:00
Lennart Poettering 83e9b584db user-util: modernize get_user_creds() + get_group_creds()
Let's rename return parameters to ret_xyz, and let's guarantee the usual
rule to initialize all return parameters on success, and not touch any
on failure.
2024-01-16 14:55:45 +01:00
Lennart Poettering a9e4057f1f creds-util: drop unnecessary include
Follow-up for: e653a194e4
2024-01-16 14:16:42 +01:00
Lennart Poettering cdbcb1fe6e creds-util: simplify offset calculation a bit
Don't recalculate the overall offset entirely each time we process
another header. Instead, if we already validated an earlier offset, just
reuse the result, it's readily available in 'p'.

No change in behaviour, just a bit of code simplification.
2024-01-16 14:16:18 +01:00
Lennart Poettering e96202fa5d bus-polkit: don't return positive in varlink_verify_polkit_async() just because we already sent an error reply
A positive return value means "access granted", hence if we already
reply to the method call don't accidentally return positive.

Follow-up for: d04c1a1c8e
2024-01-16 13:59:49 +01:00
Lennart Poettering 0ca9a44799 bus-polkit: explicitly cast away return value we ignore 2024-01-16 13:59:49 +01:00
Lennart Poettering 956d8aee01 bus-polkit: treat various well-known PK errors as denied
Various recognizable errors from

https://www.freedesktop.org/software/polkit/docs/latest/eggdbus-interface-org.freedesktop.PolicyKit1.Authority.html#eggdbus-errordomain-org.freedesktop.PolicyKit1.Error.

should be considered access failures, hence treat them like that.
2024-01-16 13:59:49 +01:00
Lennart Poettering 4a6fe5f05e varlink: also honour new env var $SYSTEMD_VARLINK_LISTEN in varlink_server_listen_auto()
varlink_server_listen_auto() is supposed to be the one-stop solution for
turning simple command line tools into IPC services. They aren't easy to
test/debug however, since you have to invoke them through a service
manager.

Let's make this easier: if the SYSTEMD_VARLINK_LISTEN env var is set,
let's listen on the socket specified therein. This makes things easier
to gdb: just run the service from the cmdline.
2024-01-16 13:45:35 +01:00
Lennart Poettering 1752a8ee33 varlink-idl: prefix all varlink IDL debug lines wit "Varlink-IDL:"
Let's improve debuggability of varlink IPC transactions, and separate
out log messages triggered by the IPC info from others, by prefixing
them with a specific prefix.
2024-01-16 13:44:21 +01:00
Luca Boccassi c5ff54c40f
Merge pull request #30953 from yuwata/network-nexthop-silently-removed-by-kernel
network/nexthop: forget nexthops silently removed by kernel
2024-01-16 12:39:46 +00:00
Yu Watanabe 3518ff4a42 network/route: introduce route_get_link() and use it in log_route_debug()
No functional change, just refactoring and preparation for later
commits.
2024-01-16 12:35:58 +00:00
Sam Leonard 773ca1def8
vmspawn: supply a serial TTY to the kernel by default 2024-01-16 10:08:35 +00:00
Sam Leonard 0f2b492f51
vmspawn: ignore firmwares with enrolled-keys by default 2024-01-16 10:08:34 +00:00
我超厉害 8a86e15f07
udev: even if a device is a zac device, scsi-$ID_SERIAL will be reserved for it (#30459)
Co-authored-by: wangyuhang <wangyuhang27@huawei.com>
2024-01-16 14:57:07 +09:00
Yu Watanabe f8a6fc51a6
Merge pull request #30851 from lnussel/kernel-install
kernel-install fixes
2024-01-16 14:55:35 +09:00
Daan De Meyer 16e4efa7d3 tree-wide: Load entry-token and layout.conf from /usr/lib/kernel/ as well 2024-01-16 14:54:04 +09:00
Yu Watanabe f9b5c27645 test-network: add test case for removal of nexthop that is a member of a group nexthop 2024-01-16 12:48:50 +09:00
Yu Watanabe 3cbbe8635a network/nexthop: drop dependent nexthops on removal
If a nexthop is removed, dependent nexthops are silently removed by the
kernel. Hence, networkd may be confused that nexthops that depends on the
nexthop still exist, and may fail to configure other routes or so.
2024-01-16 12:48:50 +09:00
Yu Watanabe 531c724682 network/nexthop: introduce a reverse map of nexthop group members
It is not used in this commit, but will be used later.
Preparation for later commits.
2024-01-16 12:48:50 +09:00
Yu Watanabe 4e9795ebfa network/nexthop: read netlink message in nexthop_update_group()
No functional change, preparation for later commits.
2024-01-16 12:48:50 +09:00
Yu Watanabe 04a25cc425 network/nexthop: reorder elements in NextHop 2024-01-16 12:48:50 +09:00
Yu Watanabe 0a94e19c72 network/route: trivial cosmetic changes
- downgrade log level,
- add short comment for boolean argument.
2024-01-16 11:45:14 +09:00
Yu Watanabe 0013863972 network/route: reorder getters in manager_rtnl_process_route()
No functional change, just refactoring and preparation for later
commits.
2024-01-16 11:02:55 +09:00
Yu Watanabe 31b26dee4f network/route: reorder setter called in route_set_netlink_message()
Also, this renames 'req' -> 'm', and makes the function unconditionally
set route type and route metric, and override type later if necessary.

Should not change any effective behavior. Just refactoring.
2024-01-16 11:02:55 +09:00
Yu Watanabe e717b825d4 network/route: reorder elements in Route object and add comments 2024-01-16 11:02:55 +09:00
Yu Watanabe 1bcd7cd0e7 network/route: relocate route_new() and friends
No functional change, preparation for later commits.
2024-01-16 11:02:55 +09:00
Frantisek Sumsal fa8ff98ea4 test: cover a couple of error scenarios
To make sure we behave correctly even in error paths.
2024-01-15 18:04:31 +01:00