Luca Boccassi [Sat, 15 Jun 2024 00:18:37 +0000 (01:18 +0100)]
Merge pull request #33329 from poettering/varlink-idl-tweaks
varlink-idl: align continuation line character \
Lennart Poettering [Fri, 24 May 2024 09:56:13 +0000 (11:56 +0200)]
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).
Lennart Poettering [Fri, 26 Apr 2024 15:41:38 +0000 (17:41 +0200)]
utf8: let utf8_console_width() handle NULL strings somewhat reasonably
Luca Boccassi [Fri, 14 Jun 2024 23:45:28 +0000 (00:45 +0100)]
Merge pull request #33325 from poettering/vsock-ret-optional
socket-util: make return parameter for socket_address_parse_vsock() o…
Lennart Poettering [Wed, 8 May 2024 07:11:13 +0000 (09:11 +0200)]
json: add sd_json_dispatch_double() helper
Luca Boccassi [Fri, 14 Jun 2024 23:13:50 +0000 (00:13 +0100)]
Merge pull request #33334 from poettering/machined-more-pidfd
machined: prefer pinning clients via pidfd when creating machine, rat…
Luca Boccassi [Fri, 14 Jun 2024 23:12:48 +0000 (00:12 +0100)]
Merge pull request #33330 from poettering/copy-tweaks
Minor tweaks to copy_bytes()
Raphaël Mélotte [Fri, 14 Jun 2024 12:37:29 +0000 (14:37 +0200)]
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>
Nick Rosbrook [Fri, 14 Jun 2024 21:31:22 +0000 (17:31 -0400)]
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.
Lennart Poettering [Thu, 6 Jun 2024 10:14:35 +0000 (12:14 +0200)]
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.
Lennart Poettering [Thu, 6 Jun 2024 13:23:01 +0000 (15:23 +0200)]
fs-util: add simple open_mkdir() wrapper
Lennart Poettering [Wed, 22 May 2024 13:42:56 +0000 (15:42 +0200)]
string-util: make sure strrepa() doesn't doubly evaluate expressions
Lennart Poettering [Wed, 5 Jun 2024 19:47:43 +0000 (21:47 +0200)]
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.
Lennart Poettering [Mon, 10 Jun 2024 12:57:18 +0000 (14:57 +0200)]
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.
Lennart Poettering [Mon, 10 Jun 2024 12:50:18 +0000 (14:50 +0200)]
fileio: add new helper write_base64_file_at() which encodes a binary object into base64 and writes it to a file
Lennart Poettering [Mon, 27 May 2024 12:34:10 +0000 (14:34 +0200)]
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.
Lennart Poettering [Mon, 27 May 2024 11:29:45 +0000 (13:29 +0200)]
nspawn: use parse_boolean_argument() at two places
Lennart Poettering [Fri, 26 Apr 2024 15:41:15 +0000 (17:41 +0200)]
utf8: assume tabs are 8 characters wide when written to console
Cristian Rodríguez [Thu, 13 Jun 2024 15:59:28 +0000 (11:59 -0400)]
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 https://github.com/llvm/llvm-project/commit/
14ba782a87e16e9e15460a51f50e67e2744c26d9
Lennart Poettering [Fri, 24 May 2024 10:18:23 +0000 (12:18 +0200)]
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
Lennart Poettering [Fri, 24 May 2024 10:17:00 +0000 (12:17 +0200)]
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.
Lennart Poettering [Fri, 24 May 2024 10:02:42 +0000 (12:02 +0200)]
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.
Lennart Poettering [Mon, 3 Jun 2024 15:39:04 +0000 (17:39 +0200)]
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.
Lennart Poettering [Tue, 4 Jun 2024 09:02:34 +0000 (11:02 +0200)]
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.
Lennart Poettering [Mon, 27 May 2024 10:03:35 +0000 (12:03 +0200)]
machined: use pidref instead of just pid when determining unit of pid when registering machine
Lennart Poettering [Mon, 13 May 2024 13:06:30 +0000 (07:06 -0600)]
machined: prefer pinning clients via pidfd when creating machine, rather than PID
Lennart Poettering [Mon, 13 May 2024 13:05:49 +0000 (07:05 -0600)]
machined: modernize method_create_or_register_machine() return parameter naming
Lennart Poettering [Fri, 14 Jun 2024 11:24:08 +0000 (13:24 +0200)]
Merge pull request #33312 from poettering/cryptsetup-merge-no-token
cryptsetup: merge two mostly equivalent functions
Lennart Poettering [Mon, 3 Jun 2024 15:50:55 +0000 (17:50 +0200)]
tpm2-util: make one sd_json_dispatch_field[] table static const
Lennart Poettering [Thu, 23 May 2024 09:01:31 +0000 (11:01 +0200)]
varlink-idl: include line/column in a parse log msg
Lennart Poettering [Fri, 26 Apr 2024 15:43:42 +0000 (17:43 +0200)]
varlink-idl: align continuation line character \
Lennart Poettering [Thu, 23 May 2024 21:34:39 +0000 (23:34 +0200)]
machined: initialize CID of '.host' pseudo-machine to 1 (i.e. the loopback vsock address)
Lennart Poettering [Thu, 23 May 2024 21:33:38 +0000 (23:33 +0200)]
socket-util: make return parameter for socket_address_parse_vsock() optional
Lennart Poettering [Mon, 10 Jun 2024 15:46:52 +0000 (17:46 +0200)]
cryptsetup: downgrade log message to warning, when we ignore it
Lennart Poettering [Mon, 10 Jun 2024 15:47:43 +0000 (17:47 +0200)]
cryptsetup: merge two mostly equivalent functions
Lennart Poettering [Thu, 13 Jun 2024 13:22:27 +0000 (15:22 +0200)]
sd-json: make static analyzers shut up
https://github.com/systemd/systemd/pull/32628#pullrequestreview-
2115501478
Luca Boccassi [Thu, 13 Jun 2024 15:17:17 +0000 (16:17 +0100)]
Merge pull request #33046 from poettering/varlinkctl-quiet
varlinkctl: add --quiet/-q switch for suppressing method call reply output
Mike Yuan [Thu, 13 Jun 2024 11:57:25 +0000 (13:57 +0200)]
io-util: move fputs_with_newline to fileio
Follow-up for
cdf6f34a2fd1448c5d1b75f4717c57b057dd51b2
We already have other fputs()-like helpers in fileio rather than
io-util. While at it, switch the order of params.
Lennart Poettering [Thu, 13 Jun 2024 13:26:23 +0000 (15:26 +0200)]
namespace: rename 'n' to 'n_mount_images'
Let's make clear what this actually counts (at least initially).
Kamil Szczęk [Fri, 7 Jun 2024 14:48:41 +0000 (16:48 +0200)]
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.
Luca Boccassi [Thu, 13 Jun 2024 10:30:42 +0000 (11:30 +0100)]
Merge pull request #33257 from YHNdnzj/unit-notify-cleanup
core/unit: several cleanups
Lennart Poettering [Mon, 27 May 2024 09:37:33 +0000 (11:37 +0200)]
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 {}.
Lennart Poettering [Mon, 27 May 2024 15:40:35 +0000 (17:40 +0200)]
ci: add superficial --quiet testcase
Lennart Poettering [Mon, 27 May 2024 09:28:48 +0000 (11:28 +0200)]
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).
Lennart Poettering [Wed, 8 May 2024 08:40:10 +0000 (10:40 +0200)]
varlinkctl: add "-q" switch for suppressing varlinkctl output
Lennart Poettering [Mon, 27 May 2024 09:36:48 +0000 (11:36 +0200)]
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.
Lennart Poettering [Thu, 13 Jun 2024 09:05:07 +0000 (11:05 +0200)]
Merge pull request #33012 from poettering/varlinkctl-list-methods
varlinkctl: make interface parameter for "varlinkctl introspect" optional, and add "list-methods" verb
Lennart Poettering [Wed, 12 Jun 2024 16:31:56 +0000 (18:31 +0200)]
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.
Lennart Poettering [Fri, 24 May 2024 15:02:52 +0000 (17:02 +0200)]
test: add test for new varlinkctl features
Lennart Poettering [Fri, 24 May 2024 14:34:12 +0000 (16:34 +0200)]
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.
Lennart Poettering [Fri, 24 May 2024 13:25:23 +0000 (15:25 +0200)]
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.
Lennart Poettering [Fri, 24 May 2024 13:24:23 +0000 (15:24 +0200)]
varlinkctl: be friendly to later extensions of GetInfo Varlink call
Lennart Poettering [Fri, 24 May 2024 13:23:24 +0000 (15:23 +0200)]
pretty-print: make separator line grey
Let's deemphasize the line in the output a bit.
Lennart Poettering [Thu, 13 Jun 2024 07:29:10 +0000 (09:29 +0200)]
io-util: add new helper fputs_with_newline()
Lennart Poettering [Thu, 13 Jun 2024 07:03:13 +0000 (09:03 +0200)]
Merge pull request #32628 from poettering/json-public
Make our JSON APIs a public interface sd-json.h
Lennart Poettering [Wed, 22 May 2024 20:40:33 +0000 (22:40 +0200)]
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)
Lennart Poettering [Mon, 6 May 2024 13:25:11 +0000 (15:25 +0200)]
test: extend JSON test coverage
Lennart Poettering [Thu, 2 May 2024 12:44:37 +0000 (14:44 +0200)]
man: add brief intro page to new sd-json APIs
Lennart Poettering [Thu, 2 May 2024 12:26:21 +0000 (14:26 +0200)]
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.
Lennart Poettering [Wed, 22 May 2024 20:13:57 +0000 (22:13 +0200)]
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
Yu Watanabe [Tue, 11 Jun 2024 18:53:12 +0000 (03:53 +0900)]
Reapply "network: add "mac" to alternatives name policy by default"
This reverts commit
152c8946b3a93bb2c086568832d614cb54f11e13.
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:
https://salsa.debian.org/systemd-team/systemd/-/commit/
c1afbb2dc295929085be86072c7942c8517ec598
So, hopefully, the change is ready. Let's reapply it.
Lennart Poettering [Wed, 12 Jun 2024 16:04:11 +0000 (18:04 +0200)]
Merge pull request #33100 from dtardon/crypttab-parse-all
cryptsetup-generator: continue parsing after error
Lennart Poettering [Wed, 12 Jun 2024 15:35:56 +0000 (17:35 +0200)]
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, …
Lennart Poettering [Wed, 12 Jun 2024 10:11:50 +0000 (12:11 +0200)]
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
1155f44f48f8fd59c863d71b3938e34a0b2fec2a 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.
David Tardon [Wed, 12 Jun 2024 12:35:34 +0000 (14:35 +0200)]
shell-completion: only offer devices for completion
This skips directories and other stuff like /dev/core, /dev/initctl or
/dev/log.
Luca Boccassi [Wed, 12 Jun 2024 14:57:58 +0000 (15:57 +0100)]
Merge pull request #33287 from bluca/release_doc
docs/news: updates for stable releases
Luca Boccassi [Tue, 11 Jun 2024 22:09:30 +0000 (23:09 +0100)]
NEWS: note that new stable releases will be in the main repo
Luca Boccassi [Tue, 11 Jun 2024 22:07:17 +0000 (23:07 +0100)]
docs: update RELEASE.md to use same repository for stable branches
Daan De Meyer [Mon, 3 Jun 2024 10:35:29 +0000 (12:35 +0200)]
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.
Frantisek Sumsal [Wed, 12 Jun 2024 10:09:25 +0000 (12:09 +0200)]
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.
Antonio Alvarez Feijoo [Wed, 12 Jun 2024 10:08:03 +0000 (12:08 +0200)]
test-ip-protocol-list: include missing_network.h instead of netinet/in.h
This fixes the build for glibc < 2.32
Follow-up for
3f69070598b569bf20f5c296ff21f861bfe003e3
Luca Boccassi [Wed, 12 Jun 2024 13:02:25 +0000 (14:02 +0100)]
Merge pull request #33284 from yuwata/hwdb-optimize
hwdb: improve performance
Lennart Poettering [Wed, 12 Jun 2024 13:01:55 +0000 (15:01 +0200)]
Merge pull request #32810 from poettering/smbios11-analyze
analyze: add new verb "smbios11" for listing passed smbios type #11 strings
Lennart Poettering [Wed, 8 May 2024 08:39:29 +0000 (10:39 +0200)]
bus-util: add log message when exiting because of idle
Lennart Poettering [Wed, 8 May 2024 08:38:52 +0000 (10:38 +0200)]
bus-util: add env var for disabling exit-on-idle
Lennart Poettering [Sat, 11 May 2024 15:00:36 +0000 (17:00 +0200)]
update TODO
Lennart Poettering [Sat, 11 May 2024 14:59:17 +0000 (16:59 +0200)]
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.
Lennart Poettering [Sat, 11 May 2024 14:57:51 +0000 (16:57 +0200)]
core: split out smbios type 11 reader into src/shared/smbios11.[ch]
Yu Watanabe [Wed, 12 Jun 2024 10:12:37 +0000 (19:12 +0900)]
Merge pull request #32961 from YHNdnzj/starttime-main
core/service: try to query for new main process's starttime
Yu Watanabe [Wed, 12 Jun 2024 10:09:00 +0000 (19:09 +0900)]
Merge pull request #32805 from YHNdnzj/no-cred-mount-unit
core/mount: stop generating mount units for cred mounts
Daan De Meyer [Sun, 2 Jun 2024 14:24:52 +0000 (16:24 +0200)]
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.
Ronan Pigott [Fri, 8 Mar 2024 20:40:08 +0000 (13:40 -0700)]
resolved: permit dnssec rrtype questions when we aren't validating
This check introduced in
91adc4db33f6 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:
9c47b334445a ("resolved: enable DNS proxy mode if client wants DNSSEC")
David Tardon [Thu, 30 May 2024 11:33:57 +0000 (13:33 +0200)]
cryptsetup-generator: always process cmdline devices
David Tardon [Thu, 30 May 2024 11:32:20 +0000 (13:32 +0200)]
cryptsetup-generator: parse all cmdline devices too
David Tardon [Thu, 30 May 2024 08:46:13 +0000 (10:46 +0200)]
cryptsetup-generator: continue parsing after error
Let's make the crypttab parser more robust and continue even if parsing
of a line failed.
David Tardon [Thu, 30 May 2024 08:44:36 +0000 (10:44 +0200)]
cryptsetup-generator: refactor add_crypttab_devices()
Move the processing of a crypttab entry to a separate function.
No functional changes, just refactoring.
Yu Watanabe [Wed, 12 Jun 2024 09:44:30 +0000 (18:44 +0900)]
Merge pull request #33074 from keszybz/bpf-fd-handling
Small cleanups in bpf code
Yu Watanabe [Wed, 12 Jun 2024 09:42:14 +0000 (18:42 +0900)]
Merge pull request #33071 from keszybz/sd_event_source-cleanup
Clean up calls to sd_event_source_set_enabled()
Yu Watanabe [Wed, 12 Jun 2024 09:38:09 +0000 (18:38 +0900)]
Merge pull request #32972 from keszybz/small-cleanups
Small cleanups
Дамјан Георгиевски [Mon, 20 May 2024 14:36:56 +0000 (16:36 +0200)]
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
Yu Watanabe [Wed, 12 Jun 2024 09:35:13 +0000 (18:35 +0900)]
Merge pull request #32933 from YHNdnzj/faccessat-empty-path
fs-util: several cleanups
Yu Watanabe [Sun, 19 May 2024 05:21:28 +0000 (14:21 +0900)]
core: invoke_main_loop() does not return MANAGER_RELOAD
Follow-up for
5409c6fcc55e6700360546c42edd4a021ee5014e.
Daan De Meyer [Fri, 17 May 2024 14:20:11 +0000 (16:20 +0200)]
tpm2-setup: Don't fail if we can't access the TPM due to authorization failure
The TPM might be password/pin protected for various reasons even if
there is no SRK yet. Let's handle those cases gracefully instead of
failing the unit as it is enabled by default.
Yu Watanabe [Wed, 12 Jun 2024 09:28:33 +0000 (18:28 +0900)]
Merge pull request #32847 from YHNdnzj/exitrd
shutdown: several cleanups, rename initrd to exitrd
Yu Watanabe [Wed, 12 Jun 2024 09:25:24 +0000 (18:25 +0900)]
Merge pull request #32720 from poettering/hostnamed-no-varlink-exit-on-idle
hostnamed: exit-on-idle tweaks
Yu Watanabe [Wed, 12 Jun 2024 09:22:10 +0000 (18:22 +0900)]
Merge pull request #32603 from YHNdnzj/install-basename
shared/install: modernize and eliminate the use of basename()
Yu Watanabe [Tue, 11 Jun 2024 18:25:57 +0000 (03:25 +0900)]
strbuf: make length for strbuf_add_string() optional
Yu Watanabe [Tue, 11 Jun 2024 18:24:30 +0000 (03:24 +0900)]
strbuf: several cleanups for strbuf_add_string()
- add missing assertions,
- use GREEDY_REALLOC() at one more place,
- etc.
Before:
```
$ sudo time valgrind --leak-check=full ./systemd-hwdb update
==112572== Memcheck, a memory error detector
==112572== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==112572== Using Valgrind-3.23.0 and LibVEX; rerun with -h for copyright info
==112572== Command: ./systemd-hwdb update
==112572==
==112572==
==112572== HEAP SUMMARY:
==112572== in use at exit: 0 bytes in 0 blocks
==112572== total heap usage: 1,320,113 allocs, 1,320,113 frees, 70,614,501 bytes allocated
==112572==
==112572== All heap blocks were freed -- no leaks are possible
==112572==
==112572== For lists of detected and suppressed errors, rerun with: -s
==112572== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
21.94user 0.19system 0:22.23elapsed 99%CPU (0avgtext+0avgdata 229876maxresident)k
0inputs+25264outputs (0major+57275minor)pagefaults 0swaps
```
After:
```
$ sudo time valgrind --leak-check=full ./systemd-hwdb update
[sudo] password for watanabe:
==114732== Memcheck, a memory error detector
==114732== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==114732== Using Valgrind-3.23.0 and LibVEX; rerun with -h for copyright info
==114732== Command: ./systemd-hwdb update
==114732==
==114732==
==114732== HEAP SUMMARY:
==114732== in use at exit: 0 bytes in 0 blocks
==114732== total heap usage: 1,276,406 allocs, 1,276,406 frees, 68,500,491 bytes allocated
==114732==
==114732== All heap blocks were freed -- no leaks are possible
==114732==
==114732== For lists of detected and suppressed errors, rerun with: -s
==114732== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
21.91user 0.24system 0:22.26elapsed 99%CPU (0avgtext+0avgdata 233584maxresident)k
0inputs+25168outputs (0major+58237minor)pagefaults 0swaps
```
q66 [Thu, 6 Jun 2024 11:45:48 +0000 (13:45 +0200)]
strbuf: use GREEDY_REALLOC to grow the buffer
This allows us to reserve a bunch of capacity ahead of time,
improving the performance of hwdb significantly thanks to not
having to reallocate so many times.
Before:
```
$ sudo time valgrind --leak-check=full ./systemd-hwdb update
==113297== Memcheck, a memory error detector
==113297== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==113297== Using Valgrind-3.23.0 and LibVEX; rerun with -h for copyright info
==113297== Command: ./systemd-hwdb update
==113297==
==113297==
==113297== HEAP SUMMARY:
==113297== in use at exit: 0 bytes in 0 blocks
==113297== total heap usage: 1,412,640 allocs, 1,412,640 frees, 117,920,009,195 bytes allocated
==113297==
==113297== All heap blocks were freed -- no leaks are possible
==113297==
==113297== For lists of detected and suppressed errors, rerun with: -s
==113297== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
132.44user 21.15system 2:35.61elapsed 98%CPU (0avgtext+0avgdata 228560maxresident)k
0inputs+25296outputs (0major+6886930minor)pagefaults 0swaps
```
After:
```
$ sudo time valgrind --leak-check=full ./systemd-hwdb update
==112572== Memcheck, a memory error detector
==112572== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==112572== Using Valgrind-3.23.0 and LibVEX; rerun with -h for copyright info
==112572== Command: ./systemd-hwdb update
==112572==
==112572==
==112572== HEAP SUMMARY:
==112572== in use at exit: 0 bytes in 0 blocks
==112572== total heap usage: 1,320,113 allocs, 1,320,113 frees, 70,614,501 bytes allocated
==112572==
==112572== All heap blocks were freed -- no leaks are possible
==112572==
==112572== For lists of detected and suppressed errors, rerun with: -s
==112572== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
21.94user 0.19system 0:22.23elapsed 99%CPU (0avgtext+0avgdata 229876maxresident)k
0inputs+25264outputs (0major+57275minor)pagefaults 0swaps
```
Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
Mike Yuan [Tue, 14 May 2024 13:28:33 +0000 (21:28 +0800)]
core/exec-credential: drop unused unit_add_default_credential_dependencies