1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 01:55:22 +03:00
Commit Graph

75432 Commits

Author SHA1 Message Date
Jeffrey Bosboom
f7fa632682 docs/CONTROL_GROUP_INTERFACE.md: document accounting information available via D-Bus 2024-07-25 11:46:18 +01:00
Luca Boccassi
3bf483fc4f
Merge pull request #33727 from intelfx/work/analyze-capability-masks
analyze: capability: add support for decoding capability masks
2024-07-25 11:08:21 +01:00
Mike Yuan
268f58076f basic/log: do not treat all negative errnos as synthetic
Currently, IS_SYNTHETIC_ERRNO() evaluates to true for all negative errnos,
because of the two's-complement negative value representation.
Subsequently, ERRNO= is not logged for most of our own code.
Let's fix this, by formatting all synthetic errnos as positive.
Then, treat all negative values as non-synthetic.

While at it, mark the evaluation order explicitly, and remove
unneeded comment.

Fixes #33800
2024-07-25 12:03:59 +02:00
Daan De Meyer
42e9288180 tree-wide: Don't explicity disable copy-on-write when copying images
Since the copy helpers now copy file attributes as well, let's not
explicitly disable copy-on-write anymore when we copy an image. If
the source already has copy-on-write disabled, the copy will have it
disabled as well. Otherwise, the copy will also have copy-on-write
enabled.

This makes sure that reflinks always work as reflink is only supported
if both source and target are copy-on-write or both source and target
are not copy-on-write.
2024-07-25 11:56:07 +02:00
Daan De Meyer
2356104efc copy: Copy file attributes as well
Let's make sure we copy all file attributes that can be copied as
well.
2024-07-25 11:56:05 +02:00
Luca Boccassi
30e1cbbcad mkosi: update debian commit reference
* 7eebe8c0b1 autopkgtest: allow localectl in localed tests
* c08a88ffbb Update changelog for 256.4-1 release
* 03814c87fe Fix D-Bus policy for locale1 blocking
* 16f6130038 Drop last patch, all merged upstream
* fe6956e934 Install varlinkctl zsh completion file
* 9bc2a52832 Update upstream source from tag 'upstream/256.4'
* 8574241978 New upstream version 256.4
2024-07-25 10:46:56 +01:00
Luca Boccassi
a4c436c9d8 test: fix D-Bus policy override for TEST-73-LOCALE
We don't need to allow non-root, and the policy needs to specify destination
and interface too, to narrow it down

Follow-up for 7b5c38a91d
2024-07-25 10:43:48 +01:00
Daan De Meyer
5e49684521 Make read_attr_path() more generic
Let's make this an openat() like function so it can be used in more
scenarios.
2024-07-24 18:58:41 +02:00
Daan De Meyer
4dee4e0039 repart: Create disk image file with copy-on-write disabled on btrfs
COW on btrfs generally does not play well lots of random writes so
let's make the disk images generated by repart NOCOW by default on
btrfs like we do elsewhere across the codebase.
2024-07-24 18:58:41 +02:00
Daan De Meyer
b9c0b6c011 repart: Make partition files NOCOW if the disk image is NOCOW
On btrfs, reflinks into a disk image that has copy-on-write disabled
only work if the source has copy-on-write disabled as well so let's
make sure that's the case if the disk image has copy-on-write disabled.
2024-07-24 18:58:41 +02:00
Daan De Meyer
1b05ac946a fs-util: Add XO_NOCOW flag
Let's add a flag for xopenat() that immediately makes a file NOCOW
after opening it if it's supported.
2024-07-24 18:58:41 +02:00
Daan De Meyer
32dfe3b63e fs-util: Clean up properly in xopenat_full() on labelling error
If we fail to relabel the file, we should unlink the file or directory
again, so let's make sure we do that.
2024-07-24 18:58:41 +02:00
Daan De Meyer
0dd82dab91 fs-util: Handle dangling symlinks in openat_report_new()
openat() will always resolve symlinks, except if O_NOFOLLOW is passed
or O_CREAT|O_EXCL is passed. This means that if a dangling symlink is
passed to openat_report_new(), the first call to openat() will always
fail with ENOENT and the second call to openat() will always fail with
EEXIST.

