Commit graph

46542 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 46ed9f4ce1 logind: use extract_first_word() 2020-09-09 09:34:54 +02:00
Zbigniew Jędrzejewski-Szmek 434fef6de3 shared/sleep-config: more logging and port to extract_first_word() 2020-09-04 13:53:47 +02:00
Zbigniew Jędrzejewski-Szmek 46bf625aca Add string_contains_word_strv()
I had to move STRV_MAKE to macro.h. There is a circular dependency between
extract-word.h, strv.h, and string-util.h that makes it hard to define the
inline function otherwise.
2020-09-04 12:59:26 +02:00
Zbigniew Jędrzejewski-Szmek 81823e6c12 sd-login: use string_contains_word() 2020-09-04 12:59:26 +02:00
Zbigniew Jędrzejewski-Szmek 53cd7f3374 basic: add string_contains_word()
This wraps the common pattern of using extract_first_word() in a loop
to look for a matching word.
2020-09-04 12:59:25 +02:00
Zbigniew Jędrzejewski-Szmek 0176728a73 test-string-util,test-extract-word: add log headers 2020-09-04 12:59:25 +02:00
Zbigniew Jędrzejewski-Szmek 459c41b9e2
Merge pull request #16881 from yuwata/network-routing-policy-rule-cleanups
network: routing policy rule cleanups
2020-09-04 12:57:20 +02:00
Zbigniew Jędrzejewski-Szmek a36a23f52b
Merge pull request #16952 from yuwata/resolvectl-log-level-follow-ups
resolvectl: update help message
2020-09-04 12:21:15 +02:00
Yu Watanabe 2200c3cf56 network: fixes gateway assignment through DHCPv4
This fixes the following issue:
- If a DHCP lease does not contains router option, then routes with
`Gateway=_dhcp` setting introduce unexpected results.

This also makes several failure paths critical. And adjust warnings when
classless routes are provided.
2020-09-04 11:12:03 +02:00
Yu Watanabe 3605aae161 bash-completion: resolvectl: support 'log-level' command 2020-09-04 17:03:28 +09:00
Yu Watanabe bde4bc9bd2 resolvectl: add 'log-level' to help message
Follow-up for df9578498f.
2020-09-04 16:58:36 +09:00
Lennart Poettering 5b49641015 resolved: ttl/hopcount sockopt is not a boolean
These are integer values, hence specify them as integers, not as
booleans.
2020-09-04 15:23:12 +09:00
Yu Watanabe 5c72a6d5d3 network: logs about unknown key 2020-09-04 08:48:08 +09:00
Yu Watanabe f405179d65 network: honor already specified family when parsing from= or to= in serialized rule 2020-09-04 08:48:08 +09:00
Yu Watanabe 9d6282d120 network: do not reallocate buffer 2020-09-04 08:48:04 +09:00
Yu Watanabe d0ac05613b network: serialize InvertRule= in [RoutingPolicyRule] 2020-09-04 08:47:22 +09:00
Yu Watanabe 1680b11df4 network: add whitespace after family= and priority= in serialized routing policy rule
This also makes priority= serialized only when its value is non-zero.
2020-09-04 08:44:19 +09:00
Yu Watanabe 3c94b20dd3 network: downgrade error level when the error is ignored 2020-09-04 08:44:14 +09:00
Yu Watanabe 7e60a37d04 network: move routing_policy_rule_read_full_file() 2020-09-04 08:42:01 +09:00
Zbigniew Jędrzejewski-Szmek 908dbc70d6
Merge pull request #16044 from ssahani/resolved-interface
systemd-resolved: allow configurable bind address
2020-09-03 19:06:05 +02:00
Lennart Poettering 88fdff4e65
Merge pull request #16945 from poettering/udev-test-selinux
fix udev-test when used with selinux
2020-09-03 18:39:28 +02:00
Lennart Poettering 7d81d85a05 udev-test: don't mix alloca() and regular C stack allocation in one expression 2020-09-03 17:01:17 +02:00
Lennart Poettering 1e7a67ec22 udev-test: use SYNTHETIC_ERRNO() where useful 2020-09-03 17:01:17 +02:00
Lennart Poettering 91e0b0640e udev-test: use mount_verbose() instead of mount(), to make debugging easier 2020-09-03 17:01:17 +02:00
Lennart Poettering 415df097fe udev-test: make sure we run udev tests with selinux assumed off
This is cleaner that way given that we create our own half-virtualizes
device tree, and really shouldn't pull selinux labelling and access
control into that, we can only lose, in particular as our overmounted
/sys/ actually lacks /sys/fs/selinux.

