1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-06 13:17:44 +03:00
Commit Graph

63810 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
f4a7ec30a0 systemctl: fix printing of RootImageOptions
The type is a(ss), so a custom printer is required.

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

(cherry picked from commit 69c751c61cb2b386afe51f03b58f8f7ceeeb643e)
(cherry picked from commit 28ced52894cf6921d1fe9831f2def29de164e189)
(cherry picked from commit 64d833dfa6)
(cherry picked from commit a28e7e93ea)
2024-10-10 10:33:40 +01:00
Daan De Meyer
9787154222 repart: Determine verity sig size based on partition designator
Verity= is an image build concept, not a first boot concept, whereas
a partition designator is always available, so let's do the size stuff
based on that.

(cherry picked from commit e11745d000d7e9b3112bb336735c1bdfa77e9add)
(cherry picked from commit 4143bc70ed7d131cda9f0aa2f86d4aedd38e0fce)
(cherry picked from commit d371cb4725)
(cherry picked from commit d29a4b9e63)
2024-10-10 10:33:40 +01:00
Michal Koutný
52ccb2d558 core/cgroup: Apply IODevice*= directives in configured order
Different device paths may resolve to same device node
(lookup_block_device()), e.g.
        IOReadBandwidthMax=/dev/sda1 18879
        IOReadBandwidthMax=/dev/sda2 18878
where both partitions resolve to /dev/sda and when these values are
applied (they are associated with original paths, i.e. as if applied for
different device) in the order from io_device_limits.

The parsing code prepends, so they end up in reverse order wrt config
file. Switch the direction so that the order of application matches the
order of configuration -- i.e. semantics in all other unit file
directives.

Apply same change to all directives that use per-device lists. (The
question whether partitions should be resolved to base device is
independent.)

And apply the changes equally to DBus properties write handlers.

Fixes #34126

(cherry picked from commit 0fa0dfa04465651a18107d503f9967f84bd761d1)
(cherry picked from commit 00dfa7964b5e48a37596207ad8b2862b157cffaf)
(cherry picked from commit f45acd05be)
(cherry picked from commit 8846e2146a)
2024-10-10 10:33:40 +01:00
Daan De Meyer
4eb2cafe22 Add an extra debug log to dissect_image()
(cherry picked from commit 0121b84e41cd187e44c275a23db1a656656ec37f)
(cherry picked from commit efd5e357d7ed6b7def0d12631835efd6a5bf5f5a)
(cherry picked from commit cef973c15d)
(cherry picked from commit 8453f775b0)
2024-10-10 10:33:40 +01:00
Yu Watanabe
6449cd6417 sd-ipv4acd: fix assertion triggered when an ARP received in STARTED state
When a network is busy, an ARP may be received before the timer event
source triggered first time.

Fixes #34489.

(cherry picked from commit 146b44d0a0001712ced2f22ca76d242eedac26ad)
(cherry picked from commit 06eb9b14829f3a5819f6daefb09fdb855cd868f4)
(cherry picked from commit b054898f12)
(cherry picked from commit 8ed0c0bc48)
2024-10-10 10:33:40 +01:00
Yu Watanabe
232eeb16a5 test: add tests for seccomp_suppress_sync()
(cherry picked from commit c07e10628b6add9ee9664956a28d3f727c9848f8)
(cherry picked from commit 308c93c51f85f1b6a5e6a3def951fa8e5643048d)
(cherry picked from commit 299c64d8c2)
(cherry picked from commit 0dd69495e1)
2024-10-10 10:33:40 +01:00
Yu Watanabe
a83ca1a250 seccomp-util: pass negative fds as is to fsync() and friends
Closes #34478.