Let's catch this case explicitly and fallback to creating the file with
just O_CREAT and assume we're the ones that created the file. We can't
resolve the symlink with chase() because this function is itself called
by chase() so we could end up in weird recursive calls if we'd try to do
so.
2024-07-24 18:58:41 +02:00
Daan De Meyer
b91ad56228 test-fs-util: Modernize openat_report_new() test 2024-07-24 18:58:41 +02:00
Daan De Meyer
372e96a5a1 test-id128: Use new assertion macros 2024-07-24 18:58:40 +02:00
Daan De Meyer
60a4505da4 test: Add ASSERT_EQ_ID128() and ASSERT_NE_ID128() 2024-07-24 18:58:40 +02:00
Daan De Meyer
8eb06fd162 test: Add ASSERT_FAIL() 2024-07-24 18:58:40 +02:00
Daan De Meyer
3d6c6f9b9e mkosi: Update to latest
Includes the required fix to make mkosi copy NOCOW disk images properly.
2024-07-24 18:58:38 +02:00
Ivan Shapovalov
3e7a029c28 analyze: capability: add support for decoding capability masks
This adds support in `systemd-analyze capability` for decoding
capability masks (sets), e.g.:

```console
$ systemd-analyze capability --mask 0000000000003c00
NAME                 NUMBER
cap_net_bind_service     10
cap_net_broadcast        11
cap_net_admin            12
cap_net_raw              13
```

This is intended as a convenience tool for pretty-printing capability
values as found in e.g. `/proc/$PID/status`.
2024-07-24 17:25:47 +02:00
Luca Boccassi
11d5e2b5fb mkosi: update debian commit reference
* c7138e0b87 Configure default DNS servers for upstream CI builds
* bc5d1afe1e Drop out-of-tree localed patch and use D-Bus policy instead
* b5f8ababde autopkgtest: set Release= in mkosi.local.conf to distinguish testing vs unstable
* 323afafd80 autopkgtest: add allow-stderr to timedated test
* 0291f361e3 Install valrinkctl zsh completion file
* f40b9eba02 d/t/control: add Depends: lib{systemd,udev}-dev for upstream
* 3def595de3 d/t/upstream: ensure correct ubuntu codename is used
* 531bb6817e d/t/boot-and-services: fix a couple python sytax warnings
* 963ac13b7d d/t/boot-and-services: skip test_tmp_cleanup if tmp.mount is overridden
2024-07-24 11:38:55 +01:00
MkKvcs
af5195f7a6 hwdb: add axis range corrections for the Lenovo Thinkpad E16 2024-07-24 08:24:36 +01:00
Luca Boccassi
acf0851dcf
Merge pull request #33823 from YHNdnzj/varlink-deserialize-again
core: reliably check if varlink socket has been deserialized; switch varlink server to pidref
2024-07-24 08:23:36 +01:00
vdovhanych
2cf425ec57 add udev rules for trezor hw wallet devices 2024-07-24 08:22:44 +01:00
Ronan Pigott
ddec353749 resolved: report svc params as a json object
This representation is significantly more useful. The previous array
format omitted the svc param key, which is not very useful.
2024-07-24 08:18:47 +01:00
Luca Boccassi
0d45d0ec58
Merge pull request #33810 from YHNdnzj/find-executable-simplify
path-util: minor cleanup for find_executable()
2024-07-23 23:08:19 +01:00
Luca Boccassi
3ac19d384d
Merge pull request #33809 from YHNdnzj/pidref-namespace
namespace-util: introduce pidref_namespace_open() and use it where appropriate; clean up mount-util a bit along the way
2024-07-23 23:03:26 +01:00
Luca Boccassi
8da8d6ce30
Merge pull request #33535 from neighbourhoodie/tests/dns-cache
Tests for DnsCache functions
2024-07-23 19:01:23 +01:00
Luca Boccassi
5aaf33ec96
Merge pull request #33534 from neighbourhoodie/tests/dns-query
Tests for DnsQuery functions
2024-07-23 18:47:14 +01:00
Mike Yuan
b4ff314ea0
core-varlink: switch to PidRef + manager_get_unit_by_pidref() 2024-07-23 19:38:58 +02:00
Mike Yuan
3ff91850a5
core-varlink: do not log about ENOENT if oomd isn't available
This is simply too noisy, since every invocation of
manager_varlink_send_managed_oom_update() would try to
connect to oomd if not already.
2024-07-23 19:38:58 +02:00
Mike Yuan
16d8249ae4
core-varlink: add missing runtime_scope check for manager_varlink_init_user() 2024-07-23 19:38:57 +02:00
Mike Yuan
d4e5c66ed4
core: reliably check if varlink socket has been deserialized
Follow-up for 6906c028e8

