1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-20 14:03:39 +03:00

63316 Commits

Author SHA1 Message Date
Michal Sekletar
5c149c77cb resolved: actually check authenticated flag of SOA transaction
Fixes #25676

(cherry picked from commit 3b4cc1437b51fcc0b08da8cc3f5d1175eed25eb1)
(cherry picked from commit 6da5ca9dd69c0e3340d4439413718ad4963252de)
(cherry picked from commit 029272750fe451aeaac87a8c783cfb067f001e16)
2023-12-23 20:42:40 +01:00
Zbigniew Jędrzejewski-Szmek
ee32905903 test_ukify: raise timeout
With a sufficiently large initrd, the tests take 25 s on my laptop.
Normally, they'd be quicker, but since we use what we find on the
system, we don't control this. Let's raise the timeout to reduce the
chances of a spurious failure.

(cherry picked from commit 6bc99ec29b8512a668f0c82b7e2731f0335c91d8)
(cherry picked from commit 2018ccef6645ce00c784369a22dc4e98f6d7061d)
(cherry picked from commit 9dd12679ecffc7518de3caaddac3603a4e0a7511)
2023-12-23 20:42:40 +01:00
Yu Watanabe
29c975fca0 test-network: add test case for issue #30403
(cherry picked from commit 5e46ca9890bb463644f91426678570edc2891163)
(cherry picked from commit fbe064cc74a7a25060d4311b5f3a616b02f3e9c9)
(cherry picked from commit d948b169ad6285adb2f5b32bbaccb013d4223f87)
2023-12-23 20:42:40 +01:00
Yu Watanabe
be2c9edc53 network/route: fix reachability check when peer address is specified
When an address with peer address is specified, the kernel by default
adds the prefix route for the peer address. When ManageForeignRoute=no
is set, then we also needs to check the prefix for the peer address.

Fixes #30403.

(cherry picked from commit e091ed405353624f2da28e2f3210e205f7eab370)
(cherry picked from commit b641ced147d94578375f5e25d616241fef195a4a)
(cherry picked from commit 752b9b0f6cd59fe70b63066edac3bc6a75505811)
2023-12-23 20:42:40 +01:00
Andrew Sayers
fd7205f5c5 Fix a typo in the org.freedesktop.systemd1 man page
(cherry picked from commit ff47602f5ee6b3301c24e2baa6449245666f2252)
(cherry picked from commit 056186b038fd465246e7a52ca3b0754bfaada474)
(cherry picked from commit fe62f214fed55c0e6f3211af4b825a652c26bf59)
2023-12-23 20:42:40 +01:00
Lennart Poettering
f7491ce9e6 userdbd: properly close the listener fd on exit
(cherry picked from commit 0e3cb8cf88ae3297f53591c70bd1f56832e1ef83)
(cherry picked from commit af1a61b3cfa80c3ebbabc2518102913929c3e248)
(cherry picked from commit 0ff569798cbb8203ec7af5dbffa0c6ab9b9a4e98)
2023-12-23 20:42:40 +01:00
Colin Walters
b28b9db29b docs/CREDENTIALS: Don't write authorized_keys with executable bits
No reason to make this file executable.

(cherry picked from commit 47374e06014c5ef7de123607630e2094f3863b81)
(cherry picked from commit 30f9309fe5abc12485ebc36b354143f9ffc8222e)
(cherry picked from commit e09ef877118a3d38a366cfc93db05dbe4e48d833)
2023-12-23 20:42:40 +01:00
Frantisek Sumsal
850d3d70bc test: install all necessary units & generators for LVM on Debian
And derivates.

Replaces: #30458
(cherry picked from commit f9ba9d3eb7c350f31132ccd9ed1ee3c0c693f5c5)
(cherry picked from commit b1dba6bcaae70849394f34be8850f2e5e2559633)
(cherry picked from commit dc7bc3d34e1cf87e6cf93ba901bd21af24b1ae71)
2023-12-23 20:42:40 +01:00
Lennart Poettering
83137edaad cgroup: bring list of delegated cgroup attributes up-to-date with current kernels
THis brings the list of attributes to delegate to managers of subcgroups
to the state of kernel 6.6.

We probably should unify this list, and maybe generate it automatically
from /sys/kernel/cgroup/delegate, but let's do that another time.

