Yu Watanabe [Tue, 2 Jan 2024 19:41:34 +0000 (04:41 +0900)]
network/queue: introduce RemoveRequest and relevant functions
This is similar to Request, but will be used on removing configuration
(e.g. address, route, and so on).
By using another queue for removing configuration, then we can avoid to
fill the reply callback buffer in sd-netlink by remove message calls.
Follow-up for
4e6a35e2b2fad0f167a71b63525f4210bc858bc6.
Lennart Poettering [Fri, 13 May 2022 22:04:08 +0000 (00:04 +0200)]
homed: add helpers for checking reference status of homes
Just some refactoring to make things more readable.
Lennart Poettering [Thu, 11 Jan 2024 21:44:13 +0000 (22:44 +0100)]
update TODO
Yu Watanabe [Thu, 11 Jan 2024 21:37:23 +0000 (06:37 +0900)]
Merge pull request #30867 from dtardon/udev-conf-dropins
Allow dropins for udev.conf
Yu Watanabe [Thu, 11 Jan 2024 21:36:46 +0000 (06:36 +0900)]
Merge pull request #30893 from yuwata/add-trailing-NUL
json,netlink: add trailing NUL byte when we read binary data
Lennart Poettering [Thu, 11 Jan 2024 20:31:28 +0000 (21:31 +0100)]
Merge pull request #30777 from poettering/ssh-generator
ssh-generator which makes VMs and containers accessible to ssh via AF_UNIX and AF_VSOCK
Lennart Poettering [Thu, 11 Jan 2024 20:20:01 +0000 (21:20 +0100)]
Merge pull request #30884 from poettering/logind-background-light
logind: add "background-light" + "manager" session classes
David Tardon [Fri, 5 Jan 2024 15:10:50 +0000 (16:10 +0100)]
test: use dropin dir
David Tardon [Wed, 10 Jan 2024 14:54:28 +0000 (15:54 +0100)]
man: update udev.conf man page
David Tardon [Fri, 5 Jan 2024 15:11:24 +0000 (16:11 +0100)]
udev: factor out config parser call into function
... which is then called from both places. This makes sure that the
configuration is parsed by udevd and other tools in exactly the same
way.
David Tardon [Fri, 5 Jan 2024 14:48:31 +0000 (15:48 +0100)]
udev-util: drop unused function
David Tardon [Fri, 5 Jan 2024 14:45:04 +0000 (15:45 +0100)]
udev-util: use config. parser to parse udev.conf
David Tardon [Fri, 5 Jan 2024 14:31:24 +0000 (15:31 +0100)]
udevd: use config. parser to parse udev.conf
This adds support for the usual config. file hierarchy (including
dropins).
Fixes #30460.
Yu Watanabe [Thu, 11 Jan 2024 19:48:23 +0000 (04:48 +0900)]
sd-netlink: add trailing NUL byte for safety in sd_netlink_message_read_data()
Then, drop sd_netlink_message_read_data_suffix0().
Yu Watanabe [Thu, 11 Jan 2024 19:44:48 +0000 (04:44 +0900)]
json: add trailing NUL byte in json_dispatch_byte_array_iovec()
For safety.
Addresses https://github.com/systemd/systemd/pull/30879#discussion_r1448518226.
Frantisek Sumsal [Thu, 11 Jan 2024 13:37:29 +0000 (14:37 +0100)]
test: use correct type for the root partition
Yu Watanabe [Thu, 11 Jan 2024 18:46:48 +0000 (03:46 +0900)]
Merge pull request #30887 from poettering/id128-no-legend
id128: add --no-pager, --no-legend, --json=/-j switches to systemd-id128 tool
Frantisek Sumsal [Thu, 11 Jan 2024 17:26:12 +0000 (18:26 +0100)]
shell-completion: add new systemd-id128 options
Lennart Poettering [Thu, 11 Jan 2024 16:20:38 +0000 (17:20 +0100)]
logind: also restrict on which session classes one cange the session type
Lennart Poettering [Thu, 11 Jan 2024 16:14:48 +0000 (17:14 +0100)]
logind: allow taking control of devices only in some session types
Let's restrict the logic a bit, so that "manage" session types are not
misused.
Lennart Poettering [Thu, 11 Jan 2024 15:35:18 +0000 (16:35 +0100)]
id128: add --no-pager, --no-legend, --json=/-j switches to systemd-id128 tool
Lennart Poettering [Wed, 29 Nov 2023 11:19:53 +0000 (12:19 +0100)]
man: document the expanded catalogue of session classes
Lennart Poettering [Wed, 29 Nov 2023 11:57:16 +0000 (12:57 +0100)]
test: add integration test for new 'background-light' session class
Lennart Poettering [Thu, 4 Jan 2024 12:40:00 +0000 (13:40 +0100)]
logind: tighten for which classes of sessions we do stop-on-idle
We only want to do this for fully set up, interactive sessions, i.e.
user and user-early, but not for any others, hence restrict the rules a
bit.
Follow-up for:
508b4786e8592e82eb4832549f74aaa54335d14c
Lennart Poettering [Wed, 29 Nov 2023 10:24:10 +0000 (11:24 +0100)]
logind: rework GC logic
In logind we generally want to stop user@.service for a user once they
log out. So the usual rule is that whenever a User object is around that
has no pinning sessions we should close it.
Except that it isn't that easy. We allow that user@.service is also
manually started, in which case the User object is created but not
pinned by any session.
Let's rework how this is handled: we define two different GC modes. In
one GC mode we'll keep the User object around whenever *any* session
exists (thus: including the user@.service session), and one where we
only keep it around whenever a *pinning* session exists (i.e. when a
user actually logs in, but the user@.service session doesn't count like
that).
And the trick is now that we start out in the *any* GC mode, and switch
to the *pinning* GC mode once the first user session logs in.
This should make things more robust as we know exactly in which state we
are and when to GC a user.
Lennart Poettering [Wed, 29 Nov 2023 10:18:01 +0000 (11:18 +0100)]
logind: rework logic to decide whether lock + idle + display applies to a session
Let's streamline the logic that decides whether the screen lock, idle
timeout or display election mechanism applies to a session class. Let's
add explicitly SESSION_CLASS_IS_XYZ() macros for each, and then resue
them at all suitable places, and refuse any attempts to use the
functionality on the wrong clases with a friendly error message.
Lennart Poettering [Mon, 27 Nov 2023 17:39:02 +0000 (18:39 +0100)]
logind: add "background-light" session class
This is the same as the "background" class, but does *not* pull in a
service manager. It might be useful for things like select cron jobs
that do not intend to call per-user IPC calls.
Replaces: #23569
Fixes: #23978
Lennart Poettering [Mon, 27 Nov 2023 16:31:50 +0000 (17:31 +0100)]
pam_systemd: register systemd user service manager as class='manager'
Now that we have thew new class, start making us of it in pam_systemd.so
when running for user@.service.
Lennart Poettering [Mon, 27 Nov 2023 17:35:32 +0000 (18:35 +0100)]
logind: track user service managers as 'manager' session class
Previously, all user code was part of a session except for the code run
as part of user@.service, which wasn't. This tries to make this more
uniform: we'll track the user@.service runtime also as a session, but of
the special type "manager".
This means we have a really good overview finally of all user code that
is running and can make decisions on what to start when and how long to
keep it around. The pam_systemd client side will now be reasonably
uniform: it just calls the CreateSession() bus call with the right
class, and we'll return any data it needs. This means the weird
"side-channel" we previously used to initialize XDG_RUNTIME_DIR for the
user@.service goes away (see next commit).
This conditionalizes various behaviours now cleanly depending on the
session class:
1. SESSION_CLASS_WANTS_SCOPE() will be true for all classes except for
the manager class. It declares whther the client shall be migrated
into their own scope, which we generally want for sessions but not
for the manager, since it already has its own service unit.
2. SESSION_CLASS_WANTS_SERVICE_MANAGER() will be true for all classes
except for the manager class. It declares whether we shall start the
service manager if a session of this class is around. Of course, this
is off for the service manager, since this would always pin itself.
3. SESSION_CLASS_PIN_USER() will be true for all classes except for the
manager class. It declares whether the we shall keep the User
structure around for a user as long as the session is around.
Now you might wonder why have these as three functions, even though they
mostly give the same answers?
That's because this all is preparation to add further session classes
later that will return different answers for the three calls. (For
example, a later patch adds "background-light" which will return true
for SESSION_CLASS_WANTS_SCOPE() and SESSION_CLASS_PIN_USER(), but false
for SESSION_CLASS_WANTS_SERVICE_MANAGER(). i.e. it will get a scope, and
pin user tracking, but not start a service manager.
Lennart Poettering [Fri, 5 Jan 2024 13:52:35 +0000 (14:52 +0100)]
update TODO
Lennart Poettering [Wed, 10 Jan 2024 10:28:23 +0000 (11:28 +0100)]
test: add testcase for ssh generator
Lennart Poettering [Fri, 5 Jan 2024 17:34:01 +0000 (18:34 +0100)]
doc: document new /run/host/ inodes in container interface doc
Lennart Poettering [Fri, 5 Jan 2024 15:43:41 +0000 (16:43 +0100)]
nspawn: expose a dir in the container where it can bind AF_UNIX sockets that will appear on the host
Lennart Poettering [Thu, 4 Jan 2024 22:31:51 +0000 (23:31 +0100)]
ssh-proxy: add ssh ProxyCommand tool that can connect to AF_UNIX + AF_VSOCK sockets
This adds a tiny binary that is hooked into SSH client config via
ProxyCommand and which simply connects to an AF_UNIX or AF_VSOCK socket
of choice.
The syntax is as simple as this:
ssh unix/some/path # (this connects to AF_UNIX socket /some/path)
or:
ssh vsock/4711
I used "/" as separator of the protocol ID and the value since ":" is
already taken by SSH itself when doing sftp. And "@" is already taken
for separating the user name.
Lennart Poettering [Thu, 4 Jan 2024 17:39:03 +0000 (18:39 +0100)]
ssh-generator: add simple new generator
Lennart Poettering [Fri, 5 Jan 2024 15:32:43 +0000 (16:32 +0100)]
iovec-util: add helper for a single NUL byte iovec
Lennart Poettering [Thu, 4 Jan 2024 17:38:50 +0000 (18:38 +0100)]
install: optionally return discovered unit file path in unit_file_exists()
Lennart Poettering [Thu, 4 Jan 2024 17:38:28 +0000 (18:38 +0100)]
generator: teach generator_add_symlink_full() to optionally make alias symlinks rather than just .wants/ style symlinks
Lennart Poettering [Thu, 4 Jan 2024 17:37:38 +0000 (18:37 +0100)]
generator: optionally return resulting unit file path in generator_open_unit_file_full()
This is useful if we want to make symlinks to it later.
Lennart Poettering [Mon, 27 Nov 2023 15:26:18 +0000 (16:26 +0100)]
mkosi: also add ssh client, to make it easier to test ssh logins via AF_UNIX/AF_VSOCK
Yu Watanabe [Thu, 11 Jan 2024 06:01:35 +0000 (15:01 +0900)]
network: fix Name= -> OriginalName= in the default .link files
Follow-up for
658169e6d307b5b1aea0d82b4a6430fa9d529c68.
Lennart Poettering [Thu, 11 Jan 2024 08:46:05 +0000 (09:46 +0100)]
man: fix references to systemd.exec(5)
For some reason the section for the systemd.exec man page was added
incorrectly and then copypasted everywhere else incorrectly too. Let's
fix that.
Antonio Alvarez Feijoo [Thu, 11 Jan 2024 10:00:37 +0000 (11:00 +0100)]
analyze: clarify that `security --offline=true` requires an argument
Without `--root` or `--image`, the `security` command inspects all currently
loaded service units if no unit name is specified. But with `--root` or
`--image` with `--offline=true`, the `security` command exits silently if no
unit name is specified.
Also, fixed description of `--root` and `--image` in the man page, and added
missing `--unit` option to help text.
Frantisek Sumsal [Thu, 11 Jan 2024 10:02:05 +0000 (11:02 +0100)]
test: fix dbus installation on Arch
Arch finally made dbus-broker the default dbus daemon [0], but unlike
Fedora they don't use Alias=dbus.service to make the dbus.symlink under
/etc, instead they create the symlink manually under /usr/lib, so let's
account for that.
[0] https://gitlab.archlinux.org/archlinux/packaging/packages/dbus-broker/-/commit/
b24d15795addeb15f9532f28deae9475fad8b9fa
Antonio Alvarez Feijoo [Thu, 7 Dec 2023 07:29:40 +0000 (08:29 +0100)]
Revert "initrd-parse-etc: override argv[0] to avoid dracut issue"
This reverts commit
db5276215ae496074c163fca4014baf1bcd05984.
dracut is patched since https://github.com/dracutdevs/dracut/commit/
23684e4a,
and this commit is included in the latest dracut-059 release.
Lennart Poettering [Thu, 11 Jan 2024 09:22:31 +0000 (10:22 +0100)]
Merge pull request #30879 from yuwata/dhcp-client-id-json
dhcp: introduce json_dispatch_client_id() and friends
Yu Watanabe [Thu, 11 Jan 2024 07:55:53 +0000 (16:55 +0900)]
sd-dhcp-client-id: introduce json_dispatch_client_id()
Yu Watanabe [Tue, 2 Jan 2024 21:07:10 +0000 (06:07 +0900)]
json: introduce json_dispatch_byte_array_iovec() and json_dispatch_in_addr()
Yu Watanabe [Thu, 11 Jan 2024 07:53:42 +0000 (16:53 +0900)]
sd-dhcp-client-id/duid: do not trigger assertion when invalid size is passed
The data may be from user input or file. We usually use assertion for
programming error. Hence, using assert is not a good choise there.
Preparation for later commits.
Diego Viola [Mon, 18 Dec 2023 06:26:31 +0000 (03:26 -0300)]
test-systemctl-enable: make titles more consistent
Rose [Sun, 7 Jan 2024 19:43:43 +0000 (14:43 -0500)]
boot/efi: use Header field of hd directly instead of casting to EFI_DEVICE_PATH
The header of EFI_DEVICE_PATH is the first member of hd, which means that we can use that directly instead of casting one struct to another.
Rose [Mon, 8 Jan 2024 21:02:39 +0000 (16:02 -0500)]
tree-wide: replace string functions with fundamental functions
David Tardon [Fri, 5 Jan 2024 13:30:37 +0000 (14:30 +0100)]
conf-parser: generalize config_parse_config_file()
Lennart Poettering [Wed, 10 Jan 2024 15:18:41 +0000 (16:18 +0100)]
network: take explicit ownership of our own interfaces
This is a follow-up for #30786 and uses it to assign
ID_NET_MANAGED_BY=io.systemd.Network to all all network interfaces that
we consider ours to manage. This should hopefully have the effect that
other well-behaving managers won't fight for these devices.
This doesn't bother with network interfaces we match inside containers,
since udev is not available there anyway.
Luca Boccassi [Wed, 10 Jan 2024 19:34:48 +0000 (19:34 +0000)]
Merge pull request #30717 from yuwata/network-ref-unref
network: introduce address_ref() and friends
Luca Boccassi [Wed, 10 Jan 2024 19:33:16 +0000 (19:33 +0000)]
Merge pull request #30716 from yuwata/network-cancel-request
network: also remove configuration on cancelling request
Carlos Garnacho [Wed, 3 Jan 2024 12:51:02 +0000 (13:51 +0100)]
logind: Mark LidClosed property as "emits change"
It may be useful for DEs to follow changes on this property, esp. now that
recent UPower has removed its own lid handling code.
Related: https://gitlab.freedesktop.org/upower/upower/-/commit/
07565ef6a1aa4a115f8ce51e259e408edbaed4cc
Luca Boccassi [Wed, 10 Jan 2024 19:29:25 +0000 (19:29 +0000)]
Merge pull request #30720 from yuwata/dhcp-server-address-verification
dhcp-server: several fixlets for address verification
Luca Boccassi [Wed, 10 Jan 2024 19:27:57 +0000 (19:27 +0000)]
Merge pull request #30764 from yuwata/network-queue-fix-assertion
network/queue: exit from loop of processing request when a new request is queued
Luca Boccassi [Wed, 10 Jan 2024 19:25:52 +0000 (19:25 +0000)]
Merge pull request #30811 from yuwata/network-route-metric
network/route-metric: introduce RouteMetric to unify route metric handling
Luca Boccassi [Wed, 10 Jan 2024 19:21:55 +0000 (19:21 +0000)]
Merge pull request #30809 from yuwata/resolve-fix-EDE-handling
resolve: fix EDE handling
Holger Assmann [Tue, 9 Jan 2024 14:05:19 +0000 (15:05 +0100)]
watchdog: ensure configured timeout is used instead of USEC_INFINITY
In some rare cases, a watchdog driver might neither be able to change
the watchdog timeout value, nor read it from the hardware at runtime.
With an otherwise functional watchdog setup, this constellation worked
until systemd v249. Since then, systemd ends up ignoring the timeout
defined by the system.conf and rather uses USEC_INFINITY. Consequently,
the watchdog is not pinged anymore and eventually resets the system.
We therefore want to ensure that the system keeps running with the
originally configured timeout.
Antonio Alvarez Feijoo [Wed, 10 Jan 2024 14:05:50 +0000 (15:05 +0100)]
repart: fix memory leak
With the `--image` option, if `arg_node` is NULL, it's being assigned via
`strdup`.
Lennart Poettering [Tue, 28 Nov 2023 10:02:56 +0000 (11:02 +0100)]
pam-util: implement our own pam_prompt() replacement, that doesn't log loudly
pam_prompt() will log very noisely at high error levels if it is called
without a conversation function that works. This is however a frequent
case, given that ssh doesn't provide one. To tone down the misleading
logging a bit, implement our own pam_prompt_graceful() that is just like
pam_prompt(), but reports errors back the caller who then logs (which we
generally do anyway).
Mike Yuan [Wed, 10 Jan 2024 15:11:23 +0000 (23:11 +0800)]
logind-action: query HandleActionData.sleep_operation where appropriate
Luca Boccassi [Wed, 10 Jan 2024 19:04:18 +0000 (19:04 +0000)]
Merge pull request #30870 from aafeijoo-suse/firstboot-help-fix
firstboot: minor fixes
Yu Watanabe [Tue, 9 Jan 2024 19:56:09 +0000 (04:56 +0900)]
test-resolved-dummy-server: several modernization
- use sd-event,
- use DEFINE_MAIN_FUNCTION(),
- use log_setup().
Frantisek Sumsal [Mon, 8 Jan 2024 13:20:30 +0000 (14:20 +0100)]
test: introduce a dummy DNS test server
Introduce a _very_ simple DNS server using our internal DNS-related
code, that responds to queries with specifically crafted packets, to
cover scenarios that are difficult to reproduce with well-behaving DNS
servers.
Also, hide the test DNS server behind Knot using the dnsproxy module, so
we don't have to switch DNS servers during tests.
Frantisek Sumsal [Mon, 8 Jan 2024 18:23:06 +0000 (19:23 +0100)]
resolve: export sendmsg_loop()
So we can use it in tests.
Yu Watanabe [Wed, 10 Jan 2024 03:37:36 +0000 (12:37 +0900)]
resolve: notify DNSSEC failure, EDE code, and EDE message
Yu Watanabe [Wed, 10 Jan 2024 03:07:19 +0000 (12:07 +0900)]
resolve: make manager_monitor_send() take DnsQuery*
Yu Watanabe [Wed, 10 Jan 2024 04:01:31 +0000 (13:01 +0900)]
resolve: also read EDE code and message from cached packet
Yu Watanabe [Wed, 10 Jan 2024 02:34:44 +0000 (11:34 +0900)]
resolve: introduce DNSSEC_UPSTREAM_FAILURE
and include EDE code and message in the error messages.
This replaces
9ca133e97a0c8795b1f293ccea4965b4ad1accc4, and implements
originally suggested at
https://github.com/systemd/systemd/pull/30513#discussion_r1433823737
Yu Watanabe [Tue, 9 Jan 2024 20:05:29 +0000 (05:05 +0900)]
resolvectl: use JSON_ALLOW_EXTENSIONS
Follow-up for
f0e4244b2fda1b3de3da1c2792ed1cd21c72087b.
Yu Watanabe [Sat, 6 Jan 2024 21:01:05 +0000 (06:01 +0900)]
resolve: several follow-ups for
9ca133e97a0c8795b1f293ccea4965b4ad1accc4.
- add missing initialization for DnsQuery.answer_ede_rcode,
- clear EDE code and message in dns_transaction_reset_answer(),
otherwise the previous EDE code or message may be mistakenly reused
on restart. This fixes memory leak of DnsTransaction.answer_ede_msg.
- also clear EDE code and message in dns_query_reset_answer(),
otherwise ede message is leaked if dns_query_accept() is called
multiple times for the same DnsQuery.
Follow-up for
9ca133e97a0c8795b1f293ccea4965b4ad1accc4.
Fixes #30752.
Lennart Poettering [Mon, 27 Nov 2023 20:22:31 +0000 (21:22 +0100)]
pam_systemd_home: move two bool flags into a proper flags parameter
We are going to add more shortly, but this makes sense on its own.
No changes in behaviour.
Antonio Alvarez Feijoo [Wed, 10 Jan 2024 16:31:49 +0000 (17:31 +0100)]
firstboot: fix memory leak
Antonio Alvarez Feijoo [Wed, 10 Jan 2024 16:29:56 +0000 (17:29 +0100)]
firstboot: fix typo and add missing option to help text
Lennart Poettering [Wed, 10 Jan 2024 14:56:29 +0000 (15:56 +0100)]
Merge pull request #30786 from yuwata/udev-net-link-property
udev/net: introduce [Link] Property= setting and friends
Damien Challet [Wed, 10 Jan 2024 14:12:56 +0000 (15:12 +0100)]
hwdb: add Teclast X98 Pro sensor info (#30859)
added Teclast X98 Pro
Antonio Alvarez Feijoo [Wed, 10 Jan 2024 10:56:36 +0000 (11:56 +0100)]
kernel-install: clarify what is currently supported with --root and --image
`list` and `add-all` ignore `--root` or `--image`, working on the running
system instead.
Also improve the error message if `--image` is used.
Yu Watanabe [Wed, 10 Jan 2024 06:01:26 +0000 (15:01 +0900)]
test-network: add test case for MACAddress=none in .netdev and MACAddressPolicy=none in .link
Prompted by #30813.
Lennart Poettering [Wed, 10 Jan 2024 09:47:32 +0000 (10:47 +0100)]
Merge pull request #30860 from aafeijoo-suse/kernel-install-leak-fix
kernel-install/coredumpctl: fix memory leaks
Nick Rosbrook [Tue, 9 Jan 2024 16:40:52 +0000 (11:40 -0500)]
test: skip test_exec_networknamespacepath if netns setup fails
In some environments, such as a LXD container, the netns setup might
fail because ip netns exec fails trying to mount /sys:
$ systemd-detect-virt
lxc
$ ip link add dummy-test-exec type dummy
$ ip netns add test-execute-netns
$ ip netns exec test-execute-netns ip link add dummy-test-ns type dummy
mount of /sys failed: Operation not permitted
If this setup fails, test_exec_networknamespacepath will fail, so check
the exit codes for these setup calls and skip the test if necessary.
Lennart Poettering [Wed, 10 Jan 2024 08:55:44 +0000 (09:55 +0100)]
Merge pull request #30839 from yuwata/detect-virt-google
detect-virt: add Google Compute Engine support
Lennart Poettering [Wed, 10 Jan 2024 08:55:12 +0000 (09:55 +0100)]
Merge pull request #30849 from YHNdnzj/daemon-modernization
Modernize a couple of daemons that use bus_event_loop_with_idle
Mike Yuan [Tue, 9 Jan 2024 07:00:53 +0000 (15:00 +0800)]
creds-util: make read_credential_strings_many behave the same as comment
The comment states "If the specified buffers are already non-NULL
frees them if a credential is found".
Also return 1 if all credentials are found.
Lennart Poettering [Wed, 10 Jan 2024 08:54:18 +0000 (09:54 +0100)]
Merge pull request #30853 from YHNdnzj/mount-accept-fstab-node
core: allow fstab-style nodes in mount/swap What=
Antonio Alvarez Feijoo [Wed, 10 Jan 2024 08:30:50 +0000 (09:30 +0100)]
coredumpctl: fix memory leak
Antonio Alvarez Feijoo [Wed, 10 Jan 2024 08:20:15 +0000 (09:20 +0100)]
kernel-install: fix memory leak
Yu Watanabe [Wed, 10 Jan 2024 01:10:06 +0000 (10:10 +0900)]
resolve: drop DNS_TRANSACTION_UPSTREAM_DNSSEC_FAILURE
This partially reverts commit
9ca133e97a0c8795b1f293ccea4965b4ad1accc4.
Not only there is no reason to introduce a new transaction failure state,
but also the commit introduces several severe issues.
Fixes #30776, #30779.
Yu Watanabe [Sat, 6 Jan 2024 18:57:11 +0000 (03:57 +0900)]
resolve: several follow-ups for
ac6844460ca1c01eaf2cb209ffa21c200d21a8f8
- fix indentation,
- drop incorrect comment, dns_packet_ede_rcode() can handle unknown EDE rcode.
- 0 is a valid EDE rcode,
- DnsTransaction.answer_ede_msg may be NULL, so needs to use strempty()
on logging,
- drop redundant ede_rcode temporary variable.
Follow-up for
ac6844460ca1c01eaf2cb209ffa21c200d21a8f8.
Yu Watanabe [Sat, 6 Jan 2024 18:28:19 +0000 (03:28 +0900)]
resolve: cleanup dns_packet_ede_rcode()
This makes the following:
- make dns_packet_ede_rcode() return -EINVAL when EDE code not found.
Otherwise, the caller may be confused that the packet has an unknown
error code.
- make the function escape EDE message only when non-utf8 message is received.
- the message handling logic is applied even if the error code is unknown, as
there is no reason that we escape EDE message only when an known error code
is received.
- reduce scope of variables,
- drop redundant 'else',
- append full stop to the log messages,
- drop redundant log message in the caller,
- split out error in the function and returned EDE error code.
Follow-up for
ac6844460ca1c01eaf2cb209ffa21c200d21a8f8.
Yu Watanabe [Sat, 6 Jan 2024 17:58:15 +0000 (02:58 +0900)]
resolve: update rcode table and align enum definitions
Yu Watanabe [Tue, 9 Jan 2024 18:52:02 +0000 (03:52 +0900)]
TODO: drop implemented feature
Yu Watanabe [Fri, 5 Jan 2024 13:41:06 +0000 (22:41 +0900)]
test: add test for [Link] Property= and friends
Yu Watanabe [Fri, 5 Jan 2024 11:08:26 +0000 (20:08 +0900)]
udev/net: introduce [Link] Property=, ImportProperty=, and UnsetProperty= settings
The applied order is equivalent to Environment=, PassEnvironment=, and
UnsetEnvironment= for [Service] or so.
Yu Watanabe [Mon, 8 Jan 2024 17:54:43 +0000 (02:54 +0900)]
udev: split out check that udev property can be updated
Yu Watanabe [Fri, 5 Jan 2024 11:36:52 +0000 (20:36 +0900)]
udev/net: split out udev property assignment logic
No functional change, just refactoring.
Yu Watanabe [Fri, 5 Jan 2024 11:36:33 +0000 (20:36 +0900)]
udev/net: do not set unapplied .link file name to ID_NET_LINK_FILE
Instead, import already assigned value from the udev database.
Then, return the builtin earlier.