Co-authored-by: Mike Yuan <me@yhndnzj.com>
(cherry picked from commit 144fbbac235b6b89d5d31795be1cc0dca9852ccc)
(cherry picked from commit 4bbd6f589ad97a0df6ab59e03c8c535d298d05eb)
(cherry picked from commit 04a54264be)
(cherry picked from commit c70e6577e1)
2024-10-10 10:33:40 +01:00
Luca Boccassi
7778e248d8 portable: ensure PORTABLE_FORCE_ATTACH works even when there is a leftover unit
Force means force, we skip checks with PID1 for existing units, but
then bail out with EEXIST if the files are actually there. Overwrite
everything instead.

(cherry picked from commit 1e2d1a7202400e08a00782f32804fdc503259806)
(cherry picked from commit 2552348da2c961ac9732614eb129228bba4d51da)
(cherry picked from commit 5ce348ab30)
(cherry picked from commit 7bdcb23751)
2024-10-10 10:33:40 +01:00
Luca Boccassi
e31a80da8a hwdb: update to main@{2024-09-10}
git restore -s origin/main hwdb.d/ test/hwdb.d

(cherry picked from commit f13e3a93d7c2c549ff9a83cdbb04c30ab9e46bea)
(cherry picked from commit 799ecea375)
(cherry picked from commit ea9af9d780)
2024-09-11 15:10:37 +02:00
Yu Watanabe
bf4bc357f4 tree-wide: check if non-empty password is acquired
(cherry picked from commit 204529d0fcde9a95119b489225620f36649c2f5b)
(cherry picked from commit e80e9dce63787d1d4494ed65d7c27018344387d5)
(cherry picked from commit a505f10b4b)
(cherry picked from commit 1a62817475)
2024-09-11 15:10:37 +02:00
Yu Watanabe
339e0b4c31 ask-password: refuse empty password strv
Fixes #34270.

(cherry picked from commit 623a8b1922bdbd2fb06bc5f2c67d3d6930efc58e)
(cherry picked from commit 34881c9d5afdd05e9e6f1824cbea9d1954ea80c0)
(cherry picked from commit 553d5b03bd)
(cherry picked from commit abaef1ab97)
2024-09-11 15:10:37 +02:00
Yu Watanabe
2fa6459cb3 test: add test case for systemd-repart --seed=random
For issue #34257.

(cherry picked from commit 56d6ebd40468e2a743b39ad7d87b0675bdf9a042)
(cherry picked from commit 69282da9aab90c2dc1e440b04af5b2163779515a)
(cherry picked from commit fbfe769c45)
(cherry picked from commit 1211e6c770)
2024-09-11 15:10:37 +02:00
Yu Watanabe
b859991a8b repart: initialize seed earlier
As the seed is used by context_load_partition_table() -> derive_uuid().

Fixes #34257.

(cherry picked from commit b8a8000aba4620a1d93ac1d04dbb86050d9c5fe8)
(cherry picked from commit f85a4fba330822c44f9b2deb527acecc03bcfed9)
(cherry picked from commit 175dafa27b)
(cherry picked from commit ed474d3ede)
2024-09-11 15:10:37 +02:00
Yu Watanabe
675c5775f9 nspawn: refuse to bind mount device node from host when --private-users= is specified
Also do not chown if a device node is bind-mounted.

Fixes #34243.

(cherry picked from commit efedb6b0f3cff37950112fd37cb750c16d599bc7)
(cherry picked from commit a23591891b9e85107f39d103eabbb5bc9a6ced6f)
(cherry picked from commit bc72d9557c)
(cherry picked from commit b431088c81)
2024-09-11 15:10:37 +02:00
Mike Yuan
6dadc4e1fa audit-util: check correct errno
(cherry picked from commit 190a0953808608b099f9465f9e786e4efe276c26)
(cherry picked from commit c90ae08b0a5f2844504a109f71dcd773c16d8260)
(cherry picked from commit a3872e60ae)
(cherry picked from commit 4503a6d9e0)
2024-09-11 15:10:37 +02:00
Daan De Meyer
3adfd9f411 repart: Keep existing directory timestamps intact when copying
Otherwise, when merging multiple directory trees, the output becomes
unreproducible as the directory timestamps will be changed to the current
time when copying identical directories from the second tree.

