1
0
mirror of https://github.com/systemd/systemd synced 2024-07-03 08:29:25 +00:00
Commit Graph

74348 Commits

Author SHA1 Message Date
Mike Yuan
2128085d0c
selinux-util: make type of cleanup func void
Follow-up for 6623c64a02

Return values are pointless for _cleanup_ functions, and
this matches what we do in DEFINE_TRIVIAL_CLEANUP_FUNC().
2024-06-15 13:05:50 +02:00
Mike Yuan
c89d1e425a
missing_loop: add missing assertions for fallback values 2024-06-15 13:05:50 +02:00
Mike Yuan
e4308ac783
macro-fundamental: correct comment and remove trailing ';' for macro
Follow-up for 3c2f2146f5
2024-06-15 12:57:55 +02:00
Mike Yuan
609bc3ae16
Merge pull request #33037 from keszybz/dlopen-open-code-definitions
Make dlopen macros more explicit and drop mac_selinux_free()
2024-06-15 12:49:59 +02:00
Lennart Poettering
3d6c2c918b json: extend JsonDispatch flags with nullable and refuse-null flags
currently when dispatching json objects into C structs we either insist
on the field type or we don't. Let's extend this model a bit: depending
on two new fields either allow or refuse null types in addition to the
specified type.

This is useful for example when dispatch enums as this allows us
explicitly refuse null in various scenarios where we allow multiple
types.
2024-06-15 10:58:02 +01:00
Lennart Poettering
26279199cf varlink: handle NULL varlink server object gracefully in varlink_server_current_connections()
let's treat a NULL server as a server with zero connections, to make
things more convenient to use.
2024-06-15 10:57:14 +01:00
Lennart Poettering
4db747b0dd machined: use bus_message_read_id128() at one more place 2024-06-15 01:19:31 +01:00
Luca Boccassi
05e69717fa
Merge pull request #33329 from poettering/varlink-idl-tweaks
varlink-idl: align continuation line character \
2024-06-15 01:18:37 +01:00
Lennart Poettering
aab74e1d93 pretty-print: enable stdio buffering while outputting progress bar
Writing the progress bar so far was irritatingly slow, which was caused
by the fact that the various things we output so far resulted in one
write() syscall each because STDERR is unbuffered by default.

Let's fix that, and temporarily turn on full buffering for stderr,
restoring the normal unbuffered output right after.

This makes progress bar print visibly more efficient (and flicker free
too, since terminals no longer will move the cursor around during
output).
2024-06-15 01:18:10 +01:00
Lennart Poettering
bba55185de utf8: let utf8_console_width() handle NULL strings somewhat reasonably 2024-06-15 00:46:42 +01:00
Luca Boccassi
78fb0ca46d
Merge pull request #33325 from poettering/vsock-ret-optional
socket-util: make return parameter for socket_address_parse_vsock() o…
2024-06-15 00:45:28 +01:00
Lennart Poettering
4fae650ad8 json: add sd_json_dispatch_double() helper 2024-06-15 00:43:56 +01:00
Luca Boccassi
10880ae3c4
Merge pull request #33334 from poettering/machined-more-pidfd
machined: prefer pinning clients via pidfd when creating machine, rat…
2024-06-15 00:13:50 +01:00
Luca Boccassi
67153a7bc4
Merge pull request #33330 from poettering/copy-tweaks
Minor tweaks to copy_bytes()
2024-06-15 00:12:48 +01:00
Raphaël Mélotte
56ab1c5449 src/basic/missing_loop.h: fix missing LOOP_SET_BLOCK_SIZE
Builds with kernels headers < 4.14 fail with:

../src/shared/loop-util.c: In function ‘loop_configure_fallback’:
../src/shared/loop-util.c:237:31: error: ‘LOOP_SET_BLOCK_SIZE’ undeclared (first use in this function); did you mean ‘LOOP_SET_DIRECT_IO’?
                 if (ioctl(fd, LOOP_SET_BLOCK_SIZE, (unsigned long) c->block_size) < 0)
                               ^~~~~~~~~~~~~~~~~~~
                               LOOP_SET_DIRECT_IO

