1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-27 18:04:05 +03:00

69796 Commits

Author SHA1 Message Date
Yu Watanabe
778823fd52 backlight: supprt ID_LEDS_CLAMP udev property for leds subsystem devices
Closes #30507.
2024-01-03 09:30:41 +09:00
Yu Watanabe
e0feaedbd9 udev/dmi-memory-id: update table with latest SMBIOS specification
Closes #30699.
2024-01-03 08:43:17 +09:00
Yu Watanabe
7e08a337b2
Merge pull request #30700 from yuwata/storagetm-fixlets
storagetm: several trivial fixlets
2024-01-03 08:42:58 +09:00
Yu Watanabe
cb0a3b8c14 network/route: drop TTL propagate support for MPLS routes
This effectively reverts 9b88f20aba6a78baf18d89e99ff31d5ee40856b8.

We do not support MPLS routes, only IPv4 or IPv6 routes are supported.
2024-01-03 08:41:53 +09:00
Yu Watanabe
6ba147485e network/queue: fix potential double-free on oom
Currently, link_queue_request_safe(), which is a wrapper of
request_new(), is called with a free function at
- link_request_stacked_netdev() at netdev/netdev.c,
- link_request_address() at networkd-address.c,
- link_request_nexthop() at networkd-nexthop.c,
- link_request_neighbor() at networkd-networkd.c.

For the netdev case, the reference counter of the passed object is increased
only when the function returns 1. So, on failure (with -ENOMEM)
previously we unexpectedly dropped the reference of the NetDev object.
Similarly, for Address and friends, the ownership of the object is moved to the
Request object only when the function returns 1. And on failure, previously
the object was freed twice.

Also, netdev_queue_request(), which is another wrapper of request_new()
potentially leaks memory when the same NetDev object is queued twice.
Fortunately, that should not happen as the function is called only once
per object.

This fixes the above issue, and now the ownership or the reference
counter of the object is changed only when it is succeeded with 1.
2024-01-03 08:41:36 +09:00
Yu Watanabe
ff49e703ff
Merge pull request #30691 from yuwata/resolve-ipv6
resolve: do not listen to IPv6 when disabled by sysctl
2024-01-03 08:41:14 +09:00
Frantisek Sumsal
995bf013a1 test: rewrite test-exec-deserialization.py
Rewrite the test in bash and make it part of our integration test suite,
so it's actually executed in all our upstream CI environments.

The original test is flaky in environments where daemon-reload might
occur during the test runtime (e.g. when running the test in parallel
with the systemd-networkd test suite). Also, it was run only in CentOS
CI in limited way (i.e. without sanitizers), since it tests the host's
systemd, instead of the just built one.

Resolves: #29943
2024-01-03 08:40:55 +09:00
Mike Yuan
0e3638380d various: unexport a few internal structs
We don't expose destructors for these internal structs already.
Let's make the struct itself implementation detail too.
2024-01-03 08:40:33 +09:00
Mike Gilbert
049f178b80 storagetm: ensure we pass dev_t* to sd_device_get_devnum
On MIPS32 OABI, st_rdev is unsigned long, not dev_t. Use a temporary
variable to avoid an incompatible pointer.

Bug: https://bugs.gentoo.org/920576
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=21278
Fixes: https://github.com/systemd/systemd/issues/30626
2024-01-03 05:37:25 +09:00
Yu Watanabe
69f4a87c8c storagetm: fix use of wrong stat element 2024-01-03 05:19:00 +09:00
Yu Watanabe
30c1cded77 storagetm: always hash stat.st_mode
To make the hash function consistent with the compare function.
2024-01-03 05:07:43 +09:00
Yu Watanabe
6e6b59ed00 unit: order systemd-resolved after systemd-sysctl
Otherwise, IPv6 enable/disable setting may be changed after resolved is
started.
2024-01-03 04:07:15 +09:00
Yu Watanabe
a53082f07d resolve: do not listen to IPv6 when disabled by sysctl
Fixes #30669.
2024-01-03 04:03:30 +09:00
Yu Watanabe
e40a67809b
Merge pull request #30689 from mrc0mmand/even-more-cocci-tweaks
coccinelle: drop a couple of FIXMEs
2024-01-03 03:25:30 +09:00
Frantisek Sumsal
eddecf4f6c coccinelle: add a rule for in_addr_hash_func()
Follow-up for c01a5c0.
2024-01-02 19:12:05 +01:00
Frantisek Sumsal
cd4b16c082 coccinelle: drop a couple of FIXMEs
Turns out Coccinelle can handle compound literals just fine, the parsing
errors were caused by incorrectly parsed macros in code before the
literals, so let's just provide simplified versions for such macros.

The parsing error in `Type *foo[ELEMENTSOF(bar)] = {};` is actually
harmless; it occurs only when creating an array of pointers for a type
that's in an external header and it occurs only on the first parser's
pass, subsequent passes resolve the type correctly.

Also, unset ENABLE_DEBUG_HASHMAP, so Coccinelle doesn't expand the
hashmap debug macros.

As for the remaining FIXMEs, I opened a couple of issues in the
Coccinelle upstream to see if they can be fixed there (or at least
properly analyzed).
2024-01-02 19:12:05 +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 138224fc807091d31f19a3b22f066d6044626001, 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 ac1b7b9e1933c14bc7bf36d4f32a888afb3f2f4d.

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 818bb6f4825b57c2cd2783fbffe2b2ef82a31573.
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 ed18c22c989495aab36512f03449222cfcf79aa7

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