The mentioned commit uses access() to check if varlink socket
already exists in the filesystem, but that isn't sufficient.

> Varlink sockets are not serialized until v252, so upgrading from
> v251 or older means we will not listen anymore on the varlink sockets.
>
> See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1074789
> for more details as this was found when updating from Debian Bullseye to a new version.

After this commit, the set up of varlink_server is effectively
split into two steps. manager_varlink_init_system(), which is
called after deserialization, would no longer skip listening
even if Manager.varlink_server is in place, but actually
check if we're listening on desired sockets.
Then, manager_deserialize() can be switched back to using
manager_setup_varlink_server().

Alternative to #33817

Co-authored-by: Luca Boccassi <bluca@debian.org>
2024-07-23 19:38:57 +02:00
Mike Yuan
e633e8627f
mount-util: reorder params for mount_in_userspace, clean up logging 2024-07-23 19:31:32 +02:00
Mike Yuan
974e34a018
mount-util: do not unnecessarily acquire mountns fd twice
This also enables us to use pidref_namespace_open().
2024-07-23 19:30:55 +02:00
Mike Yuan
706302897a
mount-util: clean up mount_exchange_graceful a bit, don't duplicate move_mount when fallback 2024-07-23 19:30:55 +02:00
Mike Yuan
ca13d3fc19
machine-dbus: use pidref_namespace_open() where appropriate 2024-07-23 19:30:55 +02:00
Mike Yuan
86a3c1fd95
namespace-util: introduce pidref_namespace_open() 2024-07-23 19:30:54 +02:00
Mike Yuan
30957ced45
namespace-util: explicitly specify namespace_info[]'s size
We do this already in all string lookup tables. This way
it's guaranteed that iterators which ends with _NAMESPACE_TYPE_MAX
wouldn't overrun the array.
2024-07-23 19:30:54 +02:00
Mike Yuan
0e7eda91f4
path-util: simplify final path for find_executable()
Currently, systemd-run ./test.sh would set Description=
to $PWD/./test.sh. This is quite ugly.
2024-07-23 18:48:15 +02:00
Mike Yuan
51b271ead7
path-util: trivial cleanup for find_executable_full() 2024-07-23 18:48:15 +02:00
Mike Yuan
7973f33e81 core: clean up Set/LoadCredential= parsers
Make logging consistent, plus introduce helper function
for adding creds to ExecContext.set_credential too.
2024-07-23 15:53:38 +01:00
Daan De Meyer
fffbfb4ed1 mkosi: Bump device timeout even more
I still manage to hit it in some cases so let's bump again.
2024-07-23 15:49:37 +01:00
Luca Boccassi
d111d76844 Merge pull request #33533 from neighbourhoodie/tests/dns-synthesize 2024-07-23 15:44:40 +01:00
James Coglan
5301548fbb resolved: tests for dns_synthesize_family() and dns_synthesize_protocol() 2024-07-23 15:44:07 +01:00
James Coglan
6fd7fc92cf resolved: tests for dns_synthesize_answer() 2024-07-23 15:44:07 +01:00
Mary Strodl
c73883143a sd-dhcp-server: persist hardware addresses in leases 2024-07-23 14:55:48 +01:00
James Coglan
538a3dc298 resolved: tests for dns_query_string() 2024-07-23 14:17:23 +01:00
James Coglan
c080825f14 resolved: tests for dns_query_go(); multiple search domains for dns_query_candidate_notify() 2024-07-23 14:17:23 +01:00
James Coglan
0a547aea96 resolved: refactor environment management in dns_query_go() tests 2024-07-23 14:17:23 +01:00
James Coglan
8501f44563 resolved: tests for dns_query_go() when configured with search domains 2024-07-23 14:17:23 +01:00