Fixes: https://github.com/systemd/systemd/issues/33341

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
2024-06-15 00:01:44 +01:00
Nick Rosbrook
9ebcac3b51 man: add a bit of a warning to systemd-tmpfiles --purge
Mention that by default, /home is managed by tmpfiles.d/home.conf, and
recommend that users run systemd-tmpfiles --dry-run --purge first to
see exactly what will be removed.
2024-06-15 00:00:53 +01:00
Lennart Poettering
7d9a8cc4ac creds-util: add common helper for determinign global boot credentials path
It's very useful being able to determine the directory where to write
global boot credentials to, that are picked up by all kernels.
2024-06-14 23:52:35 +01:00
Lennart Poettering
c29778a100 fs-util: add simple open_mkdir() wrapper 2024-06-14 23:50:59 +01:00
Lennart Poettering
b22635083a string-util: make sure strrepa() doesn't doubly evaluate expressions 2024-06-14 23:50:03 +01:00
Lennart Poettering
94a8a4b063 pcrlock: move event_log_reduce_to_safe_pcrs() down a bit
Let's keep the verb_lock_xyz() and verb_unlock_xyz() calls together, and
move event_log_reduce_to_safe_pcrs() which so far was in betwee them all
further down closer to where the function is actually used.
2024-06-14 22:51:05 +01:00
Lennart Poettering
e2f451d876 pcrlock: don't override conf_root parameter for boot_entry_token_ensure()
if we pass NULL boot_entry_token_ensure() will use its own default,
which is the same as what we passed so far explicitly, hence let's make
use of that.
2024-06-14 22:50:47 +01:00
Lennart Poettering
dc163cd40b fileio: add new helper write_base64_file_at() which encodes a binary object into base64 and writes it to a file 2024-06-14 22:50:33 +01:00
Lennart Poettering
73fade298a vmspawn: report "systemd-vmspawn" as "service" to machined
The "service" field that one is supposed to pass to machine is supposed
to indicate the implementation of the client, not the service unit the
client runs in (which is typically even a scope unit, not a system
unit). Hence fix that, and make it closely match what systemd-nspawn
does.
2024-06-14 21:22:02 +01:00
Lennart Poettering
9ace806fcb nspawn: use parse_boolean_argument() at two places 2024-06-14 21:21:06 +01:00
Lennart Poettering
b4aaba2bb0 utf8: assume tabs are 8 characters wide when written to console 2024-06-14 21:17:20 +01:00
Cristian Rodríguez
3c2f2146f5 fundamental: declare flex array updated for gcc15 and clang 19
Silly workaround that:
- allowed flexible arrays in unions
- allowed flexible arrays in otherwise empty structs

Is no longer needed since https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=adb1c8a0f167c3a1f7593d75f5a10eb07a5d741a
(GCC15) or clang 19 14ba782a87
2024-06-14 21:13:28 +01:00
Lennart Poettering
9b2d9b07a1 copy: increase copy buffer from 16K to 64K
In my tests here this tremendously speeds up things when initializing a
1G file from /dev/urandom
2024-06-14 13:44:29 +02:00
Lennart Poettering
0de442ac31 copy: when a progress callback is provided, never copy more than 1M per iteration
Otherwise if we have to fill GB of data we might never call into the
callback, hence put some limit on how much to copy per iteration.
2024-06-14 13:44:29 +02:00
Lennart Poettering
22ed8700c7 copy: rework how we determine the number of bytes to copy in copy_bytes_full()
Let's freshly calculate "m" on each iteration and always start with the maximum
size we can. If sendfile() is used we must adhere to its limit of
SSIZE_MAX minus the current offset. Otherwise we can copy more, i.e.
SSIZE_MAX without any restrictions.

Also, if we get too close to having copied SSIZE_MAX, let's turn off
sendfile() for the rest.
2024-06-14 13:44:28 +02:00
Lennart Poettering
432977a0a4 iovec-util: add exported constant empty but valid (i.e. non-NULL) iovec
Also, make sure the NUL byte iovec becomes an exported constant too.