(cherry picked from commit 2c70a81de6e9a3b4c13899dfd75d155ba6143f6e)
(cherry picked from commit 9b298cb7e888232d6ca42588062e8db3dfd5f0e9)
(cherry picked from commit da222a2f105c70e8d2fa17cdf24261603443b382)
2023-12-23 20:42:40 +01:00
Lennart Poettering
002adef4e7 varlink: improve compat with varlink C reference implementation
The reference implementation seems to set the 'parameters' field for
method calls to 'null' if nothing is specified on its command line. We
so far only could deal if the parameters field was unset or set to the
empty object. Let's also accept the 'null' type.

(cherry picked from commit f2ad89248b2177119b75bf82be69716166243996)
(cherry picked from commit 2dab8bce02123dc37f4befee16d28da390c3ddd3)
(cherry picked from commit 8760f4c9fe95a3d77af49c8920b82e996d2cdf95)
2023-12-23 20:42:40 +01:00
Lennart Poettering
460ce98eef dissect-image: move comment to right place
The image name is extracted from the image path originally passed in,
i.e. not the contents of the image. And the image UUID is directly
retrieved from the partition table, hence also not from the contents.
Let's hence move the comment to separate out the stuff extract from the
file systems (and thus only available when mounting/with privs/with
block devices) from the data available without any of that.

(cherry picked from commit 3f8229fbb069c39d2082a0f49f07ddbce61c7b75)
(cherry picked from commit 09dab16e3983ae28469be28671916eee41a1a3fd)
(cherry picked from commit b945258122076fc325583fa3dbd8ddf101c009f9)
2023-12-23 20:42:40 +01:00
Lennart Poettering
053c90d59b dissect-image: fix fd leak in dissected_image_acquire_metadata()
We have to go through the "finish" label to properly close all pipes in
the error path, so that we don't leak them.

(cherry picked from commit 8d5e61db432932faa5b2d8531ab804bb4da4791d)
(cherry picked from commit f6cf899f1ed55f9ed140f1a4b57d6e27b973854b)
(cherry picked from commit 92479eb37614c0b7d9b83c686d8940ee2ea32a90)
2023-12-23 20:42:40 +01:00
Lennart Poettering
d331dddde0 dissect-image: don't try to validate an extension release file with no image name
Otherwise we might validate the OS release file instead…

(cherry picked from commit a8e8bcfb7dbe53158c30b236e66814b32a6b748b)
(cherry picked from commit 1c7df1e8e5b45704f51b7c2319f9eb83c0ba6d6f)
(cherry picked from commit a56088a5ded315e48d795dea69a94416a5173960)
2023-12-23 20:42:40 +01:00
Lennart Poettering
bc674eab3e dissect-image: handle 'continue' event in metadata acquisition uniformly
Let's jump to the same label in all cases, that closes the associated
pipe, systematically.

(cherry picked from commit 29b4db7ede36ecba27b417e8d3e834ebacd36e89)
(cherry picked from commit 1cda778cb380bd94973591417fcce4b4d15a32a4)
(cherry picked from commit fa143b98b79e60efb8e9d1a09cce31d2c909e99b)
2023-12-23 20:42:40 +01:00
Frantisek Sumsal
ad7fbe4ec4 test: mask the mdmonitor.service
It's pulled in by one of the udev rules (63-md-raid-arrays.rules) and it
fails every time, because there's no valid email address in
/etc/mdadm.conf:

[    5.778153] testsuite-64.sh[403]: mdadm: array /dev/md/mdmirror started.
[    5.819137] kernel: md/raid1:md127: not clean -- starting background reconstruction
[    5.819141] kernel: md/raid1:md127: active with 2 out of 2 mirrors
[    5.819159] kernel: md127: detected capacity change from 0 to 129024
[    5.821950] kernel: md: resync of RAID array md127
...
[    5.887192] mdadm[424]: mdadm: No mail address or alert command - not monitoring.
[    5.890772] systemd[1]: Starting mdmonitor.service...
[    5.891718] systemd[1]: Started mdmonitor.service.
[    5.892570] systemd[1]: mdmonitor.service: Main process exited, code=exited, status=1/FAILURE
[    5.892618] systemd[1]: mdmonitor.service: Failed with result 'exit-code'.

And as we (re)assemble the MD devices multiple times, this gets quite
noisy, especially since we later start hitting the service start rate
limit.

Fedora has the mdmonitor.service patched, so it won't start without
/etc/mdadm.conf being present, but Arch uses the upstream unit which
doesn't have such guard.

