Commit graph

74347 commits

Author SHA1 Message Date
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
Zbigniew Jędrzejewski-Szmek 6623c64a02 selinux: kill mac_selinux_free()
It was a redundant wrapper around freecon.

test-selinux needs to be adjusted because it now needs to be linked to
libselinux, instead of pulling it in via libshared.
2024-06-12 15:21:21 +02:00
Zbigniew Jędrzejewski-Szmek 5c672e90a6 basic/dlfcn-util: deobfuscate macro definitions
When looking at how dlopen for various libs is implemented, I found that the
macros hide too much. I find it much easier to see what is going on if 'extern'
and '= NULL' are written explicitly. After all, we don't hide those for other
definitions, e.g. our style guide says that static variables should be
initialized with '= NULL'. With that change, it's much more obvious what is
a variable declaration and what is a variable initialization.
2024-06-12 15:21:15 +02:00
Daan De Meyer 726fc7ae69 repart: Use CRYPT_ACTIVATE_PRIVATE
Let's skip udev device scanning when activating a LUKS volume in
systemd-repart as we don't depend on any udev symlinks and don't
expect anything except repart to access the volume.

Suggested by https://github.com/systemd/systemd/issues/33129#issuecomment-2143390941.
2024-06-12 14:05:23 +01:00
Frantisek Sumsal 2ac0e52f29 test: dump a simple summary at the end of TEST-02-UNITTEST
Let's dump a list of skipped tests and logs from failed tests at the end
of TEST-02-UNITTEST to make debugging fails in CI slightly less painful.
2024-06-12 14:04:10 +01:00
Antonio Alvarez Feijoo 064d87e81f test-ip-protocol-list: include missing_network.h instead of netinet/in.h
This fixes the build for glibc < 2.32

Follow-up for 3f69070598
2024-06-12 14:02:46 +01:00
Luca Boccassi aa6d1f16e8
Merge pull request #33284 from yuwata/hwdb-optimize
hwdb: improve performance
2024-06-12 14:02:25 +01:00
Lennart Poettering df51530709
Merge pull request #32810 from poettering/smbios11-analyze
analyze: add new verb "smbios11" for listing passed smbios type #11 strings
2024-06-12 15:01:55 +02:00
Lennart Poettering e72d5955f6 bus-util: add log message when exiting because of idle 2024-06-12 12:53:54 +02:00
Lennart Poettering afc55a5eff bus-util: add env var for disabling exit-on-idle 2024-06-12 12:53:53 +02:00
Lennart Poettering 99db1c959f update TODO 2024-06-12 12:48:41 +02:00
Lennart Poettering 8c5045f9b2 analyze: add verb for dumping SMBIOS Type #11 data
I find myself wanting to check this data with a quick command, and
browsing through /sys/ manually getting binary data sucks. Hence let's
do add a nice little analysis tool.
2024-06-12 12:48:28 +02:00
Lennart Poettering bfb374e014 core: split out smbios type 11 reader into src/shared/smbios11.[ch] 2024-06-12 12:48:06 +02:00
Yu Watanabe 21f51d877f
Merge pull request #32961 from YHNdnzj/starttime-main
core/service: try to query for new main process's starttime
2024-06-12 19:12:37 +09:00
Yu Watanabe 903891e6b1
Merge pull request #32805 from YHNdnzj/no-cred-mount-unit
core/mount: stop generating mount units for cred mounts
2024-06-12 19:09:00 +09:00
Daan De Meyer b99b294127 repart: Use crypt_reencrypt_run() if available
crypt_reencrypt() is deprecated, so let's look for and prefer
crypt_reencrypt_run() if it is available.
2024-06-12 18:53:37 +09:00
Ronan Pigott 364c948707 resolved: permit dnssec rrtype questions when we aren't validating
This check introduced in 91adc4db33 is intended to spare us from
encountering broken resolver behavior we don't want to deal with.
However if we aren't validating we more than likely don't know the state
of the upstream resolver's support for dnssec. Let's let clients try
these queries if they want.

This brings the behavior of sd-resolved in-line with previouly stated
change in the meaning of DNSSEC=no, which now means "don't validate"
rather than "don't validate, because the upstream resolver is declared to
be dnssec-unaware".

Fixes: 9c47b33444 ("resolved: enable DNS proxy mode if client wants DNSSEC")
2024-06-12 18:50:45 +09:00
David Tardon d181939e2e cryptsetup-generator: always process cmdline devices 2024-06-12 18:46:39 +09:00
David Tardon 47c703d949 cryptsetup-generator: parse all cmdline devices too 2024-06-12 18:46:39 +09:00
David Tardon 83813bae7a cryptsetup-generator: continue parsing after error
Let's make the crypttab parser more robust and continue even if parsing
of a line failed.
2024-06-12 18:46:39 +09:00
David Tardon a07cb7d404 cryptsetup-generator: refactor add_crypttab_devices()
Move the processing of a crypttab entry to a separate function.

No functional changes, just refactoring.
2024-06-12 18:46:39 +09:00
Yu Watanabe 707890d4ff
Merge pull request #33074 from keszybz/bpf-fd-handling
Small cleanups in bpf code
2024-06-12 18:44:30 +09:00
Yu Watanabe a07c903a38
Merge pull request #33071 from keszybz/sd_event_source-cleanup
Clean up calls to sd_event_source_set_enabled()
2024-06-12 18:42:14 +09:00
Yu Watanabe 42d281a197
Merge pull request #32972 from keszybz/small-cleanups
Small cleanups
2024-06-12 18:38:09 +09:00
Дамјан Георгиевски d357f129b2 vsock-mux ssh proxy
allow the ssh-proxy to connect to cloud-hypervisor/Firecracker guests,
via their unix-domain socket to AF_VSOCK multiplexer:

https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/vsock.md
https://github.com/firecracker-microvm/firecracker/blob/main/docs/vsock.md
2024-06-12 18:36:21 +09:00
Yu Watanabe 12c9ebbbe4
Merge pull request #32933 from YHNdnzj/faccessat-empty-path
fs-util: several cleanups
2024-06-12 18:35:13 +09:00
Yu Watanabe 3c7eea0724 core: invoke_main_loop() does not return MANAGER_RELOAD
Follow-up for 5409c6fcc5.
2024-06-12 18:31:41 +09:00