1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-04 21:47:31 +03:00

71856 Commits

Author SHA1 Message Date
Lennart Poettering
b7ab1fe5ba
Merge pull request #31733 from poettering/polkit-more-flags
add two more flags to polkit client wrapper
2024-03-13 12:11:27 +01:00
Daan De Meyer
37bd860c22 mkosi: Introduce packaging sources as submodules
By always cloning the latest branch commit, we can't bisect properly
using mkosi as when bisecting wildly different packaging sources will
be used compared to when the commit was merged. By using submodules, we
track individual commits which means when bisecting the same packaging
sources will be used.

We use git submodules as dependabot has support for automatically making
PRs to update git submodules. This commit also includes the necessary
dependabot configuration to enable this.

We make ubuntu/debian use the same submodule instead of adding the debian
packaging sources twice by introducing a new $PKG_SUBDIR environment variable
and using it instead of $DISTRIBUTION.
2024-03-13 12:07:49 +01:00
Daan De Meyer
d008a9cfad mkosi: Remove some leftover shell debugging 2024-03-13 12:07:09 +01:00
Daan De Meyer
4cc17467a1 mkosi: Use same pkg/ subdirectory for debian and ubuntu
Instead of cloning the same repository twice, let's make sure we
use the same directory for both debian/ubuntu.
2024-03-13 12:07:09 +01:00
Lennart Poettering
54b0e05ed0 update TODO 2024-03-13 11:21:25 +01:00
Lennart Poettering
c89d067f12 update TODO 2024-03-13 11:17:02 +01: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
Yu Watanabe
6f9148bab9 unit: do not trigger automount for /boot and/or /efi
ProtectSystem=full remounts /boot and/or /efi read-only, but that
may trigger automount for the paths and delay the service being started.
===
systemd[1]: boot.automount: Got automount request for /boot, triggered by 720 ((networkd))
===
The service does not need to access the paths, so let's hide them.

Follow-up for f90eb086270f0aea8efcbff5a5e4c338d178cfd4.

Fixes #31742.
2024-03-13 10:23:18 +09:00
Yu Watanabe
7d6efb777e unit: sort option 2024-03-13 10:22:49 +09:00
Luca Boccassi
2af2f3965f
Merge pull request #31735 from mrc0mmand/test-runner
test: split logs from each test into separate files if requested
2024-03-13 00:45:03 +00: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
Frantisek Sumsal
beffcd62f8 test: split logs from each test into separate files if requested
If both $ARTIFACT_DIRECTORY and $SPLIT_TEST_LOGS are set, split the
output from each test into a separate log file, so we don't have to load
one ginormous log file when checking the results.
2024-03-12 17:34:55 +01:00
Frantisek Sumsal
aec72d7901 test: clean up the integration test runner a bit 2024-03-12 17:34:55 +01:00
Antonio Alvarez Feijoo
d3d880e558 homed: fix typo 2024-03-12 16:18:29 +00:00
Frantisek Sumsal
b7c7498de8 ci: reduce ASLR entropy
The latest GH Action runners started using 32-bit entropy for ASLR,
which makes it incompatible with llvm-14. This was fixed in later llvm
releases, but these aren't available on Ubuntu Jammy (22.04). Let's
reduce the ASLR entropy to 28-bit, which should make llvm happy again,
until the issue is resolved.

See: https://github.com/actions/runner-images/issues/9491
2024-03-12 16:17:46 +00:00
Lennart Poettering
50a38492c6 update TODO 2024-03-12 14:07:01 +01:00
Piotr Drąg
7b44a24c1b catalog: update Polish translation 2024-03-12 11:37:17 +01: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 a8b645dec8e6abf4c9ba0c93a6a0088953a2155e
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 945a8210c770801c8492eda03b6e9af3ec5d03a3 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 606a1f203c8871871bc8c5833d66ccbef870b010
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
Mike Yuan
8b8edb512a
env-util: remove unneeded DISABLE_WARNING_FORMAT_NONLITERAL
_printf_ is used, so this shouldn't emit a warning
in the first place.
2024-03-12 15:41:51 +08:00
Mike Yuan
5d789ba5a6
Merge pull request #31671 from AdrianVovk/homework-cifs-credentials
homework-cifs: Pass password via fd
2024-03-12 15:40:43 +08:00
Mike Yuan
18eebde33a
Merge pull request #31713 from YHNdnzj/pidref-equal
pidref: use fd_inode_same to compare pidfds
2024-03-12 14:15:36 +08:00
Yu Watanabe
06baee4ea3
Merge pull request #30021 from yuwata/dhcp-client-id-cleanups
dhcp-server: save bound leases to persistent storage, and load it on start
2024-03-12 13:40:09 +09:00
Ross Burton
59e33acc8e tests/run-unit-tests: add option to skip tests
In automated QA environments there may be tests that are known to fail,
and being able to skip them is useful to remove known failures from the
test log.

Signed-off-by: Ross Burton <ross.burton@arm.com>
2024-03-11 23:27:01 +00:00
Luca Boccassi
b6fb31be45
Merge pull request #31721 from aafeijoo-suse/service-util-help-fix
shared/service-util: actually use the `bus_introspect` argument in `help()`
2024-03-11 18:13:57 +00:00
Ross Burton
4a052a718a test/run-unit-tests: sort the test cases we're executing
When reading test logs manually it is a lot easier when the tests are
sorted by name rather than by disk order.

Signed-off-by: Ross Burton <ross.burton@arm.com>
2024-03-11 18:11:30 +00:00
Adrian Vovk
606a1f203c
homework-cifs: Pass password via fd
Pass the password into mount.cifs via a file descriptor, rather
than putting it into a plain-text file in /tmp. This uses the $PASSWD_FD
environment variable, which is undocumented but has existed since
forever (initial commit from 2010 [1] has it already)

[1]:
https://git.samba.org/?p=cifs-utils.git;a=blob;f=mount.cifs.c;hb=ce0b1609a9eedce6c5eb20eab287ea44217c0a6a#l1477
2024-03-11 13:07:06 -04:00
Yu Watanabe
1c4411b7ff test-network: add test case for DHCP server lease file 2024-03-12 01:57:17 +09:00
Yu Watanabe
5582b36c38 network/dhcp-server: save leases in state directory
Then, we can read the lease file on restart, and the DHCP server will be
able to manage previously assigned addresses.

To save leases in the state directory /var/lib/systemd/network/, this
adds systemd-networkd-dhcp-server.service, and by default
systemd-networkd does not start the DHCP server without the heler
service started.

Closes #29991.
2024-03-12 01:57:17 +09:00
Yu Watanabe
35b2c1b0c8 fuzz-dhcp-server: also test saving and loading lease file 2024-03-12 01:57:17 +09:00
Yu Watanabe
033f119756 sd-dhcp-server: introduce sd_dhcp_server_set_lease_file() and dhcp_server_{save,load}_leases().
The functionality is not used networkd yet in this commit, but will be
used in later commits.
2024-03-12 01:57:17 +09:00