Yu Watanabe [Sat, 13 Feb 2021 08:43:27 +0000 (17:43 +0900)]
Merge pull request #18455 from yuwata/network-change-link-state-only-when-new-address-or-route-will-be-assigned
network: change link state only when new address or route will be assigned
Luca Boccassi [Fri, 12 Feb 2021 23:34:35 +0000 (23:34 +0000)]
NEWS: mention new systemctl verb and fix typo
Lennart Poettering [Fri, 12 Feb 2021 20:43:31 +0000 (21:43 +0100)]
Merge pull request #18568 from keszybz/v248-prep
Start preparing for v238-rc1
Lennart Poettering [Tue, 3 Nov 2020 19:07:02 +0000 (20:07 +0100)]
resolved: never route DNSSEC traffic to LLMNR/mDNS
LLMNR/mDNS don't support DNSSEC, hence there's no point in routing any
lookups asking for DNSSEC there.
This speeds up looking up DNSSEC RRs for top-level domains, since we
don't have to wait for LLMNR to complete.
Zbigniew Jędrzejewski-Szmek [Fri, 12 Feb 2021 17:50:41 +0000 (18:50 +0100)]
NEWS: start preparing for v248
Zbigniew Jędrzejewski-Szmek [Fri, 12 Feb 2021 15:15:53 +0000 (16:15 +0100)]
hwdb: update for v248
As usual, it seems to be additions and updates, no major removals.
Zbigniew Jędrzejewski-Szmek [Fri, 12 Feb 2021 15:29:26 +0000 (16:29 +0100)]
syscall-tables: add missing preposition and fix file name path
I added an extension in
1f6f8cc8039a204609ddab79791ef22ee6340da0 but
forgot to fix the consumer script.
Lennart Poettering [Fri, 12 Feb 2021 14:49:20 +0000 (15:49 +0100)]
Merge pull request #18558 from poettering/have-tpm2
ask the uefi firmware if TPM2 support is available
Yu Watanabe [Wed, 3 Feb 2021 16:00:59 +0000 (01:00 +0900)]
network: dhcp6: change link state into "configuring" only when a new address or route will be assigned
Yu Watanabe [Wed, 3 Feb 2021 16:00:42 +0000 (01:00 +0900)]
network: ndisc: change link state into "configuring" only when a new address or route will be assigned
Yu Watanabe [Wed, 3 Feb 2021 15:52:28 +0000 (00:52 +0900)]
network: dhcp6: fix condtion check
Yu Watanabe [Wed, 3 Feb 2021 15:44:03 +0000 (00:44 +0900)]
network: set return value at the end of the function
The later netlink_call_async() call may fail. We should not touch the
return value when the function failed.
Yu Watanabe [Wed, 3 Feb 2021 15:40:08 +0000 (00:40 +0900)]
network: make address_configure() or friends return 1 when the address is new
Zbigniew Jędrzejewski-Szmek [Fri, 12 Feb 2021 11:16:23 +0000 (12:16 +0100)]
Merge pull request #18544 from yuwata/tree-wide-use-error-in-xxx_from_string
tree-wide: use error in xxx_from_string()
Yu Watanabe [Fri, 12 Feb 2021 04:47:58 +0000 (13:47 +0900)]
Merge pull request #18554 from yuwata/network-address-set-NLM_F_REPLACE-flag-automatically
network: automatically set NLM_F_REPLACE flag
Lennart Poettering [Thu, 11 Feb 2021 22:12:46 +0000 (23:12 +0100)]
condition: if spelunking through /sys/class/tpmrm doesn't work ask EFI if TPM2 exists
This makes ConditionSecurity=tpm2 work reliably during early boot: if
Linux doesn't know about the TPM2 then maybe the firmware does.
Lennart Poettering [Thu, 11 Feb 2021 22:11:56 +0000 (23:11 +0100)]
bootctl: show whether the firmware has TPM2 support
Lennart Poettering [Thu, 11 Feb 2021 22:10:07 +0000 (23:10 +0100)]
efi-loader: add efi_has_tpm2() helper
The helper checks if the UEFI firmware is hooked up to a TPM2 chip. This
is useful to know in trusted boot scenarios, in particular during early
boot in auto-enroll scenarios where we want to know whether TPM2 is
available or not, and the Linux drivers are not loaded yet, and where it
might or not be worth waiting for it.
Lennart Poettering [Thu, 11 Feb 2021 22:09:54 +0000 (23:09 +0100)]
efivars: debug log if we fail to detect whether /sys/firmware/efi/ exists
Yu Watanabe [Wed, 10 Feb 2021 20:48:10 +0000 (05:48 +0900)]
tree-wide: use free_and_strdup_warn()
Yu Watanabe [Tue, 9 Feb 2021 16:20:37 +0000 (01:20 +0900)]
network: automatically set NLM_F_REPLACE flag
The difference between sd_rtnl_message_new_addr() and
sd_rtnl_message_new_addr_update() is only whether NLM_F_REPLACE flag
will be set or not.
If an address is already assigned, then we need to set NLM_F_REPLACE
flag, otherwise, address_configure() will be fail.
This makes address_configure() judge whether we should use the flag or
not.
Yu Watanabe [Tue, 9 Feb 2021 15:50:24 +0000 (00:50 +0900)]
network: address: also logs preferred lifetime
Yu Watanabe [Wed, 10 Feb 2021 20:21:42 +0000 (05:21 +0900)]
tree-wide: propagate error in xxx_from-string()
Yu Watanabe [Wed, 10 Feb 2021 20:06:19 +0000 (05:06 +0900)]
network: dhcp: use string table
Yu Watanabe [Wed, 10 Feb 2021 20:19:18 +0000 (05:19 +0900)]
string-table: introduce DEFINE_STRING_TABLE_LOOKUP_FROM_STRING()
Yu Watanabe [Wed, 10 Feb 2021 19:52:42 +0000 (04:52 +0900)]
network: route: use _WITH_FALLBACK macros
Yu Watanabe [Wed, 10 Feb 2021 19:34:14 +0000 (04:34 +0900)]
networkd: lldp: use string table
Yu Watanabe [Wed, 10 Feb 2021 19:42:33 +0000 (04:42 +0900)]
string-table: introduce DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING_WITH_BOOLEAN()
Yu Watanabe [Wed, 10 Feb 2021 19:21:46 +0000 (04:21 +0900)]
tree-wide: use error codes in xxx_from_string()
Yu Watanabe [Wed, 10 Feb 2021 18:27:22 +0000 (03:27 +0900)]
conf-parser: use return codes in xxx_from_string()
Follow-up for #11484.
Luca Boccassi [Thu, 11 Feb 2021 15:44:25 +0000 (15:44 +0000)]
Merge pull request #18550 from keszybz/coverity-inspired-fixes
Coverity inspired fixes
Zbigniew Jędrzejewski-Szmek [Thu, 11 Feb 2021 11:56:01 +0000 (12:56 +0100)]
Merge pull request #17902 from bugaevc/fix-container-detection
improve container detection
Zbigniew Jędrzejewski-Szmek [Thu, 11 Feb 2021 11:00:09 +0000 (12:00 +0100)]
homework: fix unitialized variable
Coverity CID#
1444703.
Zbigniew Jędrzejewski-Szmek [Thu, 11 Feb 2021 10:59:22 +0000 (11:59 +0100)]
homework: reduce scope of iterator variables
Zbigniew Jędrzejewski-Szmek [Thu, 11 Feb 2021 08:55:01 +0000 (09:55 +0100)]
basic/locale-util: reduce variable scope
Zbigniew Jędrzejewski-Szmek [Thu, 11 Feb 2021 08:50:49 +0000 (09:50 +0100)]
fsck: make sure we don't read an unitialized variable
This use on %n was completely unnecessary: fprintf returns the number of
characters written. And the issue was that if fprintf failed for whatever
reason, it would not process the %n and m would be unitialized. Rework the
code a bit to simplify it.
Coverity CID#
1444708.
Zbigniew Jędrzejewski-Szmek [Thu, 11 Feb 2021 08:35:52 +0000 (09:35 +0100)]
sd-journal: add forgotten unmap in error path
Bug introduced in
4b5bc5396c090ee41c45cab9052372d296c4a2f4 :(
Coverity CID#
1444709.
Zbigniew Jędrzejewski-Szmek [Thu, 11 Feb 2021 08:23:22 +0000 (09:23 +0100)]
shared/generator: add missing initializer
Coverity CID#
1444710.
Zbigniew Jędrzejewski-Szmek [Thu, 11 Feb 2021 08:17:46 +0000 (09:17 +0100)]
udev: add assert to make coverity happy
Coverity says:
CID
1446387 (#1 of 1): Bad bit shift operation (BAD_SHIFT)
8. negative_shift: In expression 1U << (int)cmd, shifting by a negative amount
has undefined behavior. The shift amount, cmd, is -22.
I don't think there's any issue, unless we forget to set token->data
appropriately. Let's add an assert.
Zbigniew Jędrzejewski-Szmek [Thu, 11 Feb 2021 07:24:39 +0000 (08:24 +0100)]
Merge pull request #18545 from poettering/netlink-seqno-fix
sd-netlink seqnum fixes
Vinnie Magro [Fri, 29 Jan 2021 00:24:34 +0000 (16:24 -0800)]
networkd: add UseFQDN option for DHCPv6
Similar to DHCPv4's UseHostname option, add a UseFQDN config option in
[DHCPv6] to set the system's transient hostname if the FQDN option is
set in the DHCPv6 response from the server.
Zbigniew Jędrzejewski-Szmek [Wed, 10 Feb 2021 23:10:25 +0000 (00:10 +0100)]
Merge pull request #17823 from poettering/resolved-just-bypass
resolved: just the dnssec bypass logic
Lennart Poettering [Wed, 10 Feb 2021 22:05:51 +0000 (23:05 +0100)]
sd-netlink: spread out sequence numbers a bit
An (imperfect) fix for #14760.
This makes collisions unlikely, but still theoretically possible.
Fixes: #14760
Lennart Poettering [Wed, 10 Feb 2021 17:12:58 +0000 (18:12 +0100)]
sd-netlink: reduce indentation levels a bit
Lennart Poettering [Wed, 10 Feb 2021 17:11:20 +0000 (18:11 +0100)]
sd-netlink: use getsockopt_int() where appropriate
Lennart Poettering [Wed, 10 Feb 2021 16:59:46 +0000 (17:59 +0100)]
sd-netlink: revamp message serial handling
Let's use uint32_t everywhere to maintain the seqno, since that's what
the kernel does. Prviously in the reply_callback logic we used 64bit,
for no apparent reason.
Using 32bit also provides us with the benefit that we can avoid using
uint64_hash_ops, and can use trivial_hash_ops instead for the reply
hashmap, so that we can store the seqno in the key pointer directly.
While we are at it, let's make sure we never run into serial collisions
internally (32bit is a lot, but not that much), and let's put a limit on
outstanding serials, to catch programming errors.
Lennart Poettering [Wed, 10 Feb 2021 16:11:34 +0000 (17:11 +0100)]
tmpfiles: explicitly say we need /proc/ to run
I don't think it's realistic to operate without /proc/. Hence, let's
make this explicit.
If one day someone finds a way to do what we need without /proc/ we can
certainly drop this check again, but for now I think it's a lot
friendlier to users to make this explicitly early on instead continuing
to run and then not do what we need to do, oftentimes failing in cryptic
ways.
After all, invoking the tool without /proc/ is not an error that was
specific to some of the lines we process, but it's systematic error that
will show its ugly face in many codepaths down the line.
Fixes: #14745
Yu Watanabe [Wed, 10 Feb 2021 16:32:01 +0000 (01:32 +0900)]
network: use SD_BUS_METHOD_WITH_ARGS() macro
Lennart Poettering [Wed, 10 Feb 2021 15:15:20 +0000 (16:15 +0100)]
core: improve log message when unit deactivates cleanly
Whenever a unit deactivates sucessfully we so far generated a message
"unit xyz: succeeded". This is a bit confusing, since various unit types
cannot really "succeed", e.g. a device unit can't really "suceed", not
can a swap unit. In particular in the latter case people would probably
assume that a swap unit that "suceeded" would actually mean a swap was
active now, but the opposite is actually true.
Let's improve this by saying "Deactivated successfully", which hopefully
clears this up.
(I thought about saying "terminated" or "completed" or "finished" or so
instead, but that too doesn#t make sense if you think about unit types
like swaps or devices.)
Lennart Poettering [Wed, 10 Feb 2021 20:26:14 +0000 (21:26 +0100)]
Merge pull request #18440 from bluca/portable_upgrade
portable: add 'reattach' verb and DBUS interface
Adrian Vovk [Tue, 9 Feb 2021 21:20:32 +0000 (16:20 -0500)]
tmpfiles: v/q/Q: Add env var to skip check for rootfs in subvolume
Sergey Bugaev [Sun, 20 Dec 2020 11:43:01 +0000 (14:43 +0300)]
virt: detect cgroups namespaces
detect_container() is now able to detect if we're running in a cgroup namespace.
Sergey Bugaev [Sat, 19 Dec 2020 18:00:22 +0000 (21:00 +0300)]
virt: detect Docker and Podman containers
Docker doesn't set $container, so it cannot be detected that way. Instead, we
check for presence of /.dockerinit, which it creates. Podman does set
$container, but some Red Hat images (in particular, Fedora images) override
$container to equal "oci". So to correctly detect Podman containers, we check
for presence of /run/.containerenv, which is created by Podman and is now the
official way to get information about the container from within the container.
Fixes https://github.com/systemd/systemd/issues/15393
Luca Boccassi [Mon, 1 Feb 2021 14:29:40 +0000 (14:29 +0000)]
portable: add 'reattach' verb and DBUS interface
Add 'reattach' verb to portablectl, and corresponding DBUS interface
to systemd-portabled.
Takes the same parameters as 'attach', but it will do a 'detach' (and
it will refuse to proceed if it cannot be done) first, matching on
the unversioned prefix of the new image. Eg:
portablectl reattach /tmp/foo_2.raw
will cause foo_1.raw to be detached, and foo_2.raw to be attached.
The key difference with a manual 'detach old' plus 'attach new' is that
the running units are not disturbed until after the attach completed,
and if --now is passed they are then restarted.
A 'detach' is not allowed normally if the units are running.
By using a restart-after-deploy method, 'reattach' allows for minimal
interruption of service and also for features that only work on restart
(eg: file descriptor store) to work as intended.
The DBUS interface returns two lists: first the removals from the detach
that were not immediately re-added in the attach, so that the caller
can stop the relevant units, and then the list of additions that are
either new or updates, so that the caller can restart/enable the
relevant units. portablectl already implements this with the existing
--now/--enable switches.
Luca Boccassi [Fri, 5 Feb 2021 21:24:54 +0000 (21:24 +0000)]
portable: allow Detach to match images with different version suffixes
Luca Boccassi [Tue, 2 Feb 2021 21:13:44 +0000 (21:13 +0000)]
test: setup var/tmp in the test image as well
Luca Boccassi [Tue, 2 Feb 2021 17:16:41 +0000 (17:16 +0000)]
test: add empty /etc/resolv.conf in test image
Portable services have a BindPath pointing to it, so it needs to
be available in the image
Luca Boccassi [Fri, 28 Aug 2020 13:17:31 +0000 (14:17 +0100)]
test-50-dissect: move minimal image setup to common setup function
So that it can be re-used for other tests by simply setting
TEST_INSTALL_VERITY_MINIMAL=1 in test.sh, without having to
replicate the setup commands.
Zbigniew Jędrzejewski-Szmek [Wed, 10 Feb 2021 18:31:11 +0000 (19:31 +0100)]
Merge pull request #18542 from yuwata/bash-completion-update
bash-completion: add missing options
Yu Watanabe [Wed, 10 Feb 2021 18:18:15 +0000 (03:18 +0900)]
Merge pull request #18536 from poettering/uid-refs-simplify
dynamic uid/gid reference handling simplifications
Yu Watanabe [Wed, 10 Feb 2021 18:17:47 +0000 (03:17 +0900)]
Merge pull request #11484 from keszybz/udevadm-error-logs
Use real return codes in _from_string() functions
Yu Watanabe [Wed, 10 Feb 2021 17:50:41 +0000 (02:50 +0900)]
bash-completion: loginctl: add -P option
Yu Watanabe [Wed, 10 Feb 2021 17:50:22 +0000 (02:50 +0900)]
bash-completion: coredumpctl: add --json and -n options
Frantisek Sumsal [Wed, 10 Feb 2021 09:16:09 +0000 (10:16 +0100)]
test: count call instructions as well
Binaries on the latest Arch Linux use `call` instructions instead of
`callq`, which breaks the ASan detection and eventually the image
building process (due to insufficient space).
Weblate (bot) [Wed, 10 Feb 2021 15:55:41 +0000 (16:55 +0100)]
Translations update from Weblate (#18537)
Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Frantisek Sumsal [Wed, 10 Feb 2021 14:06:40 +0000 (15:06 +0100)]
ci: build on Fedora ELN as well
ELN builds with a slightly different content set and RHEL-like options,
which should, theoretically, help a bit with RHEL stuff.
Yu Watanabe [Wed, 10 Feb 2021 15:29:22 +0000 (00:29 +0900)]
Merge pull request #18506 from keszybz/fuzz-systemctl-parse-argv
Fuzzer for systemctl argline parsing
Lennart Poettering [Wed, 10 Feb 2021 14:58:56 +0000 (15:58 +0100)]
Merge pull request #18521 from poettering/coredumpctl-table
coredumpctl improvements (mostly about table formatting)
Lennart Poettering [Wed, 10 Feb 2021 14:47:56 +0000 (15:47 +0100)]
core: fix manager_ref_gid() parameter name in header
It should match what we do for manager_ref_uid() and in the .c file.
Lennart Poettering [Wed, 10 Feb 2021 14:46:47 +0000 (15:46 +0100)]
manager: simplify uid-ref/gid-ref a code a bit
Let's drop unused function arguments, and needless double pointers where
we can.
no actual change in behaviour, just simplifications
(I tried to track down #14026 without success, and this came out of it)
Zbigniew Jędrzejewski-Szmek [Wed, 10 Feb 2021 07:00:33 +0000 (08:00 +0100)]
test-string-util: add missing comma
Coverity CID#
1446368.
Zbigniew Jędrzejewski-Szmek [Wed, 8 May 2019 08:55:39 +0000 (10:55 +0200)]
resolved: rework a few functions to return early on error
The implementation is a bit ugly because we set the output variable
twice. But we were already doing this on error, so this is not
significantly worse. Doing this allows us to avoid goto's, and the
compiler should be able to figure this out and only set once.
Zbigniew Jędrzejewski-Szmek [Tue, 9 Feb 2021 15:07:19 +0000 (16:07 +0100)]
machinectl: write arg_* only after verifying the value
Zbigniew Jędrzejewski-Szmek [Tue, 9 Feb 2021 15:06:36 +0000 (16:06 +0100)]
tree-wide: propagate error code from _from_string() functions
Now that we know we have something useful, no need to make an answer up.
Zbigniew Jędrzejewski-Szmek [Fri, 18 Jan 2019 15:26:31 +0000 (16:26 +0100)]
Return -EINVAL from _from_string() functions
We'd return -1 (-EPERM), even though we have a general rule to use real errno
values. The particular case that caught my attention was:
$ sudo udevadm control -l asdf
Failed to parse log priority 'asdf': Operation not permitted
... but "git grep 'r =.*_from_string' src/" return 110 hits. Confusingly, some
of the _from_string functions already return a proper errno value, so not all
of those are broken, but probably quite a few.
Zbigniew Jędrzejewski-Szmek [Tue, 9 Feb 2021 16:17:47 +0000 (17:17 +0100)]
tree-wide: use -EINVAL for enum invalid values
As suggested in https://github.com/systemd/systemd/pull/11484#issuecomment-
775288617.
This does not touch anything exposed in src/systemd. Changing the defines there
would be a compatibility break.
Note that tests are broken after this commit. They will be fixed in the next one.
Zbigniew Jędrzejewski-Szmek [Wed, 10 Feb 2021 07:32:23 +0000 (08:32 +0100)]
udev: make sure UdevBuiltinCommand is properly converted
Zbigniew Jędrzejewski-Szmek [Wed, 10 Feb 2021 13:03:10 +0000 (14:03 +0100)]
sd-bus: drop some bitfields in sd_bus_slot
A hole was/is present after the booleans, so changing them to be one byte each
doesn't change the structure size (122 bits on amd64). If we add more stuff
later, it might make sense to turn some of those into bitfields again. For now,
let's take the easy route. EINVAL fits into type now.
Code size it minimally reduced:
-rwxrwxr-x 1 zbyszek zbyszek
4109792 Feb 10 14:00 build/libsystemd.so.0.30.0
-rwxrwxr-x 1 zbyszek zbyszek
4109712 Feb 10 14:01 build/libsystemd.so.0.30.0
Lennart Poettering [Wed, 10 Feb 2021 13:11:44 +0000 (14:11 +0100)]
github: expressly ask for logs in github issue template
Apparently it's not obvious that logs are a good thing to provide, hence
let's explicitly ask for them.
Zbigniew Jędrzejewski-Szmek [Tue, 9 Feb 2021 18:51:50 +0000 (19:51 +0100)]
sd-netlink: pahole optimization of sd_netlink_slot
By rearranging the fields, we can avoid one of the holes (on amd64).
By adding more space for .type, -EINVAL can be used as a value later on.
The structure is reduced from 96 to 88 bytes (on amd64).
Text size is also smaller:
-rwxrwxr-x 1 zbyszek zbyszek
4109832 Feb 9 19:50 build/libsystemd.so.0.30.0
-rwxrwxr-x 1 zbyszek zbyszek
4109792 Feb 9 19:51 build/libsystemd.so.0.30.0
Zbigniew Jędrzejewski-Szmek [Tue, 9 Feb 2021 16:08:06 +0000 (17:08 +0100)]
shared/json: make JsonVariant.type field wider
pahole shows that this doesn't make a difference, but we can fit -EINVAL
into .type without warnings.
Zbigniew Jędrzejewski-Szmek [Tue, 9 Feb 2021 16:02:18 +0000 (17:02 +0100)]
sd-event: drop one bitfield from sd_event_source
pahole analysis confirms that the structure size does not change (there
was/is a hole after the sequence of bitfields anyway).
Zbigniew Jędrzejewski-Szmek [Tue, 9 Feb 2021 15:43:03 +0000 (16:43 +0100)]
core: drop bitfields in Manager object
Every bitfield may make the object a little smaller, but requires additional
code when accessing the field. So it only makes sense in objects that are
created in many many copies. The Manager is pretty much a singleton.
-rwxrwxr-x 1 zbyszek zbyszek
4443840 Feb 9 16:14 build/systemd
-rwxrwxr-x 1 zbyszek zbyszek
4442552 Feb 9 16:42 build/systemd
We save 1288 bytes of code by "wasting" a few bytes on storage. (The speed
advantages are probably more important, but harder to measure…)
Zbigniew Jędrzejewski-Szmek [Tue, 9 Feb 2021 15:32:55 +0000 (16:32 +0100)]
Add comma in structured initialization in a few places
It just looks nicer…
Zbigniew Jędrzejewski-Szmek [Wed, 8 May 2019 09:09:10 +0000 (11:09 +0200)]
core: do not initialize variable which is unconditionally set below
Zbigniew Jędrzejewski-Szmek [Fri, 18 Jan 2019 16:31:32 +0000 (17:31 +0100)]
test-tables: make the assert more readable
Doing it all in one line and with negation in front seemed like a good
idea at some point, but I think it is vastly easier to understand when
it is split out a bit.
Zbigniew Jędrzejewski-Szmek [Wed, 10 Feb 2021 06:49:17 +0000 (07:49 +0100)]
test-tables: fix warning about NULL used in printf
With the simplified asserts, newer gcc is able to (correctly) figure
out that NULL was being passed.
Lennart Poettering [Wed, 10 Feb 2021 11:09:38 +0000 (12:09 +0100)]
clock-util: modernize settimeofday() timezone calls
Let's use structured initialization, and avoid the weird `tv_null`
indirection.
No changes in behaviour, just some clean-ups.
Luca Boccassi [Wed, 10 Feb 2021 11:10:27 +0000 (11:10 +0000)]
Fix coverity warning in test-string-util.c
CID
1446368: Incorrect expression (MISSING_COMMA)
Lennart Poettering [Tue, 9 Feb 2021 16:41:10 +0000 (17:41 +0100)]
coredumpctl: include coredump size in output
This improves the output of the "list" and "info" verbs and adds
coredump size information to the output.
For doing that a common helper function is added that analyzes the
coredump file on disk.
Lennart Poettering [Tue, 9 Feb 2021 15:43:55 +0000 (16:43 +0100)]
man: document new coredumpctl features
Lennart Poettering [Tue, 9 Feb 2021 15:40:44 +0000 (16:40 +0100)]
coredumpctl: modernize table output
Let's use our table formatter for generating the coredump table. Bring
support up to our current standards, with a bit of color, JSON output
and so on.
Also adds supports for setting a max for the number of lines to
generate. (with the new -n switch)
The existing -1 switch now becomes a synonym for "-n 1 --reverse"
Fixes: #3271
Lennart Poettering [Tue, 9 Feb 2021 15:39:49 +0000 (16:39 +0100)]
format-table: when generating json, synthesize "null" for invalid ifindex
This matches what we do for other cell types that have an invalid value.
Lennart Poettering [Tue, 9 Feb 2021 15:36:07 +0000 (16:36 +0100)]
format-table: make UID/GID/PID fields first class citizens + add signal cell type
This way we can display invalid UIDs/GIDs/PIDs as n/a while still
storing them as is.
Also, let's add a new cell type for unix signal, that is stored as
integer, but displayed as signal name string.
Lennart Poettering [Wed, 10 Feb 2021 09:50:23 +0000 (10:50 +0100)]
analyze: slightly reword PrivatTmp= message
Apparently there way confusion about "does not apply". Let's say "is not
appropriate".
Fixes: #13095
Lennart Poettering [Fri, 5 Feb 2021 19:19:11 +0000 (20:19 +0100)]
resolved: drop timestamp parameter to dns_cache_put() we don't ever pass
Lennart Poettering [Fri, 30 Oct 2020 16:47:43 +0000 (17:47 +0100)]
resolved: avoid NOTIMP error when looking up not supported requests
Some folks argue that NOTIMP should only be returned if a specific QTYPE
is not supported. While I don#t think the RFCs are too clear about that,
let's use REFUSED instead, which appears to be a less controversial
choice of error code.
Prompted-by: #17218
Lennart Poettering [Thu, 5 Nov 2020 10:01:52 +0000 (11:01 +0100)]
resolved: add support for answering DNSSEC questions on the stub
This substantially beefs up the local DNS stub feature set in order to
allow local clients to do DNSSEC validation through the stub.
Previously we'd return NOTIMP if we'd get a DO or DO+CD lookup. With
this change we'll instead:
1. If we get DO+CD requests (i.e. DNSSEC with no local checking) we'll
proxy DNS queries and response mostly unmodified to/from upstream DNS
servers if possible (this is called "bypass" mode). We will patch in
new request IDs, (and patch them back out on reply), so that we can
sanely keep track of things. We'll also maintain a minimal local
cache for such lookups, always keeping the whole DNS packets in it
(if we reply from cache we'll patch the TTLs of all included RRs).
2. If we get DO requests without CD (i.e. DNSSEC with local checking)
we'll resolve and validate locally. In this mode we will not proxy
packets, but generate our own. We will however cache the combination
of answer RRs (along with their packet section assignments) we got
back in the cache, and use this information to generate reply packets
from the DNS stub.
In both cases: if we determine a lookup is to be answered from LLMNR or
mDNS we'll always revert to non-DNSSEC, non-proxy operation as before.
Answers will lack the DO bit then, since the data cannot be validated
via DNSSEC by the clients.
To make this logic more debuggable, this also adds query flags for
turning off RR sources. i.e. cache/network/zone/trust anchor/local
synthesis may now be disabled individually for each lookup.
The cache is substantially updated to make all this work: in addition to
caching simple RRs for lookup RR keys, we'll now cache the whole packets
and the whole combination of RRs, so that we can answer DO and DO+CD
replies sensibly according to the rules described above. This sounds
wasteful, but given that the
DnsResourceRecord/DnsResourceKey/DnsAnswer/DnsPacket
objects are all ref-counted and we try to merge references the actual
additional memory used should be limited (but this might be something to
optimize further later on).
To implement classic RR key lookups and new-style packet proxy lookups
(i.e. the ones necessary for DO+CD packet proxying, as described above)
DnsTransaction and DnsQuery objects now always maintain either a
DnsResourceKey/DnsQuestion as lookup key or a DnsPacket for "bypass"
mode.
Fixes: #4621 #17218
Lennart Poettering [Thu, 5 Nov 2020 10:01:36 +0000 (11:01 +0100)]
resolved: DNS_CLASS_ANY lookups are OK too
Lennart Poettering [Thu, 5 Nov 2020 08:53:02 +0000 (09:53 +0100)]
resolved: if dns_packet_append_answer() fails count how many RRs were successfully added
This is useful later when handling the truncation case: if we can't add
all RRs we'd like to add we need to set the TC bit, but still report the
number of RRs we added (and not the number of RRs we would have liked to
add) to the packet.