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
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.
Lennart Poettering [Wed, 4 Nov 2020 21:59:44 +0000 (22:59 +0100)]
resolved: add RRSIG field to DnsAnswerItem
Lennart Poettering [Wed, 4 Nov 2020 20:17:26 +0000 (21:17 +0100)]
resolved: add new DnsAnswerFlags indicating originating section when parsing
Let's beef up our parser a bit: let's store in the DnsAnswerFlags field
(that is stored as part of DnsAnswerItem) which DNS packet section (i.e.
answer, authoritative, additional) an RR originates from.
This is useful when propagating answers from an upstream DNS server
eventually, as we can place the data in the right sections downstream
too.
Lennart Poettering [Wed, 4 Nov 2020 19:51:15 +0000 (20:51 +0100)]
resolved: replace DNS_ANSWER_FOREACH_FULL() iterator macro with DNS_ANSWER_FOREACH_ITEM()
The more fields DnsAnswerItem gains the less sense it makes to pass
every field of it as separate parameter to an iterator macro. Let's
simplify things here, in preparation of adding more fields to the
structure later on: let's just return the structure itself in the loop,
rather than the individual fields.
Lennart Poettering [Fri, 30 Oct 2020 16:53:34 +0000 (17:53 +0100)]
resolved: slight modernizations of resolved-dns-answer.c functions
Let's follow our own coding style an initialized return values on all
cases of "success".
Lennart Poettering [Wed, 28 Oct 2020 19:50:44 +0000 (20:50 +0100)]
resolved: add dns_answer_contains() helper
Lennart Poettering [Wed, 28 Oct 2020 13:55:40 +0000 (14:55 +0100)]
resolved: add logic for patching TTLs of full packets
Lennart Poettering [Wed, 28 Oct 2020 14:03:55 +0000 (15:03 +0100)]
resolved: add logic for patching OPT max udp size of existing packet
Lennart Poettering [Tue, 27 Oct 2020 17:33:29 +0000 (18:33 +0100)]
resolved: introduce dns_transaction_key() helper for getting RR key for transaction
This is a simple search&replace excercise: instead of accessing the
"key" field of the transaction directly, let's use a small inline helper
that does this for us.
This appears pointless for now, but this will become useful later when
we introduce "bypass" transactions, that reuse the original client DNS
packet for queries instead of synthesizing a packet of our own. In that
case transactions either have regular "key" field initialized as before,
or the "bypass" packet field instead. The new dns_transaction_key()
helper allows us to hide the differences for most cases as we can later
teach it to access the "bypass" packet's question key transparently.
No change in behaviour.
Lennart Poettering [Tue, 27 Oct 2020 15:40:39 +0000 (16:40 +0100)]
resolved: add helper dns_packet_dup() for duplicating packets
Lennart Poettering [Tue, 9 Feb 2021 16:14:25 +0000 (17:14 +0100)]
Merge pull request #18518 from poettering/inhibit-limit-columns
put a width limit on the "systemd-inhibit --list" table
Lennart Poettering [Tue, 9 Feb 2021 14:03:46 +0000 (15:03 +0100)]
inhibit: cut off overly long "who" fields
systemd-inhibit when invoked with a command line will put the whole
command line in the "who" field of the inhibitor lock. This can get
extremely long for shell expressions, making the table "systemd-inhibit
--list" shows ridiculously weirdly formatted. Let's put a limit on the
column width: half of the screen, not more.
Lennart Poettering [Tue, 9 Feb 2021 14:02:21 +0000 (15:02 +0100)]
format-table: don't hit assert if column got less width than it asked for
If one field in a specific column has a maximum size limit, other fields
in the same column might affected by it and get less than they asked
for. Let's make sure we can handle this, and don't assert on this
because surprisingly we got less than what we asked for.
Zbigniew Jędrzejewski-Szmek [Tue, 9 Feb 2021 13:14:16 +0000 (14:14 +0100)]
systemctl: remove comment about --failed being deprecated
Follow-up for
bef19548a2430909019d7cff095b8600c796c3ef.
Zbigniew Jędrzejewski-Szmek [Sun, 7 Feb 2021 17:30:42 +0000 (18:30 +0100)]
fuzz-systemctl-parse-argv: a new fuzzer
Does what the name suggests. Obviously inspired by sudoers, but note that
our tools are not supposed to be installed suid, so there is no privilege
boundary to cross here.
Luca Boccassi [Tue, 9 Feb 2021 13:06:40 +0000 (13:06 +0000)]
Merge pull request #18470 from mrc0mmand/ci-clang-12
ci: run build test with clang-12 as well
Zbigniew Jędrzejewski-Szmek [Tue, 9 Feb 2021 13:06:18 +0000 (14:06 +0100)]
Merge pull request #18416 from yuwata/strverscmp
util: introduce strverscmp_improved()
Zbigniew Jędrzejewski-Szmek [Mon, 8 Feb 2021 09:20:03 +0000 (10:20 +0100)]
fuzz-journal-remote: do not assert on resource conditions
We have a number of issues where oss-fuzz reports input-independent crashes of
fuzz-journal-remote. Instead of asserting that stuff that allocated fds and
memory never fails, let's instead just return an error.
https://oss-fuzz.com/testcase-detail/
4791099424112640
https://oss-fuzz.com/testcase-detail/
4531912477638656
I don't see any docs as to whether LLVMFuzzerTestOneInput() is allowed to
return non-zero. Propagating the error code is easiest, so let's just do that.
If it turns out that this causes oss-fuzz to still report a failure, we can
suppress that later.
Yu Watanabe [Tue, 9 Feb 2021 10:07:35 +0000 (19:07 +0900)]
log: do not use uninitialized value
Follow-up for
85cf96e3f567cd51f79d671bbf3559550fdd67b7.
Frantisek Sumsal [Tue, 9 Feb 2021 11:49:31 +0000 (12:49 +0100)]
ci: temporarily pin Arch repositories to glibc 2.32-5
glibc 2.33-3 shipped on 2021-02-06 breaks running Arch containers on
systems with older kernels (like Ubuntu Focal). Until the issue is
resolved, let's pin the Arch repositories to glibc 2.32-5 to mitigate
the annoying CI fails.
See: https://bugs.archlinux.org/task/69563
Zbigniew Jędrzejewski-Szmek [Tue, 9 Feb 2021 11:42:25 +0000 (12:42 +0100)]
Merge pull request #18346 from yuwata/hostnamectl-try-to-set-transient-hostname
hostnamectl: try to set transient hostname even if setting static or pretty hostname failed
Yu Watanabe [Tue, 9 Feb 2021 05:12:25 +0000 (14:12 +0900)]
test-network: support protocol and linkdown flag for ff00::/8 route
Fixes #18507.
Kevin P. Fleming [Sat, 6 Feb 2021 15:58:43 +0000 (10:58 -0500)]
network: Delay addition of IPv6 Proxy NDP addresses
Setting of IPv6 Proxy NDP addresses must be done at the same
time as static addresses, static routes, and other link attributes
that must be configured when the link is up. Doing this ensures
that they are reconfigured on the link if the link goes down
and returns to service.
Yu Watanabe [Sat, 30 Jan 2021 16:12:27 +0000 (01:12 +0900)]
tree-wide: replace strverscmp() and str_verscmp() with strverscmp_improved()
Yu Watanabe [Wed, 3 Feb 2021 20:55:59 +0000 (05:55 +0900)]
string-util: introduce strverscmp_improved()
Unfortunately, strverscmp() from libc or str_verscmp() do not correctly
handle pre-release version, e.g. 247 vs 247~rc1.
This implement a new comparison function, which is based on the RPM's
rpmvercmp().
Yu Watanabe [Wed, 3 Feb 2021 18:21:08 +0000 (03:21 +0900)]
fundamental: move several macros and functions into src/fundamental/
sd-boot has a copy of a subset of codes from libbasic. This makes
sd-boot share the code with libbasic, and dedup the code.
Note, startswith_no_case() is dropped from sd-boot, as
- it is not used,
- the previous implementation is not correct,
- gnu-efi does not have StrniCmp() or so.
Yu Watanabe [Fri, 29 Jan 2021 07:48:03 +0000 (16:48 +0900)]
hostnamectl: use Table
Yu Watanabe [Mon, 25 Jan 2021 04:44:00 +0000 (13:44 +0900)]
hostnamectl: show hint when user try to set transient hostname but static hostname is already used
Yu Watanabe [Fri, 22 Jan 2021 07:46:18 +0000 (16:46 +0900)]
hostname: use free_and_strdup_and_warn()
Yu Watanabe [Fri, 22 Jan 2021 07:38:52 +0000 (16:38 +0900)]
hostname: re-read file later when failed to update file
Previously, even when writing e.g. /etc/hostname fails, the static
hostname in Context is not restored. So, the subsequent call of the same
method succeeds:
```
$ sudo chattr +i /etc/hostname
$ sudo hostnamectl --static set-hostname aaa
Could not set static hostname: Access denied
$ echo $?
1
$ sudo hostnamectl --static set-hostname aaa
$ echo $?
0
```
This makes when updating file is failed, the saved stat is cleared. So,
the static hostname or machine information in the context are always
consistent to the corresponding files.
Yu Watanabe [Fri, 22 Jan 2021 02:28:06 +0000 (11:28 +0900)]
hostnamectl: unset pretty hostname only when no target is specified
Yu Watanabe [Fri, 22 Jan 2021 02:20:50 +0000 (11:20 +0900)]
hostnamectl: try to set transient hostname even if updating static or pretty hostname failed
If no target (--pretty, --static, or --transient) is specified, then
let's try to set transient hostname even if setting static or pretty
hostname failed. This may be useful for read-only filesystem.
Yu Watanabe [Mon, 25 Jan 2021 04:16:20 +0000 (13:16 +0900)]
hostname: introduce two bus errors for updating file
Yu Watanabe [Fri, 29 Jan 2021 06:28:41 +0000 (15:28 +0900)]
bus-error: align error definitions
Yu Watanabe [Fri, 22 Jan 2021 02:18:42 +0000 (11:18 +0900)]
hostnamectl: improve log message on failure
Gablegritule [Mon, 8 Feb 2021 23:30:49 +0000 (00:30 +0100)]
hwdb: add axis overrides for the Dell Latitude E5510 TouchPad (#18493)
I added an entry for Dell Latitude E5510 TouchPad to set up the true size
of the TouchPad (the size is currently over-estimated)
Frantisek Sumsal [Mon, 8 Feb 2021 11:34:13 +0000 (12:34 +0100)]
Merge pull request #18478 from mrc0mmand/fix-TEST-06
TEST-06-SELINUX fixes
Frantisek Sumsal [Mon, 8 Feb 2021 10:26:26 +0000 (11:26 +0100)]
tree-wide: fix the string concatenation warning with clang-12
e.g.:
./src/shared/dissect-image.c:2218:39: error: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma? [-Werror,-Wstring-concatenation]
"/usr/lib/os-release\0",
^
../src/shared/dissect-image.c:2217:39: note: place parentheses around the string literal to silence warning
[META_OS_RELEASE] = "/etc/os-release\0"
^
1 error generated.
See: https://reviews.llvm.org/D85545