1
0
mirror of https://github.com/systemd/systemd synced 2025-10-06 00:13:24 +02:00
Commit Graph

82311 Commits

Author SHA1 Message Date
Lennart Poettering
51cc3825d1 tree-wide: use sd_bus_message_send() instead of sd_bus_send() wherever possible
Also, add a coccinelle script that patches this automatically.
2025-06-24 23:23:40 +09:00
Lennart Poettering
9422ce83c2 udev: reset loopback block device ownership and mode on detach
Loopback block devices are agressively reused, without being removed in
between. This means various inode attributes on their device nodes will
– so far – remain in effect between uses of the devices. Since there are
applications which change access mode/ownership of such devices after
attaching files to them, let's undo this again when we detect them to be
unused again.

Fixes: #37745
2025-06-24 13:10:11 +02:00
Lennart Poettering
7e1647ae4e import: rename keyring extension from .gpg to .pgp and add OBS key for system:systemd (#37927)
The format is not specific to gpg, it's defined by the pgp
protocols. Lintian even warns about it:

systemd-container: openpgp-file-has-implementation-specific-extension
[usr/lib/systemd/import-pubring.gpg]

Rename it accordingly, as new pgp implementations are slowly becoming
more popular.

Keep using /etc/systemd/import-pubring.gpg for backward compatibility.
2025-06-24 07:31:07 +02:00
Luca Boccassi
078eeac8ea NEWS: add not about vendor import-pubring renaming 2025-06-24 00:15:06 +01:00
Luca Boccassi
18118380c5 mkosi: drop suse spec workarounds that were merged upstream 2025-06-24 00:15:06 +01:00
Luca Boccassi
4da911c1e5 mkosi: workaround for opensuse spec file to pick up new import-pubring filename 2025-06-24 00:15:06 +01:00
Luca Boccassi
c45c77e890 mkosi: update debian commit reference to 84966b99cdfc7ea3ee35163ad224775d9be90055
* 84966b99cd systemd-container: pick up renamed keyring file
* 7aab0da57c udev: add 'clock' system group for PTP rules
2025-06-23 23:24:51 +01:00
Luca Boccassi
857f08137a import-pubring: add OBS key for system:systemd
We are publishing ParticleOS images at
https://build.opensuse.org/project/show/system:systemd

so add the signing key to the default keyring, so that they
can be imported out of the box.
2025-06-23 23:24:51 +01:00
Luca Boccassi
ff401d5df9 import: rename keyring extension from .gpg to .pgp
The format is not specific to gpg, it's defined by the pgp
protocols. Lintian even warns about it:

systemd-container: openpgp-file-has-implementation-specific-extension [usr/lib/systemd/import-pubring.gpg]

Rename it accordingly, as new pgp implementations are slowly becoming
more popular.

Keep using /etc/systemd/import-pubring.gpg for backward compatibility.
2025-06-23 23:24:51 +01:00
Yu Watanabe
274e2f4bb9 test-cpu-set-util: fix check for CPUSet.allocated
The check was simply wrong and meaningless, as it always checked
CPUSet.allocated is greater than or equals to 1, as sizeof(__cpu_mask) is 8.

Let's make the test more strict.
2025-06-23 22:28:22 +01:00
Lennart Poettering
170d7d49f5 user-record: also support "aliases" in the "status" section of user records
Some user record providers might want to implement case-insensitive user
record matching, or other forms of non-normalized matching. So far
uderdb didn't allow that, because client's typically revalidate the
returned user records against the search keys (at least our clients do)
– they check if the search user name is actually part of the user record
and its aliases.

In order to support such lookups we thus need to allow the looup keys to
be part of the user record, but also not be persisted in it, because
the number of casings/spellings of a username might be ridiculously
high.

A nice way out is to allow "aliases" not only in the main part of the
record, but also in the "status" part, that contains information
dynamically determined at query time. We can insert a second "aliases"
field there, which the parser will then merge with the primary "aliases"
field, but the existing rules around "status" ensure tha the data is
never persisted.

Follow-up: e2e1f38f5a
2025-06-23 22:26:24 +01:00
Luca Boccassi
ad39648171 network/dhcp6: handle conflict addresses gracefully (#37916) 2025-06-23 22:23:35 +01:00
Yu Watanabe
4aedee430b core: turn ordering cycle log message into a recognizable one + catalog entry (#37893)
Fixes: #35642
2025-06-24 02:56:07 +09:00
Yu Watanabe
01c4788ea6 glob-util: several cleanups for safe_glob() (#37933) 2025-06-24 02:53:37 +09:00
Daan De Meyer
1e0e7c7411 home: Make sure we resolve /etc/skel symlink
Otherwise copy_tree_at() will try to copy the symlink which we obviously
don't want.
2025-06-23 18:16:06 +02:00
Yu Watanabe
5eab200758 homed,userdbd: mark "secrets" section of user records always to "sensitive" (#37935) 2025-06-24 00:50:44 +09:00
Lennart Poettering
1bd9a3c916 bootspec: ensure memory free in one error path 2025-06-24 00:49:46 +09:00
Yu Watanabe
04fd0b9ff0 sysupdate: use path_is_safe()
path_is_safe(...) is an alias of path_is_valid_full(..., false).
2025-06-24 00:49:04 +09:00
Lennart Poettering
b53c3af3fe console: when switching console modes and one doesn't work, always go for the next
So far we already had a logic in place to go for the next mode if some
mode doesn't work – but it was only applied if we'd actively cycle
through resolutions.

Let's extend the logic and always apply it: whenever we try to switch to
a mode, and it doesn't work, go to the next one until we find one that
works.

Fixes: #37324
2025-06-24 00:48:38 +09:00
Lennart Poettering
e4003f2d9c catalog: add entries for the order cycle log messages
Fixes: #35642
2025-06-23 16:47:06 +02:00
Lennart Poettering
becbd2ec4e core: when removing a job from a transaction, include in structured log message which 2025-06-23 16:47:06 +02:00
Lennart Poettering
6650e21349 core: cast log_oom() got void 2025-06-23 16:47:06 +02:00
Lennart Poettering
fe458ad68e core: change ordering cycle log message log levels
Let's downgrade the log message about our attempts to deal with an
ordering cycle to warning, because this is a "positive" thing, we try to
improve an earlier error.

OTOH increase the log level when we first log about the cycle to error,
since that highlights the actual problem.
2025-06-23 16:47:06 +02:00
Lennart Poettering
5bbad6244f core: make log cycle messages recognizable via message IDs 2025-06-23 16:47:06 +02:00
Lennart Poettering
201647e3f2 core: output log cycle path in one log message, not many
Fixes: #35642
2025-06-23 16:47:06 +02:00
Yu Watanabe
f117272f66 glob-util: drop unused _cleanup_globfree_ 2025-06-23 23:11:44 +09:00
Yu Watanabe
9a9139e087 test: use safe_glob() at one more place
This also makes the test use ASSERT_OK() and STRV_FOREACH() macros.

No functional change, just refactoring.
2025-06-23 23:11:44 +09:00
Yu Watanabe
2a5f950e56 glob-util: rework safe_glob()
Currently, callers of safe_glob() set an empty glob_t or glob_t with
opendir func, and all other components are always zero.
So, let's introduce safe_glob_full() which optionally takes opendir
function, rather than glob_t, and returns result strv, rather than
storing results in glob_t.
Also, introduce safe_glob() which is a trivial wrapper of
safe_glob_full() without opendir func.

No functional change, just refactoring.
2025-06-23 23:11:44 +09:00
Yu Watanabe
1b0c39458b test-glob-util: drop redundant test cases
The removed glob() with GLOB_ALTDIRFUNC is exactly the same as what
safe_glob() does, which is tested in TEST(safe_glob) below.
Let's drop the test cases.
2025-06-23 23:11:44 +09:00
Valentin David
0dc39dffbd Use paths specified from environment variables for /etc configuration files
Some configuration files that need updates are directly under in /etc. To
update them atomically, we need write access to /etc. For Ubuntu Core this is
an issue as /etc is not writable. Only a selection of subdirectories can be
writable. The general solution is symlinks or bind mounts to writable places.
But for atomic writes in /etc, that does not work. So Ubuntu has had a patch
for that that did not age well.

Instead we would like to introduce some environment variables for alternate
paths.

 * SYSTEMD_ETC_HOSTNAME: /etc/hostname
 * SYSTEMD_ETC_MACHINE_INFO: /etc/machine-info
 * SYSTEMD_ETC_LOCALTIME: /etc/localtime
 * SYSTEMD_ETC_LOCALE_CONF: /etc/locale.conf
 * SYSTEMD_ETC_VCONSOLE_CONF: /etc/vconsole.conf
 * SYSTEMD_ETC_ADJTIME: /etc/adjtime

While it is for now expected that there is a symlink from the standard, we
still try to read them from that alternate path. This is important for
`/etc/localtime`, which is a symlink, so we cannot have an indirect symlink or
bind mount for it.

Since machine-id is typically written only once and not updated. This commit
does not cover it. An initrd can properly create it and bind mount it.
2025-06-23 15:32:11 +02:00
Lennart Poettering
e3d0fa5ac4 userdb: when loading a user record from JSON, mark 'secret' section in JSON variant as sensitive as side effect
When we load a user record we retain a reference to the original JSON.
Thus the loaded objects might live at least as long as our user record
object, hence we better make sure we set the 'sensitive' flag for the
'secret' section if it's not marked like that yet.

This is paranoia only: we already should be setting this flag properly
earlier, when acquiring the json variant in the first place. But it's
better to be safe than sorry.
2025-06-23 14:48:45 +02:00
Lennart Poettering
5933eb1a71 homed: set "secrets" section to 'sensitive' in more places
We already do this in all placed where we it *really* matters, i.e. for
passwords PINs. But let's do this also at any place where we add the
section at all, regardless whether it is for storing a pw or something
else.

With this we establish the rule that if it's in "secrets", then it
shall be marked "sensitive".
2025-06-23 14:48:37 +02:00
Lennart Poettering
fa34fda2eb update TODO 2025-06-23 14:48:09 +02:00
Luca Boccassi
e248790263 homed: do not log new password when debug logs are enabled
systemd-homed[3443]: Sending to worker:
{
  "enforcePasswordPolicy": false,
  "userName": "foobarbaz",
  "perMachine": [
    {
      "storage": "directory",
      "matchMachineId": "c1082742b92c4f7e8d30d6b17f9d3351"
    }
  ],
  "disposition": "regular",
  "lastChangeUSec": 1750606709833174,
  "lastPasswordChangeUSec": 1750606709833174,
  "privileged": {
    "hashedPassword": [
      "$y$j9T$ai2Fshq0ev9W05WL4SoRJ1$EFfe41ACrJKXMCQ83A05n6UW.HrRr9/O4b1x0CXgAXD"
    ]
  },
  "binding": {
    "c1082742b92c4f7e8d30d6b17f9d3351": {
      "blobDirectory": "/var/cache/systemd/home/foobarbaz",
      "uid": 60056,
      "gid": 60056
    }
  },
  "secret": {
    "password": [
      "test"
    ]
  },
  "__systemd_homework_internal_blob_fdmap": {}
}
2025-06-23 12:42:27 +01:00
Yu Watanabe
4c4fe8cd71 network/dhcp6: consider the DHCPv6 protocol as finished when conflict addresses exist
Replaces #37891.
2025-06-23 19:01:39 +09:00
Yu Watanabe
03f0658460 network/dhcp6: refactoring for verify_dhcp6_address()
No functional change. Preparation for later changes.
2025-06-23 19:00:33 +09:00
Bastien Nocera
3dcb56f5e0 hwdb: Add hwbd definitions for maker tools
As originally added back in 2016 in 68ea57b21d ("Added support
for 3D printers to uaccess (ID_MAKER_TOOL)").

The first devices added would be 3D printers compatible with Flashprint
from Flashforge, as listed in this connector plugin:
https://github.com/Mrnt/OctoPrint-FlashForge/blob/master/octoprint_flashforge/__init__.py#L28

See https://github.com/flathub/com.flashforge.FlashPrint/issues/59
2025-06-23 10:44:58 +01:00
Oliver Schramm
16fe095178 hwdb: Add support for Lenovo IdeaPad Slim 5 series
Signed-off-by: Oliver Schramm <oliver.schramm97@gmail.com>
2025-06-22 16:48:50 +01:00
Jim Spentzos
50ba3c7ef0 po: Translated using Weblate (Greek)
Currently translated at 35.0% (90 of 257 strings)

Co-authored-by: Jim Spentzos <jimspentzos2000@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/el/
Translation: systemd/main
2025-06-22 21:57:26 +09:00
Yu Watanabe
4d05a19c95 bootctl: honour architecture when updating boot loaders (#37913)
Fixes: #33413
Follow-up for: #30418
2025-06-21 02:25:17 +09:00
Lennart Poettering
be7c58353c update TODO 2025-06-21 02:22:28 +09:00
Lennart Poettering
222b0b05ce core: escape UTF-8 in mount unit Where field before sending to clients
Followup for: 4804da5853 #27541

Fixes: #36206
2025-06-21 02:22:28 +09:00
Lennart Poettering
e04d782416 copy: when looking for file holes, consider empty data segments
This could mean that we hit EOF, or it could mean that somebody punched
a hole concurrently where we are currently looking. Let's figure this
out by simply trying to copy a single byte, which will give us a
definitive answer.

Fixes: #35569
2025-06-21 02:19:27 +09:00
Yu Watanabe
73e95bcca0 logind inhibitor code fixes (#37907)
Fixes: #35565
2025-06-21 02:09:52 +09:00
Jan Čermák
a2015ad126 journal-gatewayd: make num_entries in Range header optional again
Since 435c372ce5 added in v256,
num_entries part of the Range header is mandatory and error is returned
when it's not filled in. This makes using the "follow" argument clumsy,
because for an indefinite following of the logs, arbitrary high number
must be specified. This change makes it possible to omit it again and
documents this behavior in the man page.

Moreover, as the cursor part of the header was never mandatory, enclose
it in square brackets in the documentation as well and elaborate how
indexing works.

Following are some concrete examples of the Range header which are now
accepted:

 entries= (or entries=:)
  - everything starting from the first event

 entries=cursor
  - everything starting from `cursor`

 entries=:-9:10
  - last 10 events and close the connection

If the follow flag is set:

 entries=:-4:10
  - last 5 events, wait for 5 new and close connection

 entries=:-9:
  - last 10 events and keep streaming

Note that only the very last one is changing current behavior, but
reintroduces pre-v256 compatibility.

Fixes #37172
2025-06-21 02:08:03 +09:00
Lennart Poettering
6b8770b96b bootctl: when updating everything check PE machine type
Let's never accidentally over-write foreign-arch PE binaries with native
ones.

Fixes: #33413
2025-06-20 14:06:53 +02:00
Lennart Poettering
95df8288c7 bootctl: be more careful when opening arbitrary files from ESP
Let's refuse all kind of weird stuff early.

As suggested here: https://github.com/systemd/systemd/pull/30418#pullrequestreview-2128220792
2025-06-20 14:06:53 +02:00
Lennart Poettering
897c4ff111 logind: fix boolean comparison
We cannot compare a boolean with a bit mask. This worked only by
accident, since MANAGER_IS_INHIBITED_CHECK_DELAY happened to be 1. But
we need to do this properly.

Fixes: #35565
2025-06-20 10:18:46 +02:00
Lennart Poettering
c4ad8365d5 logind: fix minor coding style issues
Fixes: #35565
2025-06-20 10:18:43 +02:00
Luca Boccassi
da993edcf7 tpm2: print clear log message in case of dictionary lockout mode (#37894)
Fixes: #32260
2025-06-19 22:55:36 +01:00