Commit graph

74321 commits

Author SHA1 Message Date
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
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
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
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
Lennart Poettering
273b96f9fa varlinkctl: tell user we are expecting method call parameters on STDIN
When calling a method and the user hasn't provided any method call
parameters on the command line we expect them on stdin instead. This
might be confusing for people using varlinkctl for the first time, since
omitting the parameters will just throw you at a blinking cursor.

Let's be a bit more helpful, and show a friendly message when we are
connected to a TTY (i.e. run interactively).
2024-06-13 11:31:43 +02:00
Lennart Poettering
cd4e9166bb varlinkctl: add "-q" switch for suppressing varlinkctl output 2024-06-13 11:30:52 +02:00
Lennart Poettering
aacbc2acb9 json: move empty string check from json_parse_file_at() to json_parse_with_source()
That way this error is generalized and applies to either function, since
one is just a wrapper to the other, normalizing behaviour.
2024-06-13 11:30:12 +02:00
Lennart Poettering
639256f380
Merge pull request #33012 from poettering/varlinkctl-list-methods
varlinkctl: make interface parameter for "varlinkctl introspect" optional, and add "list-methods" verb
2024-06-13 11:05:07 +02:00
Lennart Poettering
7811864b08 CODING_STYLE: document "reterr_" return parameters
In some recent PRs (e.g. #32628) I started to systematically name return
parameters that shall only be initialized on failure (because they carry
additional error meta information, such as the line/column number of
parse failures or so). Let's make this official in the coding style.
2024-06-13 09:51:35 +02:00
Lennart Poettering
e1ef88e56e test: add test for new varlinkctl features 2024-06-13 09:37:15 +02:00
Lennart Poettering
16cfe84c24 varlinkctl: add new list-methods verb
For putting together "varlinkctl call" command lines it's useful to
quickly enumerate all methods implemented by a service. Hence, let's add
a new "list-methods" which uses the introspection data of a service to
quickly list methods.

This is implemented as a special flavour of the "introspect" logic,
and just suppresses all output except for the method names.
2024-06-13 09:37:15 +02:00
Lennart Poettering
2475b0e81a varlinkctl: make interface argument to "introspect" optional, and allow more than one
let's make it easier to use the introspection functionality of
"varlinkctl": if no interface name is shown, display the introspection
data of all available interfaces. Moreover, allow that multiple
interfaces can be listed, in which case we enumerate them all.

This relieves the user from having to list interfaces first in order to
find the ones which to introspect.
2024-06-13 09:35:23 +02:00
Lennart Poettering
18863534f8 varlinkctl: be friendly to later extensions of GetInfo Varlink call 2024-06-13 09:33:13 +02:00
Lennart Poettering
ef4bfa5524 pretty-print: make separator line grey
Let's deemphasize the line in the output a bit.
2024-06-13 09:33:13 +02:00
Lennart Poettering
cdf6f34a2f io-util: add new helper fputs_with_newline() 2024-06-13 09:33:13 +02:00
Lennart Poettering
c01ab8ffbc
Merge pull request #32628 from poettering/json-public
Make our JSON APIs a public interface sd-json.h
2024-06-13 09:03:13 +02:00
Lennart Poettering
d3be2a75ae sd-json: rename SD_JSON_SAFE → SD_JSON_STRICT
The flag is fairly generic these days and just selects a slightly
stricter validation, with details depending on the selected dispatch
function. Hence, let's give it more precise name, in particular one that
mirrors the SD_JSON_RELAXED flag nicely (which does the opposite:
relaxes parsing)
2024-06-12 18:42:44 +02:00
Lennart Poettering
f000a97be0 test: extend JSON test coverage 2024-06-12 18:42:44 +02:00
Lennart Poettering
86d754050b man: add brief intro page to new sd-json APIs 2024-06-12 18:42:22 +02:00
Lennart Poettering
309a747fa6 libsystemd: turn json.[ch] into a public API
This is preparation for making our Varlink API a public API. Since our
Varlink API is built on top of our JSON API we need to make that public
first (it's a nice API, but JSON APIs there are already enough, this is
purely about the Varlink angle).

I made most of the json.h APIs public, and just placed them in
sd-json.h. Sometimes I wasn't so sure however, since the underlying data
structures would have to be made public too. If in doubt I didn#t risk
it, and moved the relevant API to src/libsystemd/sd-json/json-util.h
instead (without any sd_* symbol prefixes).

This is mostly a giant search/replace patch.
2024-06-12 18:42:22 +02:00
Lennart Poettering
f2eb7716d0 json: merge json_dispatch_path() + json_dispatch_absolute_path()
The functions more or less do the same thing. Merge them.

This makes json_dispatch_path() the common resulting implementation. it
learnt:

1. Will reset the path to NULL if specified as null in JSON
2. Depending on the JSON_SAFE flag will insist on normalized path or not

With this the two implementations are identical, except for the
differences now toggable via JSON_SAFE flag
2024-06-12 18:39:03 +02:00
Yu Watanabe
b90eda90ae Reapply "network: add "mac" to alternatives name policy by default"
This reverts commit 152c8946b3.

The kernel patch
https://lore.kernel.org/linux-usb/20240605153340.25694-1-gmazyland@gmail.com/
is now in net-next branch, and will be hopefully merged soon.

Note that Debian's 73-usb-net-by-mac.link now also supports the kernel patch:
c1afbb2dc2

So, hopefully, the change is ready. Let's reapply it.
2024-06-12 18:05:09 +02:00
Lennart Poettering
6fecdd3cc5
Merge pull request #33100 from dtardon/crypttab-parse-all
cryptsetup-generator: continue parsing after error
2024-06-12 18:04:11 +02:00
Lennart Poettering
728c35d903
Merge pull request #33045 from poettering/exit-on-idle-tweaks
bus-util: honour new env var $SYSTEMD_ALLOW_IDLE to permit turning off exit-on-idle logic in hostnamed, timedated, …
2024-06-12 17:35:56 +02:00
Lennart Poettering
2af17b5e4c creds-util: fix "weak" vs. "secure" display for tmpfs/noswap backed credentials
When we display passed credentials we show a brief safety level based on
how the credential is pass in: if it's backed by swappable memory we
give it a "weak" level. This check was so far done by checking if the
file is backed by ramfs. However, since
1155f44f48 we actually prefer tmpfs with
the new "noswap" option for this.

Hence, fix this, and explicitly look for "noswap" among the mount
options in case we detect tmpfs.
2024-06-12 16:25:55 +01:00
David Tardon
bde35f4a91 shell-completion: only offer devices for completion
This skips directories and other stuff like /dev/core, /dev/initctl or
/dev/log.
2024-06-13 00:03:25 +09:00
Luca Boccassi
05095e1f3f
Merge pull request #33287 from bluca/release_doc
docs/news: updates for stable releases
2024-06-12 15:57:58 +01:00
Luca Boccassi
40d637bace NEWS: note that new stable releases will be in the main repo 2024-06-12 14:30:29 +01:00
Luca Boccassi
62cc0aca17 docs: update RELEASE.md to use same repository for stable branches 2024-06-12 14:30:29 +01:00