We introduce a new copy flag to achieve this behavior.

(cherry picked from commit d850a544bc1f895decb452160c97a884a20b12b7)
(cherry picked from commit d5640c4f8583de2752a7f4e03006a1fa74942da1)
(cherry picked from commit 7a3b3ad522)
(cherry picked from commit 87cc4d908f)
2024-09-11 15:10:37 +02:00
Ronan Pigott
f37f685be6 resolved: clear the AD bit for bypass packets
When the bypass logic is invoked, such as for queries to the stub with
the DO bit set, be certain to clear the AD bit in the reply before
forwarding it if the answer is not known to be authentic.

(cherry picked from commit 13e15dae9f0b4566d3ea2ed058a5dd44751216da)
(cherry picked from commit 3a2be652282db2d55d5e28546e6c9a594fb8c43e)
(cherry picked from commit 6c243bbb70)
(cherry picked from commit edec5cc575)
2024-09-11 15:10:37 +02:00
Alyssa Ross
30fdceafa3 bootctl: don't load etc/machine-info from cwd
arg_root defaults to null, so if --root isn't given, this would try reading
etc/machine-info from the current working directory, which is likely to fail.

Fixes: 77db9ef2ab ("boot: Make sure we take --root into account everywhere.")
(cherry picked from commit 0452779b0054f5c2724b745b1db33bba1ac8e677)
(cherry picked from commit 8d7eef9ee5ead7c7b47b2ad4418529ac5cf17bb3)
(cherry picked from commit a573fd1848)
(cherry picked from commit 0b6faf92a2)
2024-09-11 15:10:37 +02:00
Raphaël Mélotte
4e088c3ad5 src/basic/missing_loop.h: fix missing LOOP_SET_BLOCK_SIZE
Builds with kernels headers < 4.14 fail with:

../src/shared/loop-util.c: In function ‘loop_configure_fallback’:
../src/shared/loop-util.c:237:31: error: ‘LOOP_SET_BLOCK_SIZE’ undeclared (first use in this function); did you mean ‘LOOP_SET_DIRECT_IO’?
                 if (ioctl(fd, LOOP_SET_BLOCK_SIZE, (unsigned long) c->block_size) < 0)
                               ^~~~~~~~~~~~~~~~~~~
                               LOOP_SET_DIRECT_IO

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

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
(cherry picked from commit 56ab1c54497d9fac74380ff9e11aaf931a917d2b)
(cherry picked from commit 0730ec4f3ecbbb550864ff0dbadeeeb5e271eb50)
(cherry picked from commit ed087e8658)
(cherry picked from commit e9e2923bc1)
2024-09-11 15:10:37 +02:00
Daan De Meyer
8bc9741422 test-dhcp-server: Gracefully handle the network being down
(cherry picked from commit 4cf7a676af9a79ff418227d8ff488dfca6f243ab)
(cherry picked from commit 2e52cf1df7f4a874331dcf607e0f4329ffb20bcd)
(cherry picked from commit db1d9bf996)
(cherry picked from commit 244ca2d63e)
2024-09-11 15:10:37 +02:00
Daan De Meyer
ff09fe5b27 test: Gracefully handle running within user namespace with single user
Unprivileged users often make themselves root by unsharing a user namespace
and then mapping their current user to root which does not require privileges.
Let's make sure our tests don't fail in such an environment by adding checks
where required to see if we're not running in a user namespace with only a
single user.

