1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00
Commit Graph

69789 Commits

Author SHA1 Message Date
Lennart Poettering
caef0bc3dc creds: open up access to clients via Polkit
Use auth_admin_keep, so that users don't have to re-auth interactively
again and again when encrypting/decrypting batches of credentials.
2024-01-03 11:53:52 +01:00
Lennart Poettering
2a1ffd3e3a bus-polkit: port polkit_registry to use value destructors in hash_ops 2024-01-03 11:53:52 +01:00
Lennart Poettering
d04c1a1c8e bus-polkit: add support for authenticating varlink peers via polkit
This extends our current polkit logic, so that we can in a very similar
fashion as we already can authenticate dbus peers authenticate varlink
connection peers.

polkit natively speaks dbus and can authentication dbus peers. To get
the same level of support for varlink we'll use authentication by
pidfd+uid. This requires polkit v124, and if that's not available it
will fallback to authorizing root only as before.

Co-authored-by: Luca Boccassi <bluca@debian.org>
2024-01-03 11:53:29 +01:00
Lennart Poettering
35793c71e4 varlink: add two helpers for delayed processing of method calls
When we want to do Polkit authentication we want to temporarily pause
handling of a method call until we have the Polkit reply, and then start
again. Let's add some glue to make that easy. This adds two helpers:

varlink_dispatch_again() allows to ask for redispatching of the
currently queued incoming message. Usecase is this: if we don't process
a methd right away, we can come back later, and ask it to be processed
again with this function, in which case our handlers will be called a
2nd time, exactly like on the first time.

varlink_get_current_message() provides access to the currently processed
method call.

With this the polkit logic can look into the current message, do its
thing, and then restart the method handling.
2024-01-02 17:57:35 +01:00
Lennart Poettering
0eccf7259e varlink: add new helper varlink_get_peer_pidref() for getting PidRef of peer 2024-01-02 17:57:35 +01:00
Lennart Poettering
da5e0c442b socket-util: add helper for getting peer pidfd 2024-01-02 17:57:34 +01:00
Lennart Poettering
3dee63b762 process-util: add new pid{ref,}_get_start_time() helper
This also adds a test case that test pidref_safe_fork(), pidref_wait()
and related calls.
2024-01-02 17:57:34 +01:00
Lennart Poettering
f17132260f process-util: add pidref_safe_fork() helper
This combines safe_fork() with pidref_set_pid().

Eventually we really should switch this to use CLONE_PIDFD, but as that
is not wrapped by glibc yet, it's hard. But this is not crucial anyway,
as a child we just forked off can always safely be referenced also by
PID, given the reaping is under our own control.

A simple test case is added in a follow-up commit.
2024-01-02 17:57:34 +01:00
Lennart Poettering
a3f3243613 pidref: add helpers for waiting for pidref processes
A simple test case is added in a follow-up commit.
2024-01-02 17:57:34 +01:00
Luca Boccassi
c0d672f161
Merge pull request #30684 from systemd/update-labeler-configuration
ci: migrate labeler configuration to the new format
2024-01-02 13:24:48 +01:00
Frantisek Sumsal
b3fb73a5f2 ci: allow testing changes made to labeler configuration 2024-01-02 12:52:03 +01:00
Frantisek Sumsal
17b056a340 ci: use a boolean value for the boolean field
The issue[0] behind this workaround has been resolved[1], so we can set it
to a proper boolean field.

[0] https://github.com/systemd/systemd/issues/18671
[1] https://github.com/actions/labeler/pull/480
2024-01-02 12:42:03 +01:00
Frantisek Sumsal
d151d6ce6f ci: migrate labeler configuration to the new format
Turns out updating the labeler action is a bit annoying[0], so the
breaking change wasn't detected in the version bump PR.

[0] https://github.com/actions/labeler/#notes-regarding-pull_request_target-event

Follow-up to f88c9b0728.
2024-01-02 12:42:03 +01:00
Yu Watanabe
83a0417550 sd-journal: introduce cleanup function and hash ops for Directory
This makes the folloing:
- Each Directory object now has a reference to sd-journal.
- Hence, directory_free(), which is renamed from remove_directory(), can
  be called without sd-journal as an argument.
