1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00
Commit Graph

66930 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
3c098014f5 nspawn,shared: make ERRNO_IS_SECCOMP_FATAL an inline func with _NEG_ variant
Also rebreak comments and lines.

No functional change.
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek
7d01eb35dc shared/kbd-util: simplify error handling in keymap_exists()
Once we know the return value, we can just return it, no need to
exit the loop.
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek
bb44fd0734 various: use _NEG_ macros to reduce indentation
No functional change intended.
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek
1f2db2e315 libsystemd-network: use _NEG_ macros to reduce indentation
No functional change intended.
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek
c5ed77b220 libsystemd: use _NEG_ macros, adjust some comments
No functional change.
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek
882321a139 manager: use _NEG_ macros to reduce indentation, reword comments, drop parens 2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek
fe0feacb9e errno-util: allow ERRNO_IS_* to accept types wider than int
This is useful if the variable is ssize_t and we don't want to trigger a
warning or truncation.

With gcc (gcc-13.2.1-1.fc38.x86_64), the resulting systemd binary is identical,
so I assume that the compiler is able to completely optimize away the type.
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek
d66ad6ff85 sd-id128: introduce ERRNO_IS_NEG_MACHINE_ID_UNSET 2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek
3c8c67ce1d shared/cgroup-show: do not format path twice
Also, invert the "negative" condition to positive so that it matches the assert
right above. Also, print the path in the debug message.
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek
13d84288bc tree-wide: use cocinnelle to apply _NEG_ macros 2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek
b0be985cdd basic/errno-util: add wrappers which only accept negative errno
We do 'IN_SET(r, -CONST1, -CONST2)', instead of 'IN_SET(-r, CONST1, CONST2)'
because -r is undefined if r is the minimum value (i.e. INT_MIN). But we know
that the constants are small, so their negative values are fine.
2023-08-16 12:52:56 +02:00
Zbigniew Jędrzejewski-Szmek
767aad7bfd Mark all base64 files as generated
This makes them ignored by license review.
2023-08-16 12:49:45 +02:00
Zbigniew Jędrzejewski-Szmek
4afa722868 bsod: fix license tag 2023-08-16 12:49:44 +02:00
Zbigniew Jędrzejewski-Szmek
140d6853e9 mailmap: "reduce contributor count by 13"
This merges the counts for a few people who existed with and without accents,
or with different capitalizations, and suffixes. Also, stop overriding
NeilBrown's spelling of the name.

Note: IIUC, we have two Luca Bruno's: lucab@debian.net is not the same as the
other Luca BRUNO who works on coreos.

@@ -386 +385,0 @@
-     2	Damjan Georgievski
@@ -401 +399,0 @@
-     1	Daniel Berrange
@@ -425 +423 @@
-    11	Daniel P. Berrangé
+    12	Daniel P. Berrangé
@@ -888 +885,0 @@
-     1	Jiri Pirko
@@ -891 +888 @@
-     1	Jiří Pírko
+     2	Jiří Pírko
@@ -1105 +1102 @@
-    12	Luca BRUNO
+    18	Luca BRUNO
@@ -1107 +1104 @@
-     8	Luca Bruno
+     2	Luca Bruno
@@ -1160,2 +1157 @@
-     1	Marc-Andre Lureau
-    17	Marc-André Lureau
+    18	Marc-André Lureau
@@ -1313,2 +1309 @@
-    31	Michal Sekletar
-   168	Michal Sekletár
+   199	Michal Sekletár
@@ -1383,3 +1378 @@
-     2	Neal Gompa
-     1	Neal Gompa (ニール・ゴンパ)
-    12	Neil Brown
+     3	Neal Gompa (ニール・ゴンパ)
@@ -1387,0 +1381 @@
+    12	NeilBrown
@@ -1494,2 +1488 @@
-     1	Perry Yuan
-     1	Perry.Yuan
+     3	Perry Yuan
@@ -1941,2 +1934 @@
-     2	Viktar Vauchkevich
-     2	Viktar Vaŭčkievič
+     4	Viktar Vaŭčkievič
@@ -2016,2 +2008 @@
-     1	Yao Wei
-     1	Yao Wei (魏銘廷)
+     2	Yao Wei (魏銘廷)
@@ -2145 +2135,0 @@
-     1	gdamjan
@@ -2256 +2245,0 @@
-     1	perry_yuan
@@ -2331 +2320 @@
-    18	Дамјан Георгиевски
+    21	Дамјан Георгиевски
2023-08-16 12:49:42 +02:00
Lennart Poettering
aea0f9abc5 update TODO 2023-08-16 11:42:13 +02:00
Lennart Poettering
79ae9015ac update TODO 2023-08-16 11:37:56 +02:00
Lennart Poettering
c7c46845ff update TODO 2023-08-16 11:31:31 +02:00
Luca Boccassi
28bd57e350
Merge pull request #28733 from goenkam/maanya/systemd-scoped
core: add confext support for ExtensionImages= and ExtensionDirectories=
2023-08-16 10:12:46 +01:00
Brian Norris
bd2f6a568d tools: update-hwdb-autosuspend.sh: Point at HEAD, not master branch
Many Chromium projects have moved from 'master' to 'main', where
'master' is no longer updated. Point at HEAD instead, which should
always represent the default branch.