(cherry picked from commit ef31767ed7e21672a50b77e7b3935948aaba114c)
(cherry picked from commit ec5cdf9ba0e003de6f824a000c0bbe46fb4e0925)
(cherry picked from commit 4d4513c1fe)
(cherry picked from commit 1c514e7eee)
2024-09-11 15:10:37 +02:00
Daan De Meyer
35628ef46b test-netlink: Gracefully handle the loopback interface being down
(cherry picked from commit d098b8df6e5c1b4c834272dd1397345483116db6)
(cherry picked from commit f6f96b05585ef3b05cef843a2c1cb2c55e77d3ba)
(cherry picked from commit 77ee2a8d72)
(cherry picked from commit 8096e238c8)
2024-09-11 15:10:37 +02:00
Luca Boccassi
b93fd73575 mkosi: work around jammy's debootstrap issue
testing/sid is merged-usr via base-files now, so debootstrap fails.
Update the option on the fly.

(cherry picked from commit 7ca567cdc1)
2024-09-11 15:10:37 +02:00
Yu Watanabe
65bcac1198 test: remove temporary directory for test-ukify on success
(cherry picked from commit e9a5b4a10eaa10fd43c69d148d57c7f4d8e10a4f)
(cherry picked from commit 8e9af7b18ac5f2adf64b5f9bdc9c4df67ec5d721)
(cherry picked from commit bfe84a55f4)
(cherry picked from commit a2a7968701)
2024-08-19 20:22:44 +02:00
Thorsten Scherer
3630195780 repart: Fix misleading typo in GPT partition flag
Bit 60 is the one corresponding to ReadOnly, not 50.  Fix this.

(cherry picked from commit 932cc94436e653d0487c29e0dd44685610cd7bcb)
(cherry picked from commit 2665618555d08fc3877043cac392f1b6573811b7)
(cherry picked from commit f38c19bc69)
(cherry picked from commit 5ae6c773e4)
2024-08-19 20:22:44 +02:00
Daan De Meyer
778f622380 docs: Mention the new mount API in the container interface doc
Let's mention that the new mount API may be used to establish new
mounts in a container without needing the /run/host/incoming directory.

(cherry picked from commit 74cc5e2041a2c32e1824b32316bd95f2c8a811f5)
(cherry picked from commit 65eff444c4fa7be5eb1be71c5d94ab8732167e11)
(cherry picked from commit 53d92de4b4)
(cherry picked from commit c12ef9e5dd)
2024-08-19 20:22:44 +02:00
Ivan Shapovalov
468144c1f5 core/exec-invoke: call setpriority() after sched_setattr()
The nice value is part of struct sched_attr, and consequently invoking
sched_setattr() after setpriority() would clobber the nice value with
the default (as we are not setting it in struct sched_attr).

It would be best to combine both calls, but for now simply invoke
setpriority() after sched_setattr() to make sure Nice= remains effective
when used together with CPUSchedulingPolicy=.

(cherry picked from commit 711a157738b3dcd29a5ebc8f498eb46bfac59652)
(cherry picked from commit b628d4dfa61234d28ffaa648ec09c5e9972f832a)
(cherry picked from commit 4994f15f35)
(cherry picked from commit c90ba5eb8c)
2024-08-19 20:22:44 +02:00
Yu Watanabe
5159b7af61 meson: enable -Wunterminated-string-initialization
With af1a6db58fde8f64edcf7d27e1f3b636c999934c, now we can build with the
option.

(cherry picked from commit f548bc4011bcdab008b125b9d0993817efa00718)
(cherry picked from commit 772549666cf291d85c28d3bfc1ab2b7227422d4f)
(cherry picked from commit da229ea89a)
(cherry picked from commit fbc4335a4a)
2024-08-19 20:22:44 +02:00
Cristian Rodríguez
a26459885d basic|boot: silence Wunterminated-string-initialization gcc15 warnings
gcc15 has -Wunterminated-string-initialization in -Wextra and
warns about string constants that are not null terminated even though
the functions do do out of bounds access.
Silence the warnings by simply not providing an explicit size.