- Introduces hash ops for Directory, so the finalization becomes
  slightly simpler.
- Allocate hashmaps that store Directory objects when necessary.
- Split out add_directory_impl().

No functional changes, just refactoring.
2024-01-01 19:29:04 +01:00
Luca Boccassi
86b8b66675
Merge pull request #30591 from yuwata/device-util
device-util: introduce device_in_subsystem() and device_is_devtype() helper functions
2024-01-01 19:26:39 +01:00
Luca Boccassi
9d75598bc4
Merge pull request #30593 from yuwata/sd-dhcp-duid
dhcp: introduce sd_dhcp_duid and relevant functions
2024-01-01 19:24:31 +01:00
Luca Boccassi
e191de6947
Merge pull request #30614 from yuwata/udev-event-take-worker
udev: make UdevEvent take UdevWorker object
2024-01-01 19:18:07 +01:00
Mike Yuan
22a8f00229 utmp-wtmp: check actual value of bool instead of pointer 2024-01-01 19:13:14 +01:00
Mike Yuan
a31222b232 logind: use handle_action_to_string where appropriate
Since 138224fc80, HandleActionData
records the corresponding HandleAction. Let's use it instead of
relying on inhibit_what when mapping to string.
2024-01-01 19:12:44 +01:00
Luca Boccassi
3ea26cb8b2
Merge pull request #30674 from YHNdnzj/bus-wait-for-cleanup
bus-wait-for-{jobs,units}: some cleanups/modernizations
2024-01-01 19:11:46 +01:00
dependabot[bot]
01b50b4aaf build(deps): bump github/codeql-action from 2.22.8 to 3.22.12
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.22.8 to 3.22.12.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](407ffafae6...012739e508)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-01 13:52:09 +00:00
dependabot[bot]
f88c9b0728 build(deps): bump actions/labeler from 4.3.0 to 5.0.0
Bumps [actions/labeler](https://github.com/actions/labeler) from 4.3.0 to 5.0.0.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](ac9175f8a1...8558fd7429)

---
updated-dependencies:
- dependency-name: actions/labeler
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-01 13:22:27 +00:00
dependabot[bot]
94ce8e248e build(deps): bump actions/upload-artifact from 3.1.2 to 4.0.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.2 to 4.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](0b7f8abb15...c7d193f32e)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-01 13:19:03 +00:00
dependabot[bot]
13efb5cbd3 build(deps): bump meson from 1.3.0 to 1.3.1 in /.github/workflows
Bumps [meson](https://github.com/mesonbuild/meson) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/1.3.0...1.3.1)

---
updated-dependencies:
- dependency-name: meson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-01 13:17:28 +00:00
Mike Yuan
cbdb8732dd
bus-wait-for-units: rearrange function 2024-01-01 18:42:24 +08:00
Mike Yuan
86dea48ddf
bus-wait-for-units: correctly report state if disconnected from bus 2024-01-01 18:42:24 +08:00
Mike Yuan
0ffcc7539b
bus-wait-for-units: rephrase error message 2024-01-01 18:42:24 +08:00
Mike Yuan
a490aa5a2d
bus-wait-for-units: use hashmap_remove_value where appropriate 2024-01-01 18:42:23 +08:00
Mike Yuan
edba11cbd1
bus-wait-for-jobs: remove unneeded strna and refactor code a bit 2024-01-01 18:42:23 +08:00
Mike Yuan
6aac0ff01c
bus-wait-for-jobs: a few modernizations 2024-01-01 18:16:54 +08:00
Mike Yuan
e945d395e2
bus-wait-for-jobs: rephrase error message 2024-01-01 15:58:52 +08:00
Mike Yuan
a8af9745e5
bus-wait-for-jobs: reorganize functions 2024-01-01 15:57:55 +08:00
Mike Yuan
b8f4a205f7
bus-wait-for-jobs: sort includes 2024-01-01 15:45:05 +08:00
Yu Watanabe
2d0be462d6
Merge pull request #30656 from mrc0mmand/dfuzzer-shenanigans
test: avoid starting/stopping unwanted units during fuzzing
2023-12-31 04:52:15 +09:00
Yu Watanabe
73780aa8a3 resolve: DnsTransaction.scope may be NULL when dns_transaction_close_connection() is called
Follow-up for ac1b7b9e19.

Fixes CID#1533020.
2023-12-31 04:51:59 +09:00
Yu Watanabe
d05649ca7d resolve: add several comments for DNS type table
Also update compile time checks.

Follow-up for 818bb6f482.
2023-12-31 04:51:42 +09:00
Yu Watanabe
e6bca18296
Merge pull request #30658 from jnohlgard/udevadm-lock-return-code
udevadm: Propagate return code from verb result
2023-12-31 04:51:09 +09:00
Yu Watanabe
13a30c6dc4 test: add simple coverage tests for 'udevadm lock' 2023-12-30 05:28:04 +09:00
Joakim Nohlgård
ba340e2a75 udevadm: Propagate return code from verb result
udevadm lock did not propagate the return code from the child process
because all positive values were treated as success.

v2:
Now 'udevadm test-builtin' ignores all positive return values from the
builtin commands. Otherwise, as the hwdb builtin returns an positive value
when a matching entry found, 'udevadm test-builtin hwdb' will fail.

v3:
Initialize partition table before calling 'sfdisk --delete'.

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
2023-12-30 05:26:59 +09:00
Frantisek Sumsal
77baca26f5 test: show journal entries matching the test's syslog identifier as well 2023-12-29 21:26:49 +01:00
Frantisek Sumsal
a66031255f test: avoid starting/stopping unwanted units during fuzzing
Skip calling start and stop methods on unit objects, as doing that is
not only time consuming, but it also starts/stops units that interfere
with the machine state. The actual code paths should be covered (to some
degree) by the respective method counterparts on the manager object.
2023-12-29 21:26:49 +01:00
Mike Yuan
6b9cac874c fd-util: don't eat up errors in fd_cloexec_many
Follow-up for ed18c22c98

Before this commit, a successful fd_cloexec() call would
discard all previously gathered errors.
2023-12-29 14:26:40 +01:00
Frantisek Sumsal
bcdb5d4c0b test: wrap adding a suppression in a method 2023-12-29 13:18:15 +01:00
Yu Watanabe
5b201ffb1e sd-journal: check sd-event state before setting up post change timer
The similar check already exists in schedule_post_change().

The function is currently called at two places.
- journal_file_open() in sd-journal:
  In this case, if the timer is not set up, then journal_file_post_change()
  will be called at the end of journal_file_append_entry(). So, the necessary
  task will be done sequentially when an journal entry is stored to the opened
  journal file. That is desired when the function is called at outside of the
  event loop.
- server_open_journal() in journald:
  This is not called after we exit the event loop.

So, we can safely do nothing in the function if the event loop is being
finished or already finished.

Fixes #30644.
2023-12-29 06:39:06 +09:00
Yu Watanabe
0802e9d8de coccinelle: re-indent comments 2023-12-29 04:14:55 +09:00
Yu Watanabe
a1ccd5eed8 coccinelle: fix typo
Follow-up for b25d3b36a2.
2023-12-29 04:13:45 +09:00
Ronan Pigott
818bb6f482 dns: update record type enum to match iana
Adds some new dns record types. Also, some types were inserted into the
middle of the enum — this corrects an error where the enum constants for
some of the record types previously held an incorrect value.
2023-12-29 04:08:41 +09:00
Yu Watanabe
568fd8a63b
Merge pull request #30649 from YHNdnzj/close-nointr-unnecessary
Some modernization/cleanup for fd-util
2023-12-29 04:03:15 +09:00
Luca Boccassi
aa735b0219 units: add ConditionSecurity=tpm2 to systemd-tpm2-setup units
ConditionSecurity=measured-uki can be true even with TPM 1.2 which we
don't support, so add an explicit check for TPM 2.0.

Fixes https://github.com/systemd/systemd/issues/30650

Follow-up for 2e64cb71b9
2023-12-29 03:14:34 +09:00
A S Alam
c6dcd70a37 po: Translated using Weblate (Punjabi)
Currently translated at 26.4% (60 of 227 strings)

Co-authored-by: A S Alam <aalam@users.noreply.translate.fedoraproject.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/pa/
Translation: systemd/main
2023-12-28 16:32:36 +00:00