Commit Graph
49768 Commits
Author SHA1 Message Date
Yu Watanabe 8f33bfeca1 varlink-idl: allow unbalanced quote and trailing backslash in comment
Fixes #33381.
Fixes OSS-FUZZ#69730.
Follow-up for fbb69c0306.
2024-06-19 14:12:20 +02:00
Antonio Alvarez Feijoo fdd4263cac udev-spawn: fix typo and simplify code
Follow-up for 11706971e8
2024-06-19 19:36:53 +09:00
Mike Yuan 909ba69070 login/user-runtime-dir: free ignored sd_bus_error, avoid triggering assertion
Fixes #33388
2024-06-18 23:57:22 +02:00
Mike Yuan 0b8a714b2b login/user-runtime-dir: use STRLEN where appropriate
Also, add missing trailing / to paths used in STRLEN/sizeof.
2024-06-18 23:56:37 +02:00
Yu Watanabe f2d2aa0934 strv: replace always-true condition with assertion
Follow-up for aca093018c.
Fixes CID#1547105.
2024-06-18 21:09:04 +01:00
Luca Boccassi 07748c53df Merge pull request #33386 from yuwata/journal-timestamp
journal: fix _SOURCE_MONOTONIC_TIMESTAMP field
2024-06-18 16:27:36 +01:00
Antonio Alvarez Feijoo a81f5ffd40 repart: fix memory leak 2024-06-18 15:47:12 +01:00
Luca Boccassi b1d4bfe7e6 Merge pull request #33383 from poettering/tmpfiles-limit-purge
tmpfiles: make --purge more restrictive, and various other tweaks
2024-06-18 15:44:32 +01:00
Luca Boccassi 5163c9b1e5 install: allow removing symlinks even for units that are gone
If a symlink is leftover, still allow cleaning it up via 'disable'. This
happens when a unit is stopped and removed, but not disabled, and a reload
has already happened. At that point, cleaning up the old symlinks becomes
impossible through the APIs, and needs to be done manually. Always allow
cleaning up symlinks, if they exist, by only erroring out if there is an
OOM.

Follow-up for f31f10a620
2024-06-18 16:07:26 +02:00
Lennart Poettering d7d41a6a76 tmpfiles: mention that --create also adjusts files/directories in --help text 2024-06-18 14:45:59 +01:00
Lennart Poettering 6718998d1e tmpfiles: suffix --replace= properly with = in comment 2024-06-18 14:45:59 +01:00
Lennart Poettering 2a37663036 tmpfiles: make --tldr help text symmetric to --cat-config 2024-06-18 14:45:59 +01:00
Lennart Poettering 4f25330d87 tmpfiles: improve debug logging around O_NOATIME fallback 2024-06-18 14:45:59 +01:00
Lennart Poettering 6f77039e97 tmpfiles: remove pointless empty line 2024-06-18 14:45:59 +01:00
Lennart Poettering 69d76823ce tmpfiles: move --purge to command section in --help text where it belongs
Also, make contrast between --remove and --purge clearer: one deletes
files marked for deletion, the other deletes files marked for creation.
2024-06-18 14:45:59 +01:00
Lennart Poettering 41064a3c97 tmpfiles: insist on at least one configuration file being specified on --purge
Also, extend the man page explanation substantially, matching more
closely what --create says.

Fixes: #33349
2024-06-18 14:45:59 +01:00
Yu Watanabe f5bdecba08 logs-show: use _SOURCE_MONOTONIC_TIMESTAMP when _SOURCE_BOOTTIME_TIMESTAMP field exists
With the previous commit, now the _SOURCE_MONOTONIC_TIMESTAMP field is
usable but only when _SOURCE_BOOTTIME_TIMESTAMP exists.
2024-06-18 18:01:21 +09:00
Yu Watanabe a9357c2ce2 journal: introduce _SOURCE_BOOTTIME_TIMESTAMP field
Then, fix the monotonic timestamp.

The _SOURCE_MONOTONIC_TIMESTAMP field is already used in other projects.
Hence, we cannot remove the field. But, let's store the correct value.
The existence of the new _SOURCE_BOOTTIME_TIMESTAMP field can indicate
that the monotonic timestamp field is reliable or not.
2024-06-18 17:57:40 +09:00
Yu Watanabe 36cb02ec80 sd-journal: realign flags 2024-06-18 17:57:40 +09:00
Yu Watanabe 144498e7e6 logs-show: do not use _SOURCE_MONOTONIC_TIMESTAMP field
The timestamp is not in CLOCK_MONOTONIC, but CLOCK_BOOTTIME,
while header monotonic timestamp is in CLOCK_MONOTONIC. Hence, we cannot
adjust timestamp by comparing with header monotonic timestamp and
_SOURCE_MONOTONIC_TIMESTAMP field.