(cherry picked from commit af1a6db58fde8f64edcf7d27e1f3b636c999934c)
(cherry picked from commit ca09bc33e8b2cbc7c410c300b6df5cf3ce437a3b)
(cherry picked from commit f6f0d85135)
(cherry picked from commit e49ce1b1a5)
2024-08-19 20:22:44 +02:00
Nick Rosbrook
f2c2b65ba7 sysusers: check if requested group name matches user name in queue
When creating a user, check if the requested group name matches a user
name in the queue. If that matched user name is also going to be a group
name, then use it for the new user too. In other words, allow the
following:

 u foo -
 u bar -:foo

when both foo and bar are new users.

Fixes #33547

(cherry picked from commit 18a8f03e5160ca3828d327d9bbd1b32f26d792a3)
(cherry picked from commit edf52384c2e99cd5af9bcd4ae4b13fd8f79596d3)
(cherry picked from commit 25003a6450)
(cherry picked from commit ed2da0379a)
2024-08-19 20:22:44 +02:00
Yu Watanabe
bc255767a7 journal: comment the default value in journald.conf
(cherry picked from commit 0d113f8e70243c1a8f0587105195e51e027a4725)
(cherry picked from commit 8d5806b1e22798d8ee18b889af47568f5fccf3ed)
(cherry picked from commit 5ee15b924e)
(cherry picked from commit 459fdc1c34)
2024-08-19 20:22:44 +02:00
Yu Watanabe
643780a559 resolve: refuse invalid service without type field
Fixes Fixes #33935.

(cherry picked from commit b48ab08732a76b7337628e1e716f11c687000903)
(cherry picked from commit 0195db6e919e80bdd6b4b706ebc24d5e935f5422)
(cherry picked from commit 7b1bb6e0bc)
(cherry picked from commit bafd8fcb36)
2024-08-19 20:22:44 +02:00
Luca Boccassi
d62a0aaf0c base-filesystem: do not attempt to create a /lib64 -> /usr/lib/<tuple> symlink
In multi-arch distributions (debian and derivatives) multiarch tuples under
/usr/lib are used, such as /usr/lib/x86_64-linux-gnu/ but the /lib64 symlink
should never point there, it should always point to /usr/lib64, as that's
how they are set up by distribution-specific tools.

https://packages.debian.org/bookworm/amd64/libc6-i386/filelist
https://packages.debian.org/bookworm/mipsel/libc6-mips64/filelist
https://salsa.debian.org/md/usrmerge/-/blob/master/convert-usrmerge?ref_type=heads#L295
https://salsa.debian.org/md/usrmerge/-/blob/master/convert-usrmerge?ref_type=heads#L517
http://bugs.debian.org/1076491

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

(cherry picked from commit b75c13731ee0867a8d7889348fc8da1869af7551)
(cherry picked from commit 38caeac7680b3f7a81b741336f57f9b56d040297)
(cherry picked from commit b2738ee815)
(cherry picked from commit 3b1f76da88)
2024-08-19 20:22:44 +02:00
Ronan Pigott
b8316a0ca3 resolved: don't treat conn reset as packet loss
tcp reset / icmp port-unreachable are markedly different conditions than
packet loss. It doesn't make much sense to retry in this case. It's
actually not clear if there is any benefit at all retrying tcp
connections, which were presumably already retried as necessary by the
tcp stack.

(cherry picked from commit ddd710a355acc698b48159f3e501dda5a7dc2704)
(cherry picked from commit f5376fea7de173e9369e8af569fc6ecabd0d7282)
(cherry picked from commit 030dbbc39e)
(cherry picked from commit 1b5bc5ab49)
2024-08-19 20:22:44 +02:00
Yu Watanabe
2d261daa16 import: check overflow
Fixes CID#1548022 and CID#1548075.

(cherry picked from commit f7012a93a7f04fa29c7933a4963aa17fcf120e97)
(cherry picked from commit 11c15905cd4759b89a1da63d05772c1f7c3744a4)
(cherry picked from commit a920cc9b3a)
(cherry picked from commit ff17a1023e)
2024-08-19 20:22:44 +02:00
Yu Watanabe
9d9458a00e network: request non-NULL SSID when a wlan interface is configured as station
To avoid conflicts with user .network file for the wlan interface with Bond=.
See https://github.com/systemd/systemd/issues/19832#issuecomment-857661200.

