Commit Graph

54555 Commits

Author SHA1 Message Date
Luca Boccassi
4792cc5f63 test runner: print time before/after tests
When a timeout occurs we actually can't see when the test started/stopped. Print the time.
2021-11-22 09:05:00 +00:00
Zbigniew Jędrzejewski-Szmek
0895e87348 analyze: fix printing config when there is no main config file
Since 8b8024f1c2 and the follow-up commits, the
main config file may be located in /usr or in other paths. But the code in
analyze.c was still assuming that it must be in /etc. Things mostly worked for
our own config files because we usually install a comments-only file in /etc,
but was not correct in the general case.

This fixes in particular 'systemd-analyze cat-config systemd/zram-generator.conf'.
In Fedora we distribute a config file in zram-generator-defaults.rpm that is in
/usr/lib, and 'cat-config' would refuse to show it because
/etc/systemd/zram-generator.conf does not exist.

The main config file is optional, but let's print an informative message
because this is a slightly unusual case.

The file paths that we printed were missing the root prefix.
2021-11-21 12:10:51 +00:00
Luca Boccassi
289a42304d Merge pull request #21432 from DaanDeMeyer/journal-trivial-fixes
Journal trivial fixes
2021-11-20 18:00:35 +00:00
Luca Boccassi
26bae8109d Merge pull request #21431 from DaanDeMeyer/issue-19799
journal: Limit the number of audit fields we add to a message
2021-11-20 17:58:51 +00:00
Lennart Poettering
a50966416e nspawn: use FOREACH_STRING() more 2021-11-20 17:54:53 +00:00
Christian Göttsche
7e570d575f core: prefix functions to avoid identical static function names
The function name `method_reload` is used both in dbus-unit.c and
dbus-manager.c for static functions.
With the previous addition of adding the function name to the audit
information on SELinux denials, rename the one (and its relatives) in
dbus-unit.c as most of the functions in src/core/dbus-unit.c are already
prefixed with `bus_unit_`.
2021-11-20 16:38:03 +00:00
Christian Göttsche
963438a027 selinux: name mac_selinux_generic_access_check as internal function
`mac_selinux_generic_access_check()` should not be called directly, only
via the wrapper macros `mac_selinux_access_check` and
`mac_selinux_unit_access_check`.
2021-11-20 16:38:03 +00:00
Christian Göttsche
6fbb33f631 selinux: improve debug log format
path might be NULL when checking against the system permissions, so wrap
with strna().

The command line might not be available over D-Bus and thus cl might be
empty. Print "n/a" instead of the empty string.
2021-11-20 16:38:03 +00:00
Christian Göttsche
f0804759cf selinux: add function name to audit data
Include the systemd C function name in the audit message to improve the
debug ability on denials.
Similar like kernel denial messages include the syscall name.
2021-11-20 16:38:03 +00:00
Daan De Meyer
66e2bb282b journal: Limit the number of audit fields per log message
Similar to the kmsg handler, let's also limit the number of fields
we parse from audit messages.

Fixes #19799
2021-11-19 18:50:59 +00:00
Daan De Meyer
368a14b67b journal: Add verify_hash_table()
The existing verify_hash_table() function is renamed to
verify_data_hash_table() since it only verifies the data hash table.

The verify information is also made a little more detailed by splitting
one of the checks in two.
2021-11-19 17:12:29 +00:00
Daan De Meyer
363b2b9aaf journal: Add journal_file_object_to_string() 2021-11-19 17:12:27 +00:00
Daan De Meyer
b92d1eba31 journal: Simplify definition of HEADER_INCOMPATIBLE_SUPPORTED 2021-11-19 17:06:57 +00:00
Daan De Meyer
d164ac771e journal: Use more structured initialization 2021-11-19 17:06:57 +00:00
Daan De Meyer
86e68f3814 journal: Use size_t instead of unsigned for array sizes 2021-11-19 17:06:55 +00:00
Lennart Poettering
1ccfb792e4 update TODO 2021-11-19 15:40:08 +01:00
Lennart Poettering
49d5e4d0bb doc: rebreak boot loader spec 2021-11-19 15:40:08 +01:00
Lennart Poettering
14efbfd96d docs: clarify the assumption on numeric values of JSON parsers we make
Prompted by:

https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/BOBD6KVTXPR6K5ANAX6LIJLKNSGXCR3B/
2021-11-19 15:10:37 +01:00
Zbigniew Jędrzejewski-Szmek
e55ed6aa85 Merge pull request #21444 from poettering/gpt-test
tests: dump table of archs + wether gpt partition type exists
2021-11-19 15:08:36 +01:00
Daniel Maixner
324b410341 removed copyright 2021-11-19 13:39:01 +00:00
Lennart Poettering
bab5077098 test-gpt: add test that shows for which archs we have GPT partition types 2021-11-19 11:23:36 +01:00
Lennart Poettering
f6ec896bc1 gpt: make gpt_partition_type_uuid_from_string() return parameter optional 2021-11-19 11:23:36 +01:00
Lennart Poettering
f85b12d6fd strv: make sure FOREACH_STRING() can be nested 2021-11-19 11:23:36 +01:00
Evgeny Vereshchagin
2fd1beb3e2 oss-fuzz: move apt-gets and pips to the systemd repository
to be able to control our dependencies right here without
sending PRs like https://github.com/google/oss-fuzz/pull/5199 and
https://github.com/google/oss-fuzz/pull/5601.

It should also allow us to pin meson to let Dependabot keep track of
it and jump from one version to another without breaking anything
2021-11-19 08:52:28 +00:00
Zbigniew Jędrzejewski-Szmek
39c37ca2d2 Merge pull request #21436 from yuwata/network-bus-introspect
network: add --bus-introspect option
2021-11-19 09:42:46 +01:00
Thomas Blume
6e8791a042 systemd-coredump: allow setting external core size to infinity
Make it compatible to the ulimit setting: unlimited
2021-11-19 09:23:52 +01:00
Lennart Poettering
548614cc9a Merge pull request #21420 from DaanDeMeyer/journal-enumerate-skip
journal: Skip over corrupt entry items in enumerate_data()
2021-11-19 09:23:17 +01:00
Lennart Poettering
5c9da90d1d Merge pull request #21411 from poettering/homed-maximize
homed: add concept for "maximizing" home dirs
2021-11-19 09:22:11 +01:00
Yu Watanabe
cc0f820960 Merge pull request #21435 from yuwata/network-cleanups-for-alternative-names
network: cleanups for alternative names
2021-11-19 12:05:04 +09:00
Yu Watanabe
a72d2a7bca network: always try to reconfigure when carrier gained
When networkd detects a wlan interface, the interface may not be
connected to any access point, and may enter the unmanaged state.
After the interface connected to an access point, previously networkd
did not reconfigure the interface. This fixes the issue.
2021-11-19 12:04:42 +09:00
Lennart Poettering
9f5827e01c homectl: parse "min" and "max" as special disk size values 2021-11-19 00:05:53 +01:00
Lennart Poettering
41caad6fcc test: extend homed test to test home dir "maximization"
This moves the backing store to a separate tmpfs which we can nicely put
a size limit on to make sure we can test maximization sanely: if we ask
for the home dir to be grown really large it should effectively only be
grown until the size of the backing tmpfs.

