Commit Graph

43545 Commits

Author SHA1 Message Date
Yu Watanabe
17bd68ca74 Merge pull request #27874 from keszybz/test-bus-server-shortening
Simplify the code in test-bus-server
2023-06-01 21:10:55 +09:00
Lennart Poettering
614ac89d30 test-sizeof: let's be a tiny bit more careful when using glibc internal types
One can argue that internal glibc types (i.e. those starting with __)
are not really part of the glibc API, hence let's at least ifdef them.
2023-06-01 21:10:04 +09:00
Zbigniew Jędrzejewski-Szmek
fcc54d1dfe Merge pull request #27856 from arianvp/fix-bootctl-status
bootctl: Print version number of detected binaries again
2023-06-01 10:25:30 +02:00
Zbigniew Jędrzejewski-Szmek
70b1676578 test-bus-server: simplify return value handling
Follow-up for f7794e423a.
2023-06-01 09:57:23 +02:00
Zbigniew Jędrzejewski-Szmek
fa18faf1c0 various: remove typo/unusual spelling
Wikitionary says that "noone" is known, but not preferred by a large margin.
(It's also an obsolete spelling of "noon".)
2023-06-01 09:56:14 +02:00
Yu Watanabe
041d8ad857 Merge pull request #27796 from yuwata/memstream-util
util: introduce memstream-util
2023-06-01 12:07:17 +09:00
Rene Hollander
930133d5df networkd/dhcpserver: Save and expose the client hostname sent when requesting a DHCP lease.
DHCP clients often send their own hostname in option 12. It can be useful
to store it with the lease so it can be shown to a human to easily identify
which lease belongs to which device.

RFC: https://www.rfc-editor.org/rfc/rfc2132#section-3.14
2023-06-01 06:51:45 +09:00
Yu Watanabe
2485b7e2b8 tree-wide: use memstream-util 2023-06-01 06:48:47 +09:00
Yu Watanabe
abe72100cf util: introduce memstream-util
There is many pitfalls in using memstream.
Let's introduce a wrapper to make us safely use it.
2023-06-01 06:48:43 +09:00
Yu Watanabe
24b0c6c2c9 calendarspec: rename arguments 2023-06-01 06:47:48 +09:00
Yu Watanabe
a694747d45 elf-util: rename stack_context_destroy() -> stack_context_done() 2023-06-01 06:47:48 +09:00
Yu Watanabe
3256e2027b sd-bus: rename introspect_free() -> introspect_done 2023-06-01 06:47:48 +09:00
Yu Watanabe
5d2a48da12 tree-wide: use _cleanup_set_free_ and friends
Instead of _cleanup_(set_freep) or so.
2023-06-01 06:47:48 +09:00
Yu Watanabe
64377c6089 oomd: drop unused key 2023-06-01 06:47:48 +09:00
Yu Watanabe
cc4d38b14b core/cgroup: fix setting SocketBindAllow=/SocketBindDeny= through DBus 2023-06-01 06:47:48 +09:00
Michal Sekletar
89e9df12b3 core/transaction: drop job that has unfulfilled required (Requires, BindsTo) dependencies
Resolves: #11338
2023-06-01 06:45:51 +09:00
Yu Watanabe
322bda8241 Merge pull request #27826 from yuwata/network-link-ready-without-ndisc-when-has-static-address
network: do not request dynamic addressing protocols finished when at…
2023-06-01 06:29:55 +09:00
Daan De Meyer
7d52bf16e7 Merge pull request #27628 from ddstreet/tpm2_header_cleanup
Tpm2 header cleanup
2023-05-31 23:06:14 +02:00
Daan De Meyer
c4b7e0f812 Merge pull request #27844 from DaanDeMeyer/repart-arch
repart: Add --architecture option
2023-05-31 23:00:19 +02:00
Yu Watanabe
2f96a29c2c wait-online: request that at least one managed online interface exists
Fixes a regression caused by ab3aed4a03.

I thought the commit does not cause any severe regression. However,
drivers for network interfaces may be loaded later. So, we should wait
if no network interface is found.

Fixes #27822.
2023-05-31 22:12:03 +02:00
Lennart Poettering
38c86ce329 Merge pull request #27861 from poettering/find-esp-tweaks
minor tweaks to find-esp.c
2023-05-31 15:42:05 +02:00
Daan De Meyer
edabe6fc11 Merge pull request #27806 from DaanDeMeyer/fix-mkosi-check
mkosi: Use proper check to detect whether we're in a VM
2023-05-31 15:26:05 +02:00
Dan Streetman
ba723ea260 tpm2: sort tpm2 symbol list
Only cosmetic, no functional change.
2023-05-31 09:23:22 -04:00
Dan Streetman
b57a7b3d9b tpm2: remove all extern tpm2-tss symbols
These library syms should be restricted to use only in tpm2-util.c,
and all other code should use simpler functions exported in tpm2-util.h.

Also move the Esys_Freep() cleanup function into tpm-util.c, and make
tpm2-tss symbols static.
2023-05-31 09:23:22 -04:00
Dan Streetman
9944909e68 tpm: remove external calls to dlopen_tpm2()
The calls outside tpm2-util.c are redundant, as tpm2_context_new()
is always called immediately after, which then calls dlopen_tpm2().
2023-05-31 09:23:21 -04:00
Daan De Meyer
2533fdd0fb Merge pull request #27766 from rphibel/cleanup-cgroups-before-cleaning-units
Don't GC unit if it is in cgroup_empty_queue
2023-05-31 14:48:42 +02:00
Daan De Meyer
05d1cbb33c Merge pull request #26969 from DaanDeMeyer/xopenat-label
fs-util: Add labelling support to xopenat()
2023-05-31 14:35:50 +02:00
Arian van Putten
a680d4fb87 bootctl: also print efi files not owned by systemd in status
We should not skip over unknown entries in EFI/BOOT/ but
also print them out in status so people are aware that they are there.
2023-05-31 14:30:31 +02:00
Daan De Meyer
5fbcad01c1 sd-daemon: Add debug logging 2023-05-31 14:19:25 +02:00
Daan De Meyer
bdee762b8c sd-daemon: Introduce pid_notify_with_fds_internal()
No change in behavior, just refactoring
2023-05-31 14:19:25 +02:00
Lennart Poettering
cbf21d1432 Merge pull request #27860 from poettering/loopback-no-prefix-route
loopback-setup: only create a single loopback route when configuring 'lo'
2023-05-31 14:03:04 +02:00
Daan De Meyer
9786dfe60f repart: Add --architecture option
This option allows overriding the architecture that's used for the
architecture specific partition types. This is useful to allow
reusing the same repart configuration to produce the same image for
different architectures.
2023-05-31 13:58:16 +02:00
Daan De Meyer
7767b83f4a gpt: Add gpt_partition_type_override_architecture()
Let's add a function that allows changing the architecture of a given
partition type.
2023-05-31 13:48:13 +02:00
Daan De Meyer
716a413a7d gpt: Use FOREACH_ARRAY 2023-05-31 13:32:23 +02:00
Daan De Meyer
420d2e3136 fs-util: Add XOpenFlags with XO_LABEL flag to have xopenat() MAC label files/dirs 2023-05-31 13:15:56 +02:00
Daan De Meyer
a452c807a4 label: Introduce LabelOps to do pre/post labelling operations
By default, label_ops is initialized with a NULL pointer which translates
to noop labelling operations. In mac_selinux_init() and the new mac_smack_init(),
we initialize label_ops with a MAC specific LabelOps pointer.

We also introduce mac_init() to initialize any configured MACs and replace all
usages of mac_selinux_init() with mac_init().
2023-05-31 13:15:53 +02:00
Luca Boccassi
840d3b1522 Merge pull request #27858 from mrc0mmand/followups
Use structured initialization in two more places
2023-05-31 11:09:53 +01:00
Luca Boccassi
1a7e5c51dc Merge pull request #27853 from keszybz/various-bits-and-pieces-included-to-reuse-the-ci-run
Various bits and pieces included to reuse the ci run
2023-05-31 11:08:36 +01:00
Luca Boccassi
5aab673dd1 Merge pull request #27840 from mrc0mmand/gcc-13
ci: add gcc-13, drop gcc-12
2023-05-31 11:07:22 +01:00
Luca Boccassi
29084afd91 Merge pull request #27519 from yuwata/journalctl-fixes
journalctl: several fixes and cleanups for --follow
2023-05-31 11:05:54 +01:00
Lennart Poettering
f734b2cc66 test-loopback: run test in network + user namespace
This way it can actually do useful testing even when unprivileged.
2023-05-31 11:11:45 +02:00
Lennart Poettering
53d883d30d loopback-setup: clean up logging
All users of loopback_setup() ignore the return values (with the notable
exception of the test cases). Hence let's adjust the log messaging to
always log at LOG_WARNING level at most, and suffix messages with ",
ignoring", to make clear these failures are ignored.
2023-05-31 11:11:45 +02:00
Lennart Poettering
8557425aaf loopback-setup: set IFA_F_NOPREFIXROUTE when configuring 'lo' ipv6 address
Otherwise the kernel will set up two routes to ::1, one in the "main",
and one in the "local" routing table.

Fixes: #25819
2023-05-31 11:11:45 +02:00
Lennart Poettering
14e5c99236 find-esp: drop some redundant 'else' 2023-05-31 10:12:47 +02:00
Lennart Poettering
0b2aa2064f find-esp: change "unprivileged_mode" parameter to be tristate
Previously, unprivileged mode for find_esp_and_warn() and
find_xbootldr_and_warn() could be enabled or disabled. With this change
it can also be set to negative in which case the functions will enable
it automatically if found to be executing without privileges.

This just moves te geteuid() check we often do for the param inside of
the functions.

At the same time internally in the functions we also pass around the
VerifyESPFlags field across the various functions instead of booleans.

Both changes are just refactoring. No changes in behaviour.
2023-05-31 10:12:47 +02:00
Frantisek Sumsal
f018fad483 sd-network: use structured initialization
And squash one unnecessary assignment.
2023-05-30 21:35:33 +02:00
Frantisek Sumsal
9f91d2fbde journal-remote: use structured initialization 2023-05-30 21:18:08 +02:00
Arian van Putten
80ed800df7 bootctl: Print version number of detected binaries
In 9b9f6aa412 (#27069)
we changed get_file_version to return 0 instead of 1 on success.
However we did not update the printing of the version number to
handle this change so we would never print the version number.
2023-05-30 19:20:55 +02:00
Frantisek Sumsal
241ecd1cc2 core,shared: add a couple of asserts
To appease the LTO overlords:

In file included from ../../../../src/basic/macro.h:446,
                 from ../../../../src/shared/blockdev-util.h:8,
                 from ../../../../src/shared/creds-util.c:11:
../../../../src/shared/creds-util.c: In function 'get_credential_host_secret':
../../../../src/shared/creds-util.c:379:52: error: '%s' directive argument is null [-Werror=format-overflow=]
  379 |                                 log_debug_errno(r, "Credential secret %s/%s appeared while we were creating it, rereading.",
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../src/basic/log.h:214:86: note: in definition of macro 'log_full_errno_zerook'
  214 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../../../../src/basic/log.h:250:41: note: in expansion of macro 'log_full_errno'
  250 | #define log_debug_errno(error, ...)     log_full_errno(LOG_DEBUG,   error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
../../../../src/shared/creds-util.c:379:33: note: in expansion of macro 'log_debug_errno'
  379 |                                 log_debug_errno(r, "Credential secret %s/%s appeared while we were creating it, rereading.",
      |                                 ^~~~~~~~~~~~~~~
../../../../src/shared/creds-util.c:379:74: note: format string is defined here
  379 |                                 log_debug_errno(r, "Credential secret %s/%s appeared while we were creating it, rereading.",
      |                                                                          ^~
cc1: some warnings being treated as errors

../../../../src/core/transaction.c: In function 'transaction_verify_order_one':
../../../../src/core/transaction.c:338:38: error: '%s' directive argument is null [-Werror=format-overflow=]
  338 |                 sprintf(ans + size, "%s%s", unit_log_field, *unit_id);
      |                                      ^~
cc1: some warnings being treated as errors
2023-05-30 16:23:40 +02:00
Zbigniew Jędrzejewski-Szmek
5ad6600364 test-dlopen: allow loading of multiple libraries
This is useful for debugging, for example if we want to test multiple different
dlls being loaded in the same namespace.
2023-05-30 16:05:06 +02:00