(cherry picked from commit e2becab08506d8a085f4c18231c7f354db16df9f)
(cherry picked from commit ad861b6ae6ee9660912f03f73f771c98f426753c)
(cherry picked from commit 2a182ae521)
(cherry picked from commit d00860118d)
2024-08-19 20:22:44 +02:00
Luca Boccassi
f94e0a3a6b efi: fix link to legacy EFI handover protocol
(cherry picked from commit 4d6ab7e8440845301c90211beb22015e7232faa1)
(cherry picked from commit c12c122e2ad3668848ffff69913006d420bda41d)
(cherry picked from commit 407ac39dd8)
(cherry picked from commit 2fa6dd1794)
2024-08-19 20:22:44 +02:00
Yu Watanabe
5d28f089ab network: call link_handle_bound_by_list() before trying to reconfigure interface
Otherwise, when an interface gained its carrier, the interface may not
have matching .network file yet, then link_reconfigure_impl() returns
zero, and link_handle_bound_by_list() is skipped.

Fixes #33837.

(cherry picked from commit 36b8ad085c6902631ad7054bffbda33d6d168823)
(cherry picked from commit 0d98178abb5ea470d03d05680e58ff0e59fe69bd)
(cherry picked from commit 84c4a44f17)
(cherry picked from commit 4efaf9dc9a)
2024-08-19 20:22:44 +02:00
Yu Watanabe
bb8b029b3b network: do not bring down bound interfaces immediately
Even if a timespan specified to IgnoreCarrierLoss= for an interface,
when the carrier of the interface lost, bound interfaces might be bring
down immediately.

Let's also postpone bringing down bound interfaces with the specified
timespan.

(cherry picked from commit e8eaed0240d642e70c567b08f3593e4cf45a255a)
(cherry picked from commit 9468a6ea47cfb8412875923d09b8a8ae6ee02119)
(cherry picked from commit 80e93a0640)
(cherry picked from commit f2e34bdb57)
2024-08-19 20:22:44 +02:00
Daan De Meyer
c98e7cdedf kernel-install: Try some more initrd variants in 90-loaderentry.install
On CentOS/Fedora, dracut is configured to write the initrd to
/boot/initramfs-$KERNEL_VERSION...img so let's check for that as well
if no initrds were supplied.

(cherry picked from commit b56920e36c5692c0dde701bfb48330653a9c62c9)
(cherry picked from commit 1cb21b2cb194501464c52c1f32ae55f593689cc3)
(cherry picked from commit 22acfc05a7)
(cherry picked from commit 7182b54b86)
2024-08-19 20:22:44 +02:00
Daan De Meyer
02edc3eef5 kernel-install: Only read cmdline from /proc/cmdline when not in container
If we're running from within a container, we're very likely not going
to want to use the kernel command line from /proc/cmdline, so let's add
a check to see if we're running from a container to decide whether we'll
use the kernel command line from /proc/cmdline.

(cherry picked from commit 35c01ec59e0c2e6bd06cb18ca2ff612c6a7ea35d)
(cherry picked from commit c386327fc851863abf4c27076bd368dfc55b83a0)
(cherry picked from commit 0b4d00b284)
(cherry picked from commit 2b3cc8d498)
2024-08-19 20:22:44 +02:00
Vladimir Panteleev
ba8c10a195 man: clarify systemd-path variable source
(cherry picked from commit 3f24fa57df552accc2a6f9ab4d36724ba7227eff)
(cherry picked from commit ec3f2c8c8ad86004d6048510382167ee5f1ded61)
(cherry picked from commit 8e0cb57134)
(cherry picked from commit 53493370d2)
2024-08-19 20:22:44 +02:00
Vladimir Panteleev
0b5bb2b1da man: improve ManagerEnvironment documentation
- Improve wording for explanation when these variables are inherited

