summaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* varlink-idl: fix typoYu Watanabe2024-06-181-2/+2
| | | | Follow-ups for fbb69c0306d434153ca85b227c7d42b9c92872e4.
* Merge pull request #33376 from yuwata/strv_sort_uniqLuca Boccassi2024-06-1813-26/+106
|\ | | | | strv: introduce strv_sort_uniq()
| * tree-wide: replace strv_sort() + strv_uniq() -> strv_sort_uniq()Yu Watanabe2024-06-1710-26/+15
| |
| * strv: introduce strv_sort_uniq()Yu Watanabe2024-06-173-0/+91
| | | | | | | | | | | | | | 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.
* | Merge pull request #32724 from bluca/dynamic_user_no_private_tmpLuca Boccassi2024-06-1816-57/+224
|\ \ | | | | | | core: do not imply PrivateTmp with DynamicUser, create a private tmpfs instead
| * | portable: drop explicit PrivateTmp=yes from profilesLuca Boccassi2024-06-173-3/+0
| | | | | | | | | | | | | | | | | | 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.
| * | core: do not imply PrivateTmp with DynamicUser, create a private tmpfs insteadLuca Boccassi2024-06-1713-54/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #33377 from yuwata/strbuf-cleanupsLuca Boccassi2024-06-171-16/+17
|\ \ \ | | | | | | | | strbuf: several cleanups
| * | | strbuf: use _cleanup_ attribute at one more placeYu Watanabe2024-06-171-7/+5
| | | |
| * | | strbuf: several cleanupsYu Watanabe2024-06-171-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | - use FOREACH_ARRAY(), - add one missing assertion, - reduce indentation.
| * | | strbuf: use CMP() macroYu Watanabe2024-06-171-3/+5
| | |/ | |/| | | | | | | | | | | | | strbuf_child_entry.c is uint8_t, so using CMP() is safer. This also adds missing assertions.
* | | Merge pull request #33375 from yuwata/trivial-follow-upsLuca Boccassi2024-06-172-3/+3
|\ \ \ | | | | | | | | Trivial follow ups for recent PRs
| * | | json: const char *func() -> const char* func()Yu Watanabe2024-06-171-2/+2
| | | | | | | | | | | | | | | | Follow-up for 309a747fa6cfeac0a0165543f23a924866727c9b.
| * | | core/mount: suffix function name with parenYu Watanabe2024-06-171-1/+1
| |/ / | | | | | | | | | Follow-up for 88188e1ff1ffa2a4a41c9b8ee127f75cc03bc18d.
* | | Merge pull request #33374 from YHNdnzj/coverity-fixes-1Luca Boccassi2024-06-172-16/+13
|\ \ \ | | | | | | | | core: a few more fixes for serialization
| * | | core/service: fix accept-socket deserializationMike Yuan2024-06-171-4/+4
| | | | | | | | | | | | | | | | Follow-up for 45b1017488cef2a5bacdf82028ce900a311c9a1c
| * | | core: cast ignored retval of deserialize_* to voidMike Yuan2024-06-172-8/+7
| | | | | | | | | | | | | | | | Fixes CID#1547098
| * | | core/socket: use FOREACH_ARRAY at one more placeMike Yuan2024-06-171-4/+2
| | | |
* | | | Merge pull request #32559 from poettering/varlink-commentsLuca Boccassi2024-06-1710-35/+474
|\ \ \ \ | | | | | | | | | | varlink: add nice commenting to our varlink IDL data
| * | | | creds: add comments to credential encryption/decryption method callsLennart Poettering2024-06-171-0/+24
| | | | |
| * | | | varlink: parse comments tooLennart Poettering2024-06-172-10/+94
| | | | |
| * | | | varlink: add concept for embedding comments into IDL structuresLennart Poettering2024-06-174-24/+204
| | | | |
| * | | | strv: add new helper strv_rebreak_lines() with a simple line breaking algorithmLennart Poettering2024-06-173-0/+150
| | | | |
| * | | | utf8: export utf8_char_console_width()Lennart Poettering2024-06-172-1/+2
| | | | |
* | | | | Merge pull request #32872 from YHNdnzj/pidref-inodeMike Yuan2024-06-173-18/+66
|\ \ \ \ \ | |_|_|/ / |/| | | | pidref: record pidfd inode number in PidRef struct
| * | | | pidref: record pidfd inode number in PidRef structMike Yuan2024-06-143-21/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Besides internal comparisons, the inode number of pidfds might be interesting directly to users, too. In the future this field should also be exposed, so that it can serve as a unique identifier of a process (but only for display, as there's no method to map this back to a pid or pidfd).
| * | | | pidref: introduce pidfd_inode_ids_supported helperMike Yuan2024-06-141-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, correct the comment about pidfs (added in kernel 6.9 rather than 6.8). Co-authored-by: Lennart Poettering <lennart@poettering.net>
* | | | | logind: tweakletsLennart Poettering2024-06-171-1/+4
| | | | |
* | | | | pretty-print: take console glyph width into account when drawing progress barLennart Poettering2024-06-171-3/+4
| |_|/ / |/| | | | | | | | | | | So far this used string length, not character width. Fix that.
* | | | Merge pull request #33355 from YHNdnzj/shutdown-cadLuca Boccassi2024-06-173-62/+48
|\ \ \ \ | |_|/ / |/| | | shutdown: re-enable CAD handling in kernel at start, several other cleanups
| * | | shutdown: re-enable CAD handling in kernel at startMike Yuan2024-06-151-0/+5
| | | |
| * | | shutdown: clean up sync_with_progress a bitMike Yuan2024-06-151-38/+29
| | | | | | | | | | | | | | | | Also, ignore the error on caller's side.
| * | | string-util: modernize first_word a bitMike Yuan2024-06-151-20/+9
| | | |
| * | | core/manager: correct alignment in manager_handle_ctrl_alt_delMike Yuan2024-06-151-4/+5
| | | |
* | | | Merge pull request #33363 from YHNdnzj/service-serialization-cleanupLuca Boccassi2024-06-172-85/+66
|\ \ \ \ | | | | | | | | | | core/service: several cleanups for serialization logic
| * | | | core/service: use r to store parsed int valuesMike Yuan2024-06-161-12/+8
| | | | |
| * | | | core/service: drop unused bus_name_ownerMike Yuan2024-06-162-19/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow-up for fc67a943d989d5e74577adea9676cdc7928b08fc After the mentioned comment, we no longer need to record the owner to restore the previous bus owner state. Therefore, bus_name_owner is effectively unused. Kill it.
| * | | | core/service: also serialize/dump status_errnoMike Yuan2024-06-161-0/+14
| | | | |
| * | | | core/service: use serialize_usec where appropriate, drop redundant debug logMike Yuan2024-06-161-57/+46
| | | | |
* | | | | string-util: introduce string_is_safe_ascii helperMike Yuan2024-06-162-1/+5
| | | | |
* | | | | basic/utf8: modernize ascii_is_valid_n, make ascii_is_valid static inlineMike Yuan2024-06-162-20/+10
| | | | |
* | | | | basic/utf8: modernize utf8_is_valid_n a bitMike Yuan2024-06-162-9/+9
|/ / / /
* | | | Merge pull request #33214 from keszybz/system-clock-epochMike Yuan2024-06-1613-190/+226
|\ \ \ \ | | | | | | | | | | Rework the setting and description of system clock to the epoch
| * | | | manager: add structured log message about clock bumpZbigniew Jędrzejewski-Szmek2024-06-152-9/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested in https://github.com/systemd/systemd/pull/33214#discussion_r1630251308. Also, reword error messages a bit. When /usr/lib/clock-epoch was introduced, "build time" stopped being acurate. Just say "epoch" instead. The same message ID is used in the manager and timesyncd. The event is essentially equivalent for the user, and it seems reasonable that to search for both at the same time. The catalog entry is dropped. It provided almost no additional information above the message. When the same message ID is now applied to messages from PID1 and timesyncd, and the clock can be both advanced and rewound, it becomes very hard to make the catalog entry provide something useful, because catalog entries don't allow conditionalization.
| * | | | timesyncd: simplify handling of timestampsZbigniew Jędrzejewski-Szmek2024-06-151-26/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We would attempt to take the built-in epoch twice. Since advance_tstamp() is only called from one place, we don't need to do that. Also, just pass usec_t instead of a pointer to stat buf. Don't say we set the clock to "recorded timestamp" if we just set it to the built-in epoch. Also, consistently say "advance" to make it clear that we'll not attempt to rewind the clock here.
| * | | | manager: apply clock epoch on updates tooZbigniew Jędrzejewski-Szmek2024-06-153-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we're updating on a system with an invalid clock, and we're installing a newer system version with a higher update, adjust the clock. This way the invariant that the clock is always later than max(compile time, timestamp file, other timestamp file) is maintained. Also, adjust the wording of messages. When /usr/lib/clock-epoch was introduced, "build time" stopped being acurate. Just say "epoch" instead.
| * | | | manager: use max of: compile epoch, epoch file, timesyncd fileZbigniew Jędrzejewski-Szmek2024-06-151-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously systemd would not use /var/lib/systemd/timesync/clock. This means that even if /var/ is mounted when systemd is started and the file is available, we would potentially make one time jump and than another time jump. From a user's POV, this doesn't seem useful at all. Also, we would always let /usr/lib/clock-epoch take priority over the built-in epoch. But there is no guarantee that this file is actually fresh. In particular, a user may touch /usr/lib/clock-epoch to work around a broken clock during installation (as recommended in [1]), and then this file will grow stale over time. So just load the three timestamps and use the highest one as the epoch. [1] https://discussion.fedoraproject.org/t/f38-to-f39-40-dnf-system-upgrade-can-fail-on-raspberry-pi/92403
| * | | | shared/clock-util: small modernizationZbigniew Jędrzejewski-Szmek2024-06-152-28/+23
| | | | |
| * | | | Move two functions only used in timesyncd from libshared to the binaryZbigniew Jędrzejewski-Szmek2024-06-126-45/+62
| | | | |
| * | | | Move two functions only used in pid1 from libshared to the binaryZbigniew Jędrzejewski-Szmek2024-06-126-71/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Anything that is part of src/shared becomes part of the shared library, which is wasteful, because the library is linked into almost all binaries. The library is also forms a separate link unit, so this prevents the function from being inlined or such. Also, move logging into the function. Now that it's not a library function, there is no reason not to do that.