(While we are at it, also set a cheaper KDF so that we don't waste CI
cycles for password hashing that aren#t secure anyway.)
2021-11-19 00:05:53 +01:00
Lennart Poettering
2b02eb0591 homework: also add logic for "maximizing" size of home 2021-11-19 00:05:53 +01:00
Lennart Poettering
34081f6be7 homework: make it safe to invoke home_setup_luks() twice in a row
Being able to invoke the call twice on the same HomeSetup object will
simplify auto-growing/auto-shrinking since we can issue a resize
operatio directly from activate/deactivate
2021-11-19 00:05:53 +01:00
Lennart Poettering
5813fca61f homework: make destroying of HomeSetup optional when resizing
This will be useful when we want to issue a resize operation right when
activating, where the HomeSetup object should be destroyed only after
both activation is done.
2021-11-19 00:05:53 +01:00
Yu Watanabe
558434a4aa man: add new man page org.freedesktop.network1 2021-11-19 07:23:40 +09:00
Yu Watanabe
6b4c1c9f3c network: support --bus-introspect option 2021-11-19 06:50:02 +09:00
Yu Watanabe
6e194652b8 network: use BusObjectImplementation 2021-11-19 06:49:25 +09:00
Daan De Meyer
8a799bed4c journal: Skip corrupt Data objects in sd_journal_get_data()
Similar to the change we made for sd_journal_enumerate_data(), let's
skip corrupt entry items and data objects in sd_journal_get_data().
2021-11-18 21:43:17 +00:00
Daan De Meyer
847c7ee8c3 journal: Use separate variable for Data object in sd_journal_get_data()
A little cleanup to make the next change easier. We're not moving to a
new Entry object in the for loop so there's no danger of changing the
Entry object window.
2021-11-18 21:43:17 +00:00
Daan De Meyer
5a94a2bf2b journal: Skip over corrupt entry items in enumerate_data()
Similar to sd_journal_next(), if trying to access an entry item
offset's data results in EBADMSG, skip to the next entry item so
we handle corruption better.

Fixes #21407
2021-11-18 21:43:15 +00:00
Yu Watanabe
1b345c1e3b network: skip re-generating map from alternative names to link 2021-11-19 06:13:02 +09:00
Yu Watanabe
50df02a705 network: do not clear map from alternative names to link when IFLA_PROP_LIST attribute is not contained
No IFLA_PROP_LIST attribute contained does not means the interface
has no alternative name.
E.g. the message created by inet6_fill_ifinfo() in net/ipv6/addrconf.c
does not contain IFLA_PROP_LIST.
2021-11-19 06:13:02 +09:00
Frantisek Sumsal
1285252823 test: make the diff regex BRE-compatible
Since the GNU `diff` utility uses grep-style regular expressions[0], which
use the BRE style, we need to tweak the regex to make it work properly
(most notably - in BRE the meta characters need to be escaped).

```
$ diff a b
21c21
<   Volume Key: 256bit
---
>   Volume Key: 257bit
25c25
< Disk Ceiling: 323.2M
---
> Disk Ceiling: 323.1M

$ diff -I '^\s*Disk (Size|Free|Floor|Ceiling):' a b
21c21
<   Volume Key: 256bit
---
>   Volume Key: 257bit
25c25
< Disk Ceiling: 323.2M
---
> Disk Ceiling: 323.1M

$ diff -I '^\s*Disk \(Size\|Free\|Floor\|Ceiling\):' a b && echo OK
21c21
<   Volume Key: 256bit
---
>   Volume Key: 257bit
```

Caught in one of the nightly CentOS CI cron jobs.

[0] https://www.gnu.org/software/diffutils/manual/html_node/Specified-Lines.html
2021-11-18 21:06:04 +00:00
Daan De Meyer
9c41618008 journal: Don't discard kmsg messages coming from journald itself
Previously, we discarded any kmsg messages coming from journald
itself to avoid infinite loops where potentially the processing
of a kmsg message causes journald to log one or more messages to
kmsg which then get read again by the kmsg handler, ...

However, if we completely disable logging whenever we're processing
a kmsg message coming from journald itself, we also prevent any
infinite loops as we can be sure that journald won't accidentally
generate logging messages while processing a kmsg log message.

This change allows us to store all journald logs generated during
the processing of log messages from other services in the system
journal. Previously these could only be found in kmsg which has
low retention, can't be queried using journalctl and whose logs
don't survive reboots.
2021-11-18 19:37:17 +00:00
Franck Bui
86bd939d7f TEST-12: make sure 'adm' group exist
'adm' group is not available on openSUSE.
2021-11-18 19:13:17 +00:00
Luca Boccassi
21d00e52db man/kernel-command-line: add reference to getty_auto variable
Follow-up for #21422
2021-11-18 15:29:43 +00:00
Luca Boccassi
26b2832992 Merge pull request #21424 from keszybz/json-double
Use double and int64_t types in json
2021-11-18 13:37:20 +00:00
Daan De Meyer
ceb4192df6 journal: Use mf as variable name for MapField
So we can have a variable m for the max iovec size in the next
commit like we do in the rest of the journal logic.
2021-11-18 13:28:14 +00:00
Daan De Meyer
4cdb970b5b journal: Use consistent naming for iovec in audit logic
Let's use iovec and n for the iovec variable and it's size just like
we do in the rest of the journal code.
2021-11-18 13:28:08 +00:00