- Clarify that these variables are not placed in the process environment block,
  so /proc/PID/environ cannot be used as a debugging tool

(cherry picked from commit 6c1e0823b04525716d9ee0031a2b6735d3f7dfa4)
(cherry picked from commit 5cf0c45f64079430b0b7c12ad323f238386260b0)
(cherry picked from commit 79f335d0ef)
(cherry picked from commit bb28a6c0b6)
2024-08-19 20:22:44 +02:00
Jose Ignacio Tornos Martinez
f410f29020 kernel-install: remove depmod generated file modules.weakdep
The new file, modules.weakdep, generated by depmod to get the weak
dpendencies information can be present
(05828b4a6e),
so remove it like the other similar files.

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
(cherry picked from commit eef4cd51f94d837bd0e71512c831634a2902522d)
(cherry picked from commit 0cdec6e1fef4174c0d04aaca195ab56750437535)
(cherry picked from commit ae0c61b4a7)
(cherry picked from commit d9abcf9466)
2024-08-19 20:22:44 +02:00
Yu Watanabe
7ac2395b6b sd-event: change error code -EINVAL -> -EIO
EINVAL should be used when a function is called with an invalid
argument. Here, the signal is not a function argument.

Follow-up for 7a64c5f23efbb51fe4f1229c1a8aed6dd858a0a9.

(cherry picked from commit ab9af70edb23f2a66e93e2e16f87cd98873885b7)
(cherry picked from commit 84f0eda3781f49ff7f3035861b02fe247b89d65e)
(cherry picked from commit da81ee2f78)
(cherry picked from commit 42885ab017)
2024-08-19 20:22:44 +02:00
David Tardon
e681d161fb sd-event: do not assert on invalid signal
The signalfd_siginfo struct is received from outside via a FD, hence
assert() is not appropriate way to check it. Just do a normal runtime
check.

(cherry picked from commit 7a64c5f23efbb51fe4f1229c1a8aed6dd858a0a9)
(cherry picked from commit 7a48ea958bf146a45cb4a3b7ff7aeb5885469196)
(cherry picked from commit 5fa8b5d74a)
(cherry picked from commit 74fa56ebc3)
2024-08-19 20:22:44 +02:00
David Tardon
75aefdd9c4 logind-dbus: check auth. for all inhibitor operations
Fixes #33834

(cherry picked from commit 639719e01065c3a2f557d70e4d8088c2ec71c7c6)
(cherry picked from commit b2df49a87b17ba79b6e97d87199ceb1e4cbdb5de)
(cherry picked from commit 76d1f0664c)
(cherry picked from commit 0d624910a4)
2024-08-19 20:22:44 +02:00
Dan Streetman
5a5d5b9c46 basic/bitfield: add bitfield operations
Add macros to manage bits in a bitfield (e.g. uint32_t, uint64_t, etc),
such as setting, clearing, checking bits, and iterating all set bits.

These are similiar to the bitmap operations, but operate on basic types
instead of requiring a Bitmap object.

(cherry picked from commit 33d9beed07)
2024-08-19 20:22:44 +02:00
Mike Yuan
273146fc75 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

(cherry picked from commit 268f58076f7e0258dce75f521d08199092279853)
(cherry picked from commit 4ad6b2631d73a574859a62d33715a7bdef810bcf)
(cherry picked from commit 1fc7e3473c)
(cherry picked from commit 9463b376bc)
2024-08-19 20:22:44 +02:00
Luca Boccassi
4990aaa954 hwdb: update to main@{2024-07-24}
git restore -s origin/main hwdb.d/ test/hwdb.d

(cherry picked from commit b731debea9221ca43edc49f85be23db2fde79492)
(cherry picked from commit 6c260ee034)
(cherry picked from commit 4c3f4584cc)
2024-07-25 09:16:58 +01:00