Fixes a regression caused by affde1d7e7.
Fixes #33293.
2024-06-18 17:57:40 +09:00
Lennart Poettering edeceb80a9 tmpfiles: honour --dry-run when removing directories 2024-06-18 10:15:24 +02:00
Lennart Poettering eaa3adbe69 tmpfiles: sort needs_purge line list in same order as enum defines them 2024-06-18 10:15:24 +02:00
Yu Watanabe 2dda7bd241 varlink-idl: fix typo
Follow-ups for fbb69c0306.
2024-06-18 09:12:29 +09:00
Luca Boccassi 5d42acada4 Merge pull request #33376 from yuwata/strv_sort_uniq
strv: introduce strv_sort_uniq()
2024-06-18 00:22:19 +01:00
Luca Boccassi fcbe3e3b2e Merge pull request #32724 from bluca/dynamic_user_no_private_tmp
core: do not imply PrivateTmp with DynamicUser, create a private tmpfs instead
2024-06-18 00:11:11 +01:00
Luca Boccassi 05c0671ce8 Merge pull request #33377 from yuwata/strbuf-cleanups
strbuf: several cleanups
2024-06-17 20:08:22 +01:00
Luca Boccassi 0cf5ebeffc Merge pull request #33375 from yuwata/trivial-follow-ups
Trivial follow ups for recent PRs
2024-06-17 20:06:46 +01:00
Luca Boccassi 42a91b3131 Merge pull request #33374 from YHNdnzj/coverity-fixes-1
core: a few more fixes for serialization
2024-06-17 20:05:58 +01:00
Luca Boccassi 656b0f5031 Merge pull request #32559 from poettering/varlink-comments
varlink: add nice commenting to our varlink IDL data
2024-06-17 18:53:11 +01:00
Mike Yuan f3d7ceb5c5 Merge pull request #32872 from YHNdnzj/pidref-inode
pidref: record pidfd inode number in PidRef struct
2024-06-17 18:47:44 +02:00
Luca Boccassi ac6f17987d portable: drop explicit PrivateTmp=yes from profiles
It is already implied by DynamicUser=yes if not set, but dropping it
allows users to instead define TemporaryFileSystem=/tmp/ /var/tmp/
in their portable services, which has fewer side effects.
2024-06-17 17:05:55 +01:00
Luca Boccassi 0e551b04ef core: do not imply PrivateTmp with DynamicUser, create a private tmpfs instead
DynamicUser= enables PrivateTmp= implicitly to avoid files owned by reusable uids
leaking into the host. Change it to instead create a fully private tmpfs instance
instead, which also ensures the same result, since it has less impactful semantics
with respect to PrivateTmp=yes, which links the mount namespace to the host's /tmp
instead. If a user specifies PrivateTmp manually, let the existing behaviour
unchanged to ensure backward compatibility is not broken.
2024-06-17 17:05:55 +01:00
Yu Watanabe e367b42664 tree-wide: replace strv_sort() + strv_uniq() -> strv_sort_uniq() 2024-06-18 00:37:50 +09:00
Yu Watanabe 6548aef1cd strbuf: use _cleanup_ attribute at one more place 2024-06-18 00:26:15 +09:00
Yu Watanabe c616e30e9c strbuf: several cleanups
- use FOREACH_ARRAY(),
- add one missing assertion,
- reduce indentation.
2024-06-18 00:26:15 +09:00
Yu Watanabe 7b12b86450 strbuf: use CMP() macro
strbuf_child_entry.c is uint8_t, so using CMP() is safer.

This also adds missing assertions.
2024-06-18 00:26:15 +09:00
Yu Watanabe 3dc546ad75 strv: introduce strv_sort_uniq()
We often call strv_sort() and strv_uniq(). If a strv is already sorted.
uniquifying can be faster.

Prompted by https://github.com/systemd/systemd/pull/33012#discussion_r1636633627.
2024-06-18 00:22:33 +09:00
Yu Watanabe 87e30d0e56 json: const char *func() -> const char* func()
Follow-up for 309a747fa6.
2024-06-18 00:19:59 +09:00
Yu Watanabe abeb98d185 core/mount: suffix function name with paren
Follow-up for 88188e1ff1.
2024-06-18 00:19:59 +09:00
Lennart Poettering 1b3449d8c1 logind: tweaklets 2024-06-17 16:12:55 +01:00
Lennart Poettering 1ad4e37da1 pretty-print: take console glyph width into account when drawing progress bar
So far this used string length, not character width. Fix that.
2024-06-17 16:12:11 +01:00
Mike Yuan 9f5d8c3da4 core/service: fix accept-socket deserialization
Follow-up for 45b1017488
2024-06-17 17:02:51 +02:00
Mike Yuan 42fdb14286 core: cast ignored retval of deserialize_* to void
Fixes CID#1547098
2024-06-17 16:56:19 +02:00
Mike Yuan 42e9967baf core/socket: use FOREACH_ARRAY at one more place 2024-06-17 16:56:19 +02:00
Luca Boccassi 9981bc210a Merge pull request #33355 from YHNdnzj/shutdown-cad
shutdown: re-enable CAD handling in kernel at start, several other cleanups
2024-06-17 09:19:08 +01:00
Lennart Poettering b4c91fbc07 creds: add comments to credential encryption/decryption method calls 2024-06-17 09:20:21 +02:00
Lennart Poettering ce2d2260c9 varlink: parse comments too 2024-06-17 09:20:21 +02:00
Lennart Poettering fbb69c0306 varlink: add concept for embedding comments into IDL structures 2024-06-17 09:20:21 +02:00
Lennart Poettering aca093018c strv: add new helper strv_rebreak_lines() with a simple line breaking algorithm 2024-06-17 09:20:21 +02:00
Lennart Poettering 9632f8b465 utf8: export utf8_char_console_width() 2024-06-17 09:20:21 +02:00