Let's just mask the service completely, which replaces all that noise
with one warning:

[    6.553583] testsuite-64.sh[294]: + udevadm wait --settle ...
[    6.580700] systemd[1]: sys-devices-virtual-block-md127.device: Failed to enqueue SYSTEMD_WANTS job, ignoring: Unit mdmonitor.service is masked.

(cherry picked from commit 22e31655f3f9f54d932d4f48b92b36698e701729)
(cherry picked from commit ef548643668491d4a8371186d2575eb4e4499b4e)
(cherry picked from commit d2e8e28637d56e891c1882d8edda2985935a1bdd)
2023-12-23 20:42:40 +01:00
Lennart Poettering
5794ad609c dissect-tool: right-align the partition number
The right-alignment was applied to the wrong column, because neither
ee8e497d249ab2e2df92aa024274f5b817270114 nor
1474d7ac2d308204e599a2502a8b5625bca76bcc updated the column count as
they should have.

(cherry picked from commit 748e87a7911813d64e34f2366df842b210a27f11)
(cherry picked from commit 8ff96162aa7e724fc0137afab9ad35ec662909df)
(cherry picked from commit 99fdfaa5076b530c02b6f87cd1ab23612ecd251a)
2023-12-23 20:42:40 +01:00
Lennart Poettering
3786a2ed42 execute: improve log message about TTY ownership reset failures
(cherry picked from commit 026a8b022e1f0883b09d99c360a738506814407a)
(cherry picked from commit 5af41ce0bce0915865f8e830bfe7cc50ac2b7e53)
(cherry picked from commit fb159f16c4b8d6c5ffd2ec7eb539ecbd0969420e)
2023-12-23 20:42:40 +01:00
Mike Yuan
cdc8d56e75 core/job: emit job start message if we're only waiting for unit state
Currently, start/stop messages for device units are not used, since
job_perform_on_unit() does nothing and we simply wait for unit status
change. I think we still want some nice log messages explaining what
the start jobs for devices are doing, so let's fix this.

(cherry picked from commit d8deb18720a494a68251e14e521570c4bf6e2b96)
(cherry picked from commit 7ee2d7d9cae5c6f38378787c7e99d474c8916032)
(cherry picked from commit c6f246b2ff8988dc81df1ecb0921abd13f2c8b1b)
2023-12-23 20:42:40 +01:00
Mike Yuan
faeae4a8f6 core/device: add stopping job message
The use case for stopping a device unit is indeed narrow,
but we still want to show a clear message.

Preparation for later commits.

(cherry picked from commit 3f4a7a472f90949425f76ffde39a6c94a0b77e0b)
(cherry picked from commit 7feb10fdda886d50fa7ba2e252b31ba815411893)
(cherry picked from commit cd24f42fe12673eb9001ad74e842bdd2ba80a206)
2023-12-23 20:42:40 +01:00
Yu Watanabe
1cdd0c2804 test-network: add test for small MTU for vcan
Prompted by https://github.com/systemd/systemd/issues/30140#issuecomment-1837973580.

(cherry picked from commit 470a329d9849d108e28f72d00dd130d130cebb01)
(cherry picked from commit 16f193d51861db4befd6228b773cf7a86c03339a)
(cherry picked from commit 6f584de56e86170c8e4bd426a4b4829b8343f1c0)
2023-12-23 20:42:40 +01:00
Yu Watanabe
f3cb3b9440 network: allow to configure interface MTU for CAN devices
Previously, even if MTUBytes= is specified in matching .network file,
the setting was ignored for CAN devices.

(cherry picked from commit 941f8e1399bcbac54c9cc862a227e0e63cebc538)
(cherry picked from commit 394da666e074218b597198347a8159b8b56c0029)
(cherry picked from commit 389286196cd44cfc27def57d746fe745d6f79f6e)
2023-12-23 20:42:40 +01:00
Yu Watanabe
1f49a7367e network: the maximum MTU size for CAN interface may be changed later
So we should not reduce the requested size to the current maximum
before applying CAN FD mode.

(cherry picked from commit 15be80428204b57ca55272d2b45703047ad6f28d)
(cherry picked from commit d238ead08297f1e4a46a72953d2c5377fbe3111c)
(cherry picked from commit 37fc5e2aaf6ac2c97fc52d5f66ae1012f41e8d02)
2023-12-23 20:42:40 +01:00
Yu Watanabe
b980cd4a2e network: update MTU after CAN specific configs applied
Changing FD mode may trigger change of MTU and maximum MTU size.
See kernel documents about CAN FD mode:
https://docs.kernel.org/networking/can.html#can-fd-flexible-data-rate-driver-support

(cherry picked from commit a60cc587d456c83e8bf77bc3d7fe3c9ed10f3c40)
(cherry picked from commit a2534533721eda624eaf066c0deed1eec5e5117a)
(cherry picked from commit f72587a42831592024c8c3ba9c3029060942a8c3)
2023-12-23 20:42:40 +01:00
Yu Watanabe
6ce4af1a43 parse-util: accept arbitrary MTU size when AF_UNSPEC
When [Link] MTU= is specified in a .network file, we have no idea about
that what kind of interface will be configured with the .network file.
The maximum and minimum MTU size depend on the kind of interface.
So, we should not filter MTU eagerly in the parser.

Closes #30140.

(cherry picked from commit a0460dfed617a73f7dbf36a6eb7e474e887ae780)
(cherry picked from commit 2fa0b50566829a2e72b61d9f453a5314192c19ab)
(cherry picked from commit cf8969ee3270413a8340cc824a9faa134227420c)
2023-12-23 20:42:40 +01:00
Yu Watanabe
7c894f8281 network-generator: refuse unexpected trailing strings
(cherry picked from commit b86f60bfb3340a9fa27cb6f127fba7c827481b50)
(cherry picked from commit c2cc0ca17923034130a0dc1118b20f5a96db8d95)
2023-12-23 20:42:40 +01:00
Yu Watanabe
eb808e1534 network-generator: allow to specify both IPv4 and IPv6 DNS servers
Follow-up for 923599523c10d8897551e081e6b00cd8002309c3.

(cherry picked from commit 816c269e55220924c4f8b712afd976e83ec0359e)
(cherry picked from commit 6db250e4aee95a6c79f2724092e79b2162d70540)
2023-12-23 20:42:40 +01:00
Yu Watanabe
068003c37f network-generator: add missing assertions
(cherry picked from commit 8ae81a1e00eb4ade24c86bc77cdd594d8dcb8d6a)
(cherry picked from commit 7a270a8df95758392271e9143433a6770caa3068)
2023-12-23 20:42:40 +01:00
Yu Watanabe
0471f090e4 network-generator: drop unused family argument
(cherry picked from commit 0b0865f50921a562d6dee454ad05567f875de8fe)
(cherry picked from commit b5b58fbd6e734f6c7b580cb133f827411544a2cd)
2023-12-23 20:42:40 +01:00
Yu Watanabe
326e756952 network-generator: relax requirement for peer address, route destination, and gateway
No functional changes, as the caller already sets them.

(cherry picked from commit 13a462b9d5dc9ccbbabdf8a37fd4b97c2e048d43)
(cherry picked from commit bb4ab1a5a8d2bbe36aecfd04e271c2b33c5d4f43)
2023-12-23 20:42:40 +01:00
Yu Watanabe
a1295dd327 test: set working directory even if it is expected that the command fails
Otherwise, parsing may unexpectedly succeeds but fail to run writing
.network files with permission error.

Follow-up for 6bc5de53e8410fdec817300185b7ad72cd7775dd.

(cherry picked from commit 9e6d58796158d0418e0e4ba641db5b00aacee695)
(cherry picked from commit 2bc39320fc05ff133620e30be134a1d3f4383be7)
2023-12-23 20:42:40 +01:00
Frantisek Sumsal
4763b5d3fb test: add a couple of tests for systemd-network-generator
Only for ip= stuff, for now.

(cherry picked from commit 6bc5de53e8410fdec817300185b7ad72cd7775dd)
(cherry picked from commit 75b2890c5d2ac1536459e7470f59369ad3e50a62)
2023-12-23 20:42:40 +01:00
Frantisek Sumsal
ce8212b9cf network-generator: allow specifying MAC address without MTU
Also, don't panic when both optional arguments are empty. This should
make the syntax compatible-ish with the dracut one from dracut.cmdline(7).

Resolves: #29855
(cherry picked from commit cc5244716baac64e92a1aac5d118c41ac7f82a00)
(cherry picked from commit c3a17ab2fa2eeeab67c3f1085eb9c69630bbd191)
2023-12-23 20:42:40 +01:00
Frantisek Sumsal
4d25f6ce58 network-generator: correctly handle IPv6 DNS servers in ip=
IPv6 addresses in the ip= assignment need to be enclosed in [], which
was handled for all IP-related fields except for the two optional DNS
fields.

(cherry picked from commit 923599523c10d8897551e081e6b00cd8002309c3)
(cherry picked from commit 7bcf4a419cb475332ae804252f474875a0001a65)
2023-12-23 20:42:40 +01:00
Yu Watanabe
e60c4b4512 test: add test cases for issue #30357
(cherry picked from commit 9d51ab78300364c71a0e1f138e1d2cbc65771b93)
(cherry picked from commit d644d2f562051a86f7a8b2a8e382cee315463bd9)
(cherry picked from commit 948239494414da16147162871bac109b197c35e7)
2023-12-23 20:42:40 +01:00
Yu Watanabe
ca77533a05 analyze: also find template unit when a template instance is specified
Fixes a regression caused by 2f6181ad4d6c126e3ebf6880ba30b3b0059c6fc8.

Fixes #30357.

Co-authored-by: Jeff King <peff@peff.net>
(cherry picked from commit 6d9d55657946385916fa4db7149a9b389645ee73)
(cherry picked from commit 8b9f0065d37c255a41f266ca2252035895e0b90a)
(cherry picked from commit b03b8b8b76b295e38508a0c115aa95b368fd4d3c)
2023-12-23 20:42:40 +01:00
Yu Watanabe
91c1d679be analyze: return earlier when there is no path to be prepended
Follow-up for 2f6181ad4d6c126e3ebf6880ba30b3b0059c6fc8.

Addresses the post-merge comment:
https://github.com/systemd/systemd/pull/30172#discussion_r1404209035

(cherry picked from commit 33d11a2b69b45491bca07e4167073b78b500d09f)
(cherry picked from commit 643df2cc80218e6ad4fe2dfe4bce6e9ac005c1c5)
2023-12-23 20:42:40 +01:00
Yu Watanabe
3ba90ede21 analyze: do not prepend the current working directory to SYSTEMD_UNIT_PATH needlessly
If the requested unit is not in the current working directory, it is not
necessary to include the current working directory in SYSTEMD_UNIT_PATH.

Follow-up for 45519d13a4f2a3c3585e672595762ca621abe65e.

Fixes #30166.

(cherry picked from commit 2f6181ad4d6c126e3ebf6880ba30b3b0059c6fc8)
(cherry picked from commit 9f9acefdfba428920334391945c9d1e9cdd766be)
2023-12-23 20:42:40 +01:00
Yu Watanabe
1953b93604 analyze: set SYSTEMD_UNIT_PATH in verify_generate_path()
Then, rename verify_generate_path() -> verify_set_unit_path().

(cherry picked from commit ff7af46edb51c6548876e139c89389a388694051)
(cherry picked from commit 9c4073b9a9d43341fbc1cd7e771212965541e3ac)
2023-12-23 20:42:40 +01:00
Yu Watanabe
5c1abb2b5b analyze: shorten code a bit
No functional change, just refactoring.

(cherry picked from commit c131e8b706d43f9ebd895dee3a8731a8664af90e)
(cherry picked from commit a2b261e8174d0da91e17efa96919f9d5c33ae3c1)
2023-12-23 20:42:40 +01:00
Yu Watanabe
bfb122d7a1 network: drop unused Manager.routes_foreign
(cherry picked from commit cfe69f962be7295a8e4589620677e816872c2a3d)
(cherry picked from commit 509bb7df68e9c8b1dc8fb0d7cdae96f4e704b46e)
(cherry picked from commit e05dbeb02ee104dd420536ca1e54f8591e42585f)
2023-12-23 20:42:40 +01:00
Yu Watanabe
10b20d61b4 network/neighbor: add missing OOM check
(cherry picked from commit be26893c85b7200d41440792928f5ebbf06fa8cb)
(cherry picked from commit 3411c8a42a60816187aa8dce7c4282af001473d6)
(cherry picked from commit 4abd97bc53d25cdb7948ed7065f6a62415fbec1d)
2023-12-23 20:42:40 +01:00
ksaleem
c636f5fb89 bootctl: fix case-sensitive comparisons in reporting bootloader entries
Fixes #30159

(cherry picked from commit 9fb2a618308e8811978c0f740a8c8718a8b8b5f8)
(cherry picked from commit 8655945ae229d0b59bf56aa9fde6a7c4951ad881)
(cherry picked from commit d0eb5aa5366ff18c4026178ae2f9b6e9dc775842)
2023-12-23 20:42:40 +01:00
Yu Watanabe
8e70e220a6 resolve: do not trigger assertion on exit
By making assert_return() critical, we observe the following:
---
 Program received signal SIGABRT, Aborted.
 0x00007f01320b0884 in __pthread_kill_implementation () from /lib64/libc.so.6
 (gdb) bt
 #0  0x00007f01320b0884 in __pthread_kill_implementation ()
    from /lib64/libc.so.6
 #1  0x00007f013205fafe in raise () from /lib64/libc.so.6
 #2  0x00007f013204887f in abort () from /lib64/libc.so.6
 #3  0x00007f01338d02d6 in log_assert_failed (
     text=0x7f01340009e0 "e->state != SD_EVENT_FINISHED",
     file=0x7f0133fff403 "src/libsystemd/sd-event/sd-event.c", line=1399,
     func=0x7f01340045a0 <__func__.148> "sd_event_add_time")
     at ../src/basic/log.c:948
 #4  0x00007f01338d0457 in log_assert_failed_return (
     text=0x7f01340009e0 "e->state != SD_EVENT_FINISHED",
     file=0x7f0133fff403 "src/libsystemd/sd-event/sd-event.c", line=1399,
     func=0x7f01340045a0 <__func__.148> "sd_event_add_time")
     at ../src/basic/log.c:967
 #5  0x00007f0133c7ed83 in sd_event_add_time (e=0x617000022280,
     ret=0x610000007e98, clock=7, usec=24054941030, accuracy=0,
     callback=0x4625b4 <on_announcement_timeout>, userdata=0x610000007e40)
     at ../src/libsystemd/sd-event/sd-event.c:1399
 #6  0x00007f0133c7f725 in sd_event_add_time_relative (e=0x617000022280,
     ret=0x610000007e98, clock=7, usec=1000000, accuracy=0,
     callback=0x4625b4 <on_announcement_timeout>, userdata=0x610000007e40)
     at ../src/libsystemd/sd-event/sd-event.c:1462
 #7  0x0000000000464cac in dns_scope_announce (scope=0x610000007e40, goodbye=true) at ../src/resolve/resolved-dns-scope.c:1530
 #8  0x0000000000504d08 in link_free (l=0x612000023d40) at ../src/resolve/resolved-link.c:83
 #9  0x000000000052dbbd in manager_free (m=0x619000000a80) at ../src/resolve/resolved-manager.c:697
 #10 0x0000000000562328 in manager_freep (p=0x7f012f800040) at ../src/resolve/resolved-manager.h:198
 #11 0x000000000056315a in run (argc=1, argv=0x7fff22b06468) at ../src/resolve/resolved.c:25
 #12 0x0000000000563284 in main (argc=1, argv=0x7fff22b06468) at ../src/resolve/resolved.c:99
---
Prompted by https://github.com/systemd/systemd/pull/30049#issuecomment-1844087965.

(cherry picked from commit a4be4ad8abad36ae2ac5c73fc00f4467fbb06404)
(cherry picked from commit 390e9420e314635a4d9051b8786e15423f58c979)
(cherry picked from commit 3529defd553b0cfabac7957f956ee9dc69d064b3)
2023-12-23 20:42:40 +01:00
Yu Watanabe
a53032076c resolve: fix wrong error cause assignment to log_debug_errno()
Fixes #30392.

(cherry picked from commit fca212b0225e48097f3b6bd1f8c3a38bd9645040)
(cherry picked from commit b2a37030c1191ebd526781629986cd713330b234)
(cherry picked from commit 27dd6913d30ba09e371788fcea327e389ec122b0)
2023-12-23 20:42:40 +01:00
Frantisek Sumsal
82cbbce8e7 test: backup /etc/udev/udev.conf only if it exists
On Fedora systemd recently moved all of its configuration files to
/usr/lib/ [0], so make sure we account for this case as well.

[   42.450325] testsuite-17.sh[800]: + mkdir -p /run/udev/rules.d
[   42.466504] testsuite-17.sh[800]: + cp -f /etc/udev/udev.conf /etc/udev/udev.conf.bckp
[   42.503348] testsuite-17.sh[802]: cp: cannot stat '/etc/udev/udev.conf': No such file or directory