This is better than the previous situation where this was a macro
resolving to a compount expression, since the lifetime of the expression
is limited to its invoking scope. By turning this into a proper variable
the lifetime becomes unbounded, which makes it easier to use in various
scenarios, such as "if" blocks.
2024-06-14 12:42:07 +01:00
Lennart Poettering
acaca5ab25 analyze: show pcrs also in sha384 bank
SHA384 is pretty much the bank we actually *want* to use, since it's
faster to calculate than SHA256, hence at the very least, start
considering.
2024-06-14 12:39:40 +01:00
Lennart Poettering
0870654241 machined: use pidref instead of just pid when determining unit of pid when registering machine 2024-06-14 13:26:30 +02:00
Lennart Poettering
92a6f21484 machined: prefer pinning clients via pidfd when creating machine, rather than PID 2024-06-14 13:26:30 +02:00
Lennart Poettering
4198ff4c6a machined: modernize method_create_or_register_machine() return parameter naming 2024-06-14 13:24:52 +02:00
Lennart Poettering
99421eb1ef
Merge pull request #33312 from poettering/cryptsetup-merge-no-token
cryptsetup: merge two mostly equivalent functions
2024-06-14 13:24:08 +02:00
Lennart Poettering
13e6b823a9 tpm2-util: make one sd_json_dispatch_field[] table static const 2024-06-14 13:22:47 +02:00
Lennart Poettering
c16ac6ce94 varlink-idl: include line/column in a parse log msg 2024-06-14 11:23:42 +02:00
Lennart Poettering
901519d583 varlink-idl: align continuation line character \ 2024-06-14 11:22:22 +02:00
Lennart Poettering
cb869969d1 machined: initialize CID of '.host' pseudo-machine to 1 (i.e. the loopback vsock address) 2024-06-14 11:13:36 +02:00
Lennart Poettering
59c8110ac6 socket-util: make return parameter for socket_address_parse_vsock() optional 2024-06-14 11:12:56 +02:00
Lennart Poettering
8a4883dbc3 cryptsetup: downgrade log message to warning, when we ignore it 2024-06-14 10:10:37 +02:00
Lennart Poettering
86854ee6e6 cryptsetup: merge two mostly equivalent functions 2024-06-14 10:09:00 +02:00
Lennart Poettering
828e52bf8f sd-json: make static analyzers shut up
https://github.com/systemd/systemd/pull/32628#pullrequestreview-2115501478
2024-06-13 17:53:33 +02:00
Luca Boccassi
a2979bb842
Merge pull request #33046 from poettering/varlinkctl-quiet
varlinkctl: add --quiet/-q switch for suppressing method call reply output
2024-06-13 16:17:17 +01:00
Mike Yuan
0160a1dbbc io-util: move fputs_with_newline to fileio
Follow-up for cdf6f34a2f

We already have other fputs()-like helpers in fileio rather than
io-util. While at it, switch the order of params.
2024-06-13 15:56:02 +01:00
Lennart Poettering
c43d439307 namespace: rename 'n' to 'n_mount_images'
Let's make clear what this actually counts (at least initially).
2024-06-13 15:55:30 +01:00
Kamil Szczęk
d5fa6e6ca7 cryptsetup: manual FIDO2 PIN, UP and UV configuration
When in FIDO2 mode with manual parameters, i.e. when not reading the
parameters off the LUKS2 header, the current behavior in regards to PIN,
UP and UV features is to default to v248 logic, where we use PIN + UP
when needed, and do not configure UV at all. Let's allow users to
configure those features in manual mode too.
2024-06-13 13:50:39 +02:00
Luca Boccassi
7cddd19236
Merge pull request #33257 from YHNdnzj/unit-notify-cleanup
core/unit: several cleanups
2024-06-13 11:30:42 +01:00
Lennart Poettering
710ade3a84 varlinkctl: as convencience to users, accept empty string in place of {} for empty parameter list
It makes it a bit easier to use "varlinkctl call", since you can just
hit ^D to call a function without params, instead of spelling out {}.
2024-06-13 11:32:34 +02:00
Lennart Poettering
aa413d5fc6 ci: add superficial --quiet testcase 2024-06-13 11:31:44 +02:00