(This fixes udev test woes introduced by #16821 where suddenly the test
would fail because libselinux assumed selinux was on, but selinuxfs
wasn't actually available)
2020-09-03 17:01:11 +02:00
Lennart Poettering 86e443de2f
Merge pull request #16915 from poettering/cryptsetup-dlopen
pid1,repart,growfs: make libcryptsetup a dlopen() style dep
2020-09-03 14:57:29 +02:00
Lennart Poettering 7cc60ea414
Merge pull request #16821 from cgzones/selinux_status
selinux: use SELinux status page
2020-09-03 14:55:08 +02:00
Lennart Poettering c457bf4741
Merge pull request #16940 from keszybz/socket-enotconn-cleanup
Cleanup socket enotconn handling
2020-09-03 14:51:02 +02:00
Susant Sahani 1f05101fb6 resolve: allow configurable bind address 2020-09-03 08:27:41 +00:00
Glen Whitney 43c1f465bb hwdb: Add Adesso AKB-805MAC keyboard, mfd by Ortek 2020-09-03 09:20:17 +02:00
afg 67d5d9d5ce firstboot: don't create/modify passwd and shadow if not asked 2020-09-03 09:13:47 +02:00
Zbigniew Jędrzejewski-Szmek 5cf09553c3 core/socket: use _cleanup_ to close the connection fd
Removing the gotos would lead to a lot of duplicated code, so I left them
as they were.
2020-09-02 18:18:28 +02:00
Zbigniew Jędrzejewski-Szmek b669c20f97 core/socket: fold socket_instantiate_service() into socket_enter_running()
socket_instantiate_service() was doing unit_ref_set(), and the caller was
immediately doing unit_ref_unset(). After we get rid of this, it doesn't seem
worth it to have two functions.
2020-09-02 18:18:28 +02:00
Zbigniew Jędrzejewski-Szmek 86e045ecef core/socket: we may get ENOTCONN from socket_instantiate_service()
This means that the connection was aborted before we even got to figure out
what the service name will be. Let's treat this as a non-event and close the
connection fd without any further messages.

Code last changed in 934ef6a5.
Reported-by: Thiago Macieira <thiago.macieira@intel.com>

With the patch:
systemd[1]: foobar.socket: Incoming traffic
systemd[1]: foobar.socket: Got ENOTCONN on incoming socket, assuming aborted connection attempt, ignoring.
...

Also, when we get ENOMEM, don't give the hint about missing unit.
2020-09-02 18:17:30 +02:00
Gibeom Gwon 3d3d6e10da homed: remember the secret even when the for_state is FIXATING_FOR_ACQUIRE
Remember the secret if the for_state is FIXATING_FOR_ACTIVATION or
FIXATING_FOR_ACQUIRE. This fixes login failures when logging in
to an unfixated user.
2020-09-02 16:54:23 +02:00
Lennart Poettering a52dc0b6f3 update TODO 2020-09-02 15:04:06 +02:00
Lennart Poettering 0d12936d9a shared: make libcryptsetup dep dlopen
Let's make libcryptsetup a dlopen() style dep for PID 1 (i.e. for
RootImage= and stuff), systemd-growfs and systemd-repart. (But leave to
be a regulra dep in systemd-cryptsetup, systemd-veritysetup and
systemd-homed since for them the libcryptsetup support is not auxiliary
but pretty much at the core of what they do.)

This should be useful for container images that want systemd in the
payload but don't care for the cryptsetup logic since dm-crypt and stuff
isn't available in containers anyway.