[0] 29eb35530b

(cherry picked from commit e23fc070e287397d2f047028f953986356badf2f)
(cherry picked from commit 49cc12975c761701e2dc0dc84ee1928b38f98c54)
(cherry picked from commit a22613dd2a13d4f66eef4f132a9c654b87e9b61f)
2023-12-23 20:42:40 +01:00
Frantisek Sumsal
0984feb087 test: reset systemd-udevd.service restart counter
Since we restart systemd-udevd here a couple of times, we might hit the
rate limit in later tests:

[   26.028355] testsuite-17.sh[2074]: + udevadm control -e
[   26.028355] testsuite-17.sh[2074]: + udevadm control -l emerg
[   26.126160] systemd[1]: systemd-udevd.service: Start request repeated too quickly.
[   26.126213] systemd[1]: systemd-udevd.service: Failed with result 'start-limit-hit'.
[   26.140310] systemd[1]: Failed to start systemd-udevd.service.
[   26.140897] systemd[1]: systemd-udevd-control.socket: Failed with result 'service-start-limit-hit'.
[   26.141286] systemd[1]: systemd-udevd-kernel.socket: Failed with result 'service-start-limit-hit'.
[   26.142225] testsuite-17.sh[2074]: + udevadm control -l alert
[   26.149206] udevadm[2088]: Failed to send request to set log level: No such file or directory

Follow-up to: 6ef512c0bb

(cherry picked from commit ad23ff13deb4e057d435adb941e58cd552beac02)
(cherry picked from commit 7d029ce868c42f668e692d7a3bf9e22c778840ab)
(cherry picked from commit 8e43acfd06b917a3f056761f2a413d9584b4769e)
2023-12-23 20:42:40 +01:00
Daan De Meyer
b52a15e2b1 repart: Re-open file descriptor to partition target after mkfs
The mkfs binary might unlink the path we give it and replace it with
a new file so let's make sure that our fd points to any new file rather
than the old deleted file.

Specifically this fixes erofs partition generation.

(cherry picked from commit 0122c7d060c03c116bd5931c53580f000b2b920e)
(cherry picked from commit edb53089edfd0bc31b431edcf5e9e47a29115a8f)
(cherry picked from commit d7c54feb89fec1129ab048ae7a10faf8ed7f0f3f)
2023-12-23 20:42:40 +01:00
Mike Yuan
aea469968f tmpfiles.d/systemd-nologin.conf: use f+ instead of F (deprecated)
Fixes #30368

(cherry picked from commit 3b25958e64c77ed4d3fa2584bebab1e9593b960d)
(cherry picked from commit 758e35b90747e1a6f064cac51bfe0610912a4424)
(cherry picked from commit f143028e79e22351fd39e5f761fee3b9f2f4b7bc)
2023-12-23 20:42:40 +01:00
aslepykh
074e3784b8 test: avoid NO_CAST.INTEGER_OVERFLOW in test-oomd-util (#30365)
The  `.mem_total` variable has `uint64_t` type, therefore, when multiplying the number
`20971512` by the number `1024` with the suffix `U`, we will not get the expected result of
`21,474,828,288`, since the number `20971512` without an explicit type indication has
`uint32_t` type.

First, multiplication will occur in accordance with the `uint32_t` type; this operation will
cause a **type overflow**, and only then will this result be assigned to a `uint64_t` type
variable.

It's worth adding the `UL` suffix to the number `20971512` to avoid **overflow**.

Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.
Author A. Slepykh.

(cherry picked from commit a6f1551fe785e241e7c5534aa0c580b31a83a28b)
(cherry picked from commit 9ee5ab00e04078cf48d827ff13ca4d104b63b56f)
(cherry picked from commit 9a70c36a8655f3a95fb4a1665672a34776ecc4e7)
2023-12-23 20:42:40 +01:00
Mike Yuan
3a5f1bb3dd various: don't log synthetic EIO for fwrite
Follow-up for f9568765d4d3d57de1ec01d85f0a0682920f4d10

(cherry picked from commit 513412a69cdd44dc95f83de26bbca2a184121926)
(cherry picked from commit d2c4086c2ddd17881a8ebb067ee2a37884ff84ec)
(cherry picked from commit 199839235d0f0024f1c1010d6ec65f74543bbe8e)
2023-12-23 20:42:40 +01:00