1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-09 01:18:19 +03:00
Commit Graph

48353 Commits

Author SHA1 Message Date
Yu Watanabe
cdafb51ab4
Merge pull request #31754 from YHNdnzj/journal-fd-namespace
journal/cat: allow connecting output to specific journal namespace
2024-03-14 19:59:19 +09:00
Lennart Poettering
837eda0522
Merge pull request #31770 from poettering/linkat-replace
introduce linkat_replace() helper, and port various things over to it
2024-03-14 11:03:59 +01:00
Yu Watanabe
af02814a85 ptyfwd: fix typo
Follow-up for d0aa368c85.
2024-03-14 17:40:26 +09:00
Yu Watanabe
f03caa0d3e stat-util: fix typo
Follow-up for 7cff2b79f0.
2024-03-14 17:37:50 +09:00
Lennart Poettering
5655e5c955 creds-util: port make_credential_host_secret() over to link_tmpfile_at()
Let's simplify things by just reusing the primitives we already have.
2024-03-14 09:22:09 +01:00
Lennart Poettering
ccec206498 tmpfile-util: port link_tmpfile_at() over to linkat_replace() 2024-03-14 09:22:09 +01:00
Lennart Poettering
1f27e7b724 fs-util: add new helper linkat_replace() 2024-03-14 09:22:09 +01:00
Lennart Poettering
0b8e36f064 fs-util: move link_fd() from tmpfile-util.c into generic fs-util.c
It's a generically useful call, let's move it so that we can use it at
more places.
2024-03-14 09:17:46 +01:00
Lennart Poettering
dd92ba8a7a path-util: add helper that checks if a path definitely refers to a dir 2024-03-14 09:17:46 +01:00
Mike Yuan
45bcab66a9
journal/cat: allow connecting output to specific journal namespace 2024-03-14 14:25:53 +08:00
Mike Yuan
32104d3251
sd-journal: introduce sd_journal_stream_fd_with_namespace 2024-03-14 14:25:52 +08:00
Mike Yuan
2a11593178
journal-send: introduce journal_stream_path helper 2024-03-14 14:25:52 +08:00
Mike Yuan
baaca3db6a
path-util: introduce skip_leading_slash and use it where appropriate 2024-03-14 14:25:52 +08:00
Luca Boccassi
823ef2675d
Merge pull request #31761 from CodethinkLabs/vmspawn/bug_fixes
vmspawn: fix two minor bugs
2024-03-13 23:37:50 +00:00
Mike Yuan
1ea275f119 core/cgroup: introduce MemoryZSwapWriteback setting
Added in
501a06fe8e
2024-03-13 23:36:25 +00:00
Daan De Meyer
49fc22f46c
Merge pull request #31758 from DaanDeMeyer/kvm
mkosi: Enable KVM
2024-03-14 00:16:43 +01:00
Luca Boccassi
8e35076101
Merge pull request #31584 from yuwata/sd-ndisc-option-parser-cleanups
sd-ndisc: rewrite option parser
2024-03-13 23:06:50 +00:00
Daan De Meyer
d6e8137716 boot: Only use io.systemd.boot.kernel-cmdline-extra for type 1 images
Otherwise the cmdline is duplicated for UKIs.
2024-03-13 23:42:34 +01:00
Sam Leonard
4364a542e3
vmspawn: fix FD passing logic 2024-03-13 15:32:08 +00:00
Sam Leonard
002243ea64
vmspawn: prefix extra kernel-cmdline-extra with -smbios 2024-03-13 15:31:52 +00:00
Evgeny Vereshchagin
a96b4557cb fuzz: make sure DHCP client leases are loaded successfully
Now that fa3357b9e8 is merged the fuzz
target should no longer crash there.
2024-03-14 00:10:08 +09:00
sharad3001
e0cd8a1bdf
udev: add assert for EVENT_RESULT_EXIT_STATUS_BASE (#31710)
EVENT_RESULT_EXIT_STATUS_BASE and EVENT_RESULT_SUCCESS has the same value.
Code updated to add assert statement for EVENT_RESULT_EXIT_STATUS_BASE.
2024-03-13 22:25:22 +09:00
Yu Watanabe
cac8e820d6 network/varlink: return StorageReadOnly error
Addresses https://github.com/systemd/systemd/pull/30021#discussion_r1521595855.
2024-03-13 21:49:12 +09:00
AKHIL KUMAR
8cbc701ded networkctl.c : call 'assert_not_reached' where appropriate
networkctl.c : call 'assert_not_reached' where appropriate
2024-03-13 21:46:05 +09:00
Mike Yuan
9c16c8a177 networkd-manager: drop spurious return
Follow-up for f90eb08627
2024-03-13 21:44:33 +09:00
Luca Boccassi
8fb8c037b3
Merge pull request #31729 from aafeijoo-suse/logind-cleanups
logind: coding style cleanups
2024-03-13 11:27:35 +00:00
Lennart Poettering
91180a1eec polkit: add another flag that controls how to treat the PK absent case
Typically if PK is not present we want to treat this as "denied". But
sometimes it makes sense to treat this case as "allowed".

In particular the combination POLKIT_ALWAYS_QUERY and
POLKIT_DEFAULT_ALLOW makes a lot of sense: it means we can enable PK
logic for actions where we so far bypassed the checks for root. With the
new combination we can have a default policy of allowing some operation
but still provide an effective hook to disable it.

Also add some debug logging about PK operations and results as they are ongoing.
2024-03-13 10:43:44 +01:00
Lennart Poettering
f5a12ceaed polkit: add new POLKIT_ALWAYS_QUERY flag
When this flag is set we'll disable the local shortcut that skips polkit
checks for clients that are privileged, and assumes they are
authenticated.

Or in other words: if this flag is set, we'll query PK not matter what,
regardless if it's root we talk about or any other user.
2024-03-13 10:42:27 +01:00
Lennart Poettering
b9632ec42f polkit: allow checking if we already acquired some action
This adds a new helper that basically just wraps
async_polkit_query_have_action() and allows calling this without
actually triggering a PK authentication operation: it just checks if we
aleady have acquired an action or not.
2024-03-13 10:42:13 +01:00
Lennart Poettering
95db87ffed
Merge pull request #31731 from poettering/stat-is-set
stat-util: add explicit helpers for checking if stat/statx is initialized
2024-03-13 10:37:15 +01:00
SidhuRupinder
7d08e23558
local-addresses: call 'assert_not_reached' where appropriate (#31728)
Added code for calling the 'assert_not_reached' function as the value of the 'family' parameter must be either 'AF_INET' or 'AF_INET6'.
2024-03-13 13:16:46 +08:00
Mike Yuan
a793133963
Merge pull request #31727 from YHNdnzj/homed-followup
data-fd-util: some cleanups
2024-03-13 13:10:34 +08:00
Yu Watanabe
9ca04752cb sd-ndisc-router: adjust function names and type of returned value
- prefix length and preference should be fit in uint8_t, and actually
  the kernel and networkd uses uint8_t to store them.
- captive portal is now stored as a NUL-terminated string. Hence, it
  is not necessary to also provide its length.
2024-03-13 12:32:52 +09:00
Yu Watanabe
b43c2221f6 sd-ndisc-router: introduce sd_ndisc_router_get_sender_mac()
The Router Advertisement option can take the MAC address of the sender.
Let's introduce a function to get it from the parsed options.
2024-03-13 12:32:52 +09:00
Yu Watanabe
0216c67269 ndisc-option: drop unused function 2024-03-13 12:32:52 +09:00
Yu Watanabe
c0edd6b3b3 sd-ndisc-router: use ndisc_parse_options() and friends to parse Router Advertisement 2024-03-13 12:32:52 +09:00
Yu Watanabe
a163404cc8 ndisc-option: introduce generic NDisc option parser
It is not used in this commit, but will be used for parsing NDisc
options in Router Advertisement message and friends.

The parser does mostly equivalent to what currently we do in
sd-ndisc-router.c. Several notable differences are:
- also perse source and target link-layer address,
- refuse multiple captive portals,
- check if the captive portal is in safe characters, as previously we
  checked that in networkd-ndisc.c,
- dedup prefixes, routes, and pref64,
- limit the total number of options, for safety.
2024-03-13 12:32:37 +09:00
Yu Watanabe
dd6bbb3027 sd-ndisc: rename ndisc-protocol.[ch] -> ndisc-option.[ch] 2024-03-13 10:55:48 +09:00
Lars Ellenberg
b8e25bff38 fs-utils: new wrapper fd_reopen_propagate_append_and_position()
We may want to propagate O_APPEND, or (try to) keep the current file position,
even if we use fd_reopen() to re-initialize (and "unshare") other file
description status.

For now, used only with --pty to keep/propagate O_APPEND (and/or) position
if set on stdin/stdout.

If we re-open stdout and "drop" the O_APPEND,
we get rather "unexpected" behavior,
for example with repeated "systemd-run --pty >> some-log".

If someone carefully pre-positioned the passed in original file descriptors,
we avoid surprises if we do not reset file postition to zero.

fcntl F_GETFL first, and propagate O_APPEND if present in the existing flags.

Then use lseek to propagate the file position.
2024-03-12 19:01:00 +01:00
Antonio Alvarez Feijoo
d3d880e558 homed: fix typo 2024-03-12 16:18:29 +00:00
Luca Boccassi
121c4eba0a ukify: really add default .sbat for UKIs
This was lost on refactor, and only addons had a default uki
line in the .sbat. Add it back, and differentiate between the
default for UKIs vs the default for addons, so that they can
be revoked separately. These are only defaults and users are
encouraged to provide their own.

Follow-up for a8b645dec8
2024-03-12 11:36:08 +01:00
Yu Watanabe
3fbade30a8
Merge pull request #31716 from evverx/fuzz-lease-save-load
fuzz: save/load DHCP client leases
2024-03-12 19:05:17 +09:00
Lennart Poettering
7cff2b79f0 stat-util: make sure inode_type_to_string() handles anonymous inodes in a reasonable way 2024-03-12 10:45:24 +01:00
Antonio Alvarez Feijoo
af9f57e731
logind-inhibit: get rid of basename() in inhibitor_new()
Follow-up to #31594
2024-03-12 10:43:31 +01:00
Antonio Alvarez Feijoo
26ed3ecfe0
logind: place 'ret' param at last
Follow-up to 2454cee32e
2024-03-12 10:39:08 +01:00
Lennart Poettering
1c248d7fb7 stat-util: add explicit helpers for checking if stat/statx is initialized
This is a follow-up for 945a8210c7 and
makes the st_dev check generic, so that we can reuse it some other
places. It also incorporates the non-NULL check now, to be a
comprehensive one-stop solution.

The helper is static inline so that compilers can optimize the redundant
checks away in case it is combined with other checks.
2024-03-12 10:25:48 +01:00
Mike Yuan
72a22e737b
homework-cifs: log correct errno
Follow-up for 606a1f203c
2024-03-12 16:42:49 +08:00
Mike Yuan
0870fc2404
data-fd-util: accept size == SIZE_MAX and translate that to strlen
Like what we already do at other places
2024-03-12 16:42:48 +08:00
Mike Yuan
7799e7d9f0
data-fd-util: some modernization 2024-03-12 16:42:48 +08:00
Mike Yuan
faadc90c33
fileio,data-fd-util: use U64_* more 2024-03-12 16:42:48 +08:00