Fixes: #8249
2020-09-02 15:04:06 +02:00
Lennart Poettering 1e2f32305c shared: rename crypt-util.c → cryptsetup-util.c
"crypt-util.c" is such a generic name, let's avoid that, in particular
as libc's/libcrypt's crypt() function is so generically named too that
one might thing this is about that. Let's hence be more precise, and
make clear that this is about cryptsetup, and nothing else.

We already had cryptsetup-util.[ch] in src/cryptsetup/ doing keyfile
management. To avoid the needless confusion, let's rename that file to
cryptsetup-keyfile.[ch].
2020-09-02 15:00:32 +02:00
Christian Göttsche 346543d6f9 selinux/systemctl: create unit file with default context on edit 2020-09-02 09:07:59 +02:00
Lennart Poettering e4ec78206c import: make sure gnu tar complains on tar files with trailing garbage
By default GNU tar will only read the first archive if multiple archives
are concatenated and ignore the rest. If an archive contains trailing
garbage this will hence not be recognized by tar as error, it simply
stops reading when the first archive is done (which might escalate to
SIGPIPE when invoked via a pipe).

Let's add --ignore-zeros to the tar command line when extracting. This
means:

1) if a tar archive was concatenated (i.e. generated with tar -A) we'll
   process it correctly.

2) if a tar archive contains trailing garbage tar will now generate an
   error message about it, instead of just throwing EPIPE, which makes
   things easier to debug as broken files are not silently processed.

I think it's OK for gnu tar to ignore trailing garbage when dealing with
classic tapes drives, i.e. mediums that do not have a size limit
built-in. However, this is not what we are dealing with: we are dealing
with OS images here, that hopefully someone generated with a clean build
system, that were signed and validated and hence should not contain
trailing garbage.  Hence it's better to refuse and complain thant to
silently eat up like for classic tape drives.

Fixes: #16605
2020-09-02 08:59:33 +02:00
Lennart Poettering 58cf204730 nspawn: let's make LinkJournal an extended boolean
Let's accept the usual boolean parameters for LinkJournal. It's
confusing otherwise.

Previously we'd accept "no" but not the other values we typically accept
for "false". We'd not accept any values for "true".

With this change we'll accept all true and false values and will do
something somewhat reasonable: any false value is treated like "no"
previously was reated. And any true value is now treated like "auto".

We don't document the new values, since this logic is mostly redundant,
and it's probably better if people consider this an enum rather than a
bool.

Fixes: #16888
2020-09-02 08:57:44 +02:00
Zbigniew Jędrzejewski-Szmek 47be8ddcee
Merge pull request #16882 from weblate/weblate-systemd-master
Translations update from Weblate
2020-09-02 08:55:40 +02:00
Zbigniew Jędrzejewski-Szmek 6ee37b1a7d
Merge pull request #16853 from poettering/udev-current-tag2
udev: make uevents "sticky"
2020-09-02 08:12:56 +02:00
Lennart Poettering 64a5384fd2 coredump: don't convert s → µs twice
We already append 000000 early on when parsing the cmdline args, let's
not do that a second time.

Fixes: #16919
2020-09-02 08:11:07 +02:00
afg ae0d36c161 firstboot: fill empty color if ansi_color unavailable from os-release 2020-09-02 08:10:47 +02:00
Susant Sahani 1f1f3210c9 shared: Introduce socket_addr_port_from_string_auto 2020-09-02 03:25:17 +00:00
Zbigniew Jędrzejewski-Szmek 47b04ef632
Merge pull request #16925 from cgzones/selinux_create_label
selinux/core: create several file objects with default SELinux context
2020-09-01 22:19:52 +02:00
Lennart Poettering 004cfad218
Merge pull request #16911 from keszybz/userdb-json-invalid-utf8
Deal properly with invalid utf-8 in userdb entries
2020-09-01 20:34:22 +02:00
Zbigniew Jędrzejewski-Szmek 2c0e46735b
Merge pull request #16922 from keszybz/ordered-set-ensure-allocated
Ordered set ensure allocated
2020-09-01 19:44:28 +02:00
Lennart Poettering 278fdd064d man: document the new libudev APIs 2020-09-01 17:40:13 +02:00