I don't actually rerun/regenerate the database, since I don't really run
systemd environments to test that update on.
2023-08-16 02:07:00 +01:00
Maanya Goenka
b856f1dfc5 test: add test for confext service-scoped support 2023-08-15 18:34:57 +00:00
Maanya Goenka
55ea4ef096 allow ExtensionImages= and ExtensionDirectories= settings to support confext images 2023-08-15 18:34:46 +00:00
Maanya Goenka
0da675fddd add an @ option for confext 2023-08-15 17:41:35 +00:00
Luca Boccassi
75bb2425a3
Merge pull request #28839 from DaanDeMeyer/repart-followups
Repart followups
2023-08-15 16:40:05 +01:00
Michael A Cassaniti
c380047bf4 repart: Add verity configuration section and options 2023-08-15 15:32:09 +01:00
Daan De Meyer
f19659b91f
Merge pull request #28838 from DaanDeMeyer/repart-subvolume
mkosi: Create a few subvolumes in the root partition
2023-08-15 14:56:10 +02:00
Daan De Meyer
7bc6c02896 repart: Massage the minimize for XFS a bit
A 1.5 multiplier doesn't seem to be sufficient for XFS as seen in
mkosi CI. Let's increase it to 2 for XFS to hopefully get better
results.
2023-08-15 12:58:28 +02:00
Kiran Vemula
a67e5c6e37
resolved: fixed bugs reported in varlink statistics (#28796)
Fixes https://github.com/systemd/systemd/issues/28791

Follow-up for bc837621a3
2023-08-15 11:45:58 +01:00
Daan De Meyer
c3e83f09ea mkosi: Update to v15.1 release 2023-08-15 12:32:39 +02:00
Daan De Meyer
06ba811a76 mkosi: Create a few subvolumes in the root partition
Let's exercise the repart Subvolumes= setting by creating a few
subvolumes in the root partition when we create it.
2023-08-15 12:32:39 +02:00
Daan De Meyer
ade85cd519 repart: Rework read-only logic
verity sig partitions can't actually be marked read-only, so let's
not do that to avoid an ugly warning about that. Instead, let's just
make sure that we mark verity hash and verity data partitions as
read-only.
2023-08-15 12:32:39 +02:00
Daan De Meyer
ffd9d75cde repart: Allow using Subvolumes= with automatic --offline
If we fail to allocate a loopback device and subvolumes are configured,
we fail instead of falling back to a regular file.
2023-08-15 12:32:36 +02:00
Warren
5007942477
p11kit: check the flags associated with the slot instead of flags associated with the token
The logic around checking PKCS11 tokens (used by systemd-cryptenroll) contains a bug.
The code is checking the flags field of a pkcs11 token_info structure against a set of flags defined for the pkcs11 slot_info structure. This PR changes the check so that the correct structure's flag field is being checked.
(Reference to the PKCS#11 spec:http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/os/pkcs11-base-v2.40-os.html, section CK_SLOT_INFO).
2023-08-15 11:28:14 +01:00
Daan De Meyer
b1110c81d8 mkfs-util: Don't set MKE2FS_DEVICE_PHYS_SECTSIZE
We only care about the logical sector size and if the physical sector
size isn't set and we're operating on a file, mke2fs will default the
physical sector size to the logical block size anyway.

This change makes sure that if we're operating on a block device and
set an explicit logical sector size, that doesn't affect the physical
sector size.
2023-08-15 12:10:14 +02:00
Daan De Meyer
5f13fb0a73 repart: Put function call closer to its error handling 2023-08-15 12:09:31 +02:00
Luca Boccassi
4ccee4b426
Merge pull request #28812 from DaanDeMeyer/sector-size
repart: Use 4096 as the fallback sector size for verity/luks/filesystems
2023-08-15 10:16:24 +01:00
Daan De Meyer
c81e350c03
Merge pull request #28833 from DaanDeMeyer/copy-subvolume
repart: Add Subvolumes= setting
2023-08-15 09:53:02 +02:00
Michael A Cassaniti
eeee486159 sysupdate: Use sector size for partition size calculations 2023-08-15 09:17:12 +02:00
Daan De Meyer
4b17f5c378
Merge pull request #28829 from DaanDeMeyer/mount-fd
tree-wide: Mount file descriptors via /proc/<pid>/fd
2023-08-15 09:04:45 +02:00
Luca Boccassi
e158e17299
Merge pull request #28835 from mrc0mmand/more-tests
test: add coverage for #27953
2023-08-15 01:54:52 +01:00
Daan De Meyer
4419735822 fd-util: Use /proc/pid/fd instead of /proc/self/fd
Currently, we mount via file descriptors using /proc/self/fd. This
works, but it means that in /proc/mounts and various other files,
the source of the mount will be listed as /proc/self/fd/xxx. For other
software that parses these files, /proc/self/fd/xxx doesn't mean anything,
or worse, it means the completely wrong thing, as it will refer to one of
their own file descriptors instead.

Let's improve the situation by using /proc/pid/fd instead. This allows
processes parsing /proc/mounts to do the right thing more often than not.
One scenario where even this doesn't work if when containers are involved,
as with the pid namespace unshared, even /proc/pid/fd will mean the wrong
thing, but it's no worse than /proc/self/fd which will always means the wrong
thing.

This also doesn't work if we mount via file descriptor and then exit, as the pid will
be gone, but it does work as long as the process that did the mount is alive, which
makes it useful for systemd-dissect --with for example if the program we run in the
image wants to parse /proc/mounts.
2023-08-14 22:43:12 +02:00
Frantisek Sumsal
01febfcdce test: explicitly specify a UTF-8 locale for UTF-8 shenanigans
As things don't work well without it:

$ LANG=C printf "\ufffe\n"
\uFFFE
2023-08-14 20:09:31 +02:00
Frantisek Sumsal
3ba954dd57 test: add coverage for #27953 2023-08-14 19:35:37 +02:00
Frantisek Sumsal
39f17be437 test: drop unnecessary log level setup
As we do that globally via a dropin.
2023-08-14 19:31:20 +02:00
Daan De Meyer
440f805c17 repart: Add Subvolumes= setting
This setting indicates which directories in the target partition
should be btrfs subvolumes. If set, we'll try to create these
directories as subvolumes.

Note that this only works when running as root without --offline,
as mkfs.btrfs does not support creating subvolumes.
2023-08-14 18:46:08 +02:00
Daan De Meyer
c55a97f1fd mkdir: Add support for creating subvolumes to mkdir_p_root()
We pass in the paths which should be subvolumes and try to create
those as subvolumes if we can.
2023-08-14 18:46:08 +02:00
Daan De Meyer
ad6fae7ffc copy: Add support for creating subvolumes to copy_tree_at()
The subvolumes set is a set of source inodes similar to how the
denylist hashmap contains source inodes as keys. It indicates
directories in the source tree that should become subvolumes in
the target tree.
2023-08-14 18:46:08 +02:00
Daan De Meyer
bc6a6130ac fs-util: Add XO_SUBVOLUME flag for xopenat()
When specified, xopenat() will try to create a btrfs subvolume and
fall back to creating a regular directory.
2023-08-14 18:46:08 +02:00
Daan De Meyer
e54c79ccc2 btrfs-util: Move subvolume creation to basic/btrfs.h
Also make btrfs_subvol_make() an openat style function.
2023-08-14 18:46:08 +02:00
Daan De Meyer
6819924c30 path-util: Make ret argument optional for path_extract_directory() 2023-08-14 18:46:06 +02:00
Daan De Meyer
672de611dd
Merge pull request #28828 from DaanDeMeyer/sysupdate-fdisk
fdisk-util: Make fdisk_new_context_fd() more generic
2023-08-14 14:23:03 +02:00