1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00
Commit Graph

61698 Commits

Author SHA1 Message Date
Lennart Poettering
80ce8580f5 dissect-image: let's lock down fstypes a bit
When we dissect images automatically, let's be a bit more conservative
with the file system types we are willing to mount: only mount common
file systems automatically.

Explicit mounts requested by admins should always be OK, but when we do
automatic mounts, let's not permit barely maintained, possibly legacy
file systems.

The list for now covers the four common writable and two common
read-only file systems. Sooner or later we might want to add more to the
list.

Also, it might make sense to eventually make this configurable via the
image dissection policy logic.
2022-12-22 10:30:35 +09:00
Yu Watanabe
e20bae24d1
Merge pull request #25829 from poettering/empty-to-null-const-fix
string-util: don't add `const` to return pointer of empty_to_null() if input didn't have it
2022-12-22 10:29:59 +09:00
Lennart Poettering
c6661401a7 creds: use empty_or_dash() where appropriate 2022-12-21 22:47:47 +01:00
Lennart Poettering
ef2409cbde string-util: rework empty_to_null() to not change "const" qualifier of input
This changes the definition from enpty_to_null() so that we are still
typesafe (i.e. only accept strings) but do not drop (or add) any const
to the returned string that wasn't also on the input.

Inspired by: 3196e2996f
2022-12-21 22:41:16 +01:00
Lennart Poettering
cf451f382a gpt-auto-generator: honour rootfstype= and rootflags= kernel cmdline option
Even if root= is not specified on the kernel cmdline, we should honour
the other rootXYZ= options.

Fixes: #8411
See: #17034
2022-12-21 22:15:02 +01:00
Hans de Goede
ec6267e862 hwdb: Add mic-mute, control-center and screen-rotation mappings for MSI laptops
The MSI Summit E16 Flip A12UCT laptop sends the following unmapped
atkbd scancodes:

0x91: Launch MSI Control Center
0xf1: Toggle mic mute
0xf2: Rotate screen

The 0x91, 0xf1 and 0xf2 codes are already present in the MSI Prestige/Modern
series specific keymappings and the 0xf1 mapping is also already present in
the MSI Bravo 15-B5DX FnKeys entry.

This shows that these are generic to many MSI models, so add mappings for
these to the generic MSI mappings.

Since the MSI Bravo 15-B5DX FnKeys entry only contains the 0xf1 mapping and
that is covered by the generic MSI mappings now, that entry is removed.

Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/822
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216824
2022-12-22 05:40:05 +09:00
Philipp Jungkamp
71a639db68 hwdb: change definition of PROXIMITY_NEAR_LEVEL for sensors
The [kernel documentation][0] for the in_proximity_nearlevel sysfs
attribute on iio proximity devices states:

    If the value read from the sensor is above or equal to the value in
    this file an object should typically be considered near.

Meaning a 'greater than or equal to' comparison.

Make the documentation comment in 60-sensors.hwdb suggest a
greater-or-equal rather than a strict greater-than comparison.

[0]: https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-bus-iio-proximity

Fixes #25793
2022-12-22 05:31:04 +09:00
Antonio Alvarez Feijoo
09ed55c26d systemctl: fix typo 2022-12-21 19:34:25 +09:00
Yu Watanabe
de8409ac43 rules: add missing line continuation
Fixes a bug introduced by 953c928c24.

Fixes #25811.
2022-12-21 09:52:07 +01:00
Steve Ramage
df7f714acc
man: create a new section for nspawn files in systemd.syntax man page (#25807)
Closes #25806.
2022-12-21 13:31:09 +09:00
Jacek Migacz
8b23242989 resolve: fix enumerator name for DNS search domain 2022-12-20 19:02:18 +01:00
Lennart Poettering
5948d654fa
Merge pull request #25789 from yuwata/EBADF
tree-wide: use -EBADF more
2022-12-20 19:01:54 +01:00
Zbigniew Jędrzejewski-Szmek
b764142565 Merge branch 'systemd-security/coredump-capabilities'
CVE-2022-4415: systemd: coredump not respecting fs.suid_dumpable kernel setting
Affects systemd >= 247 with libacl support enabled.

This is a merge of https://github.com/systemd/systemd-security/pull/12/.
I'm doing the merge locally because github doesn't support merging directly
from systemd/systemd-security to systemd/systemd.
2022-12-20 17:56:28 +01:00
Yu Watanabe
5bb1d7fbab tree-wide: use -EBADF more 2022-12-21 01:50:33 +09:00
Mike Yuan
f206809b97 systemctl: new option --drop-in for specifying drop-in filename
Previously 'systemctl edit' would only operate on
'override.conf', but users may need more than that.
Thus the new option '--drop-in' is added to allow
users to specify the drop-in file name.

Closes #25767
2022-12-20 15:59:11 +01:00
Zbigniew Jędrzejewski-Szmek
616b8101b7 github: update version in bug templates 2022-12-20 15:12:41 +01:00
Yu Watanabe
19ee48a6c2 tree-wide: introduce PIPE_EBADF macro 2022-12-20 11:12:58 +09:00
Yu Watanabe
f26c38edfa fuzz: sort headers 2022-12-20 11:12:58 +09:00
Yu Watanabe
57e7af551e
Merge pull request #25786 from keszybz/ebadf
Use -EBADF for fd initialization
2022-12-20 10:02:10 +09:00
Yu Watanabe
8d8d4b092a
Merge pull request #25787 from msekletar/rename-process-cap
units: allow systemd-userdbd to change process name
2022-12-20 09:58:47 +09:00
noodlejetski
53a568f327
hwdb: Fn+F5 fix for MSI Bravo 15-B5DX (#25788)
Closes #25782.
2022-12-20 09:57:54 +09:00
Michal Sekletar
d5e5bc2fe9 units: allow systemd-userdbd to change process name
rename_process() requires CAP_SYS_RESOURCE so let's make sure it is in
our permitted set after execve() by adding in to the bounding set.

Previously,
systemd-userdbd.service - User Database Manager
     Loaded: loaded (/usr/lib/systemd/system/systemd-userdbd.service; indirect; preset: disabled)
     Active: active (running) since Mon 2022-12-19 17:07:21 CET; 17min ago
TriggeredBy: ● systemd-userdbd.socket
       Docs: man:systemd-userdbd.service(8)
   Main PID: 1880 (systemd-userdbd)
     Status: "Processing requests..."
      Tasks: 4 (limit: 2272)
     Memory: 5.2M
        CPU: 244ms
     CGroup: /system.slice/systemd-userdbd.service
             ├─1880 /usr/lib/systemd/systemd-userdbd
             ├─2270 systemd-userwork
             ├─2271 systemd-userwork
             └─2272 systemd-userwork

Now,
    Loaded: loaded (/usr/lib/systemd/system/systemd-userdbd.service; indirect; preset: disabled)
     Active: active (running) since Mon 2022-12-19 17:27:02 CET; 15s ago
TriggeredBy: ● systemd-userdbd.socket
       Docs: man:systemd-userdbd.service(8)
   Main PID: 2404 (systemd-userdbd)
     Status: "Processing requests..."
      Tasks: 4 (limit: 2272)
     Memory: 5.5M
        CPU: 89ms
     CGroup: /system.slice/systemd-userdbd.service
             ├─2404 /usr/lib/systemd/systemd-userdbd
             ├─2407 "systemd-userwork: waiting..."
             ├─2408 "systemd-userwork: waiting..."
             └─2409 "systemd-userwork: waiting..."
2022-12-19 18:33:24 +01:00
Michal Sekletar
03ee26168f argv-util: do proper permission check while when changing process name
Process renaming happens very seldomly so we are able to afford proper
permission check, i.e. actually check for CAP_SYS_RESOURCE capability
instead of euid.
2022-12-19 17:29:40 +01:00
Lennart Poettering
34eebf08fa
Merge pull request #25783 from keszybz/trivial-cleanups
Trivial cleanups
2022-12-19 17:01:51 +01:00
Lennart Poettering
93965d3325
Merge pull request #25771 from bluca/pkcs11_dlopen
p11kit: switch to dlopen()
2022-12-19 17:01:02 +01:00
Zbigniew Jędrzejewski-Szmek
e8d2cb0f34 basic/hashmap: add comment
Coverity complains that the check is suspicious. Add a comment to help
the reader.
2022-12-19 15:16:41 +01:00
Zbigniew Jędrzejewski-Szmek
a0e475ce6a efi: do not use 'r' as pointer name
'r' should only be used as in 'int r'.
2022-12-19 15:16:33 +01:00
Zbigniew Jędrzejewski-Szmek
98775ae0f7 userdb: fix typo 2022-12-19 15:16:24 +01:00
Zbigniew Jędrzejewski-Szmek
ac2300f735 shared/dns-domain: reduce scope of variable declarations 2022-12-19 15:16:09 +01:00
Zbigniew Jędrzejewski-Szmek
351293b3bb basic/fd-util: rearrange variable declarations
Having two blocks of normal variable declarations was unnecessary.
Also 'i' can be narrower in scope.
2022-12-19 15:00:59 +01:00
Zbigniew Jędrzejewski-Szmek
3401477982 tree-wide: use -EBADF also in pipe initializers
In some places, initialization is dropped when unnecesary.
2022-12-19 15:00:59 +01:00
Zbigniew Jędrzejewski-Szmek
a5937dcf39 tree-wide: change initialization to use EBADF instead of EBADFD
Those fds never were, so it's not fair to say that they are in "bad state".
Let's use the shorter and more direct errno.
2022-12-19 15:00:59 +01:00
Zbigniew Jędrzejewski-Szmek
254d1313ae tree-wide: use -EBADF for fd initialization
-1 was used everywhere, but -EBADF or -EBADFD started being used in various
places. Let's make things consistent in the new style.

Note that there are two candidates:
EBADF 9 Bad file descriptor
EBADFD 77 File descriptor in bad state

Since we're initializating the fd, we're just assigning a value that means
"no fd yet", so it's just a bad file descriptor, and the first errno fits
better. If instead we had a valid file descriptor that became invalid because
of some operation or state change, the other errno would fit better.

In some places, initialization is dropped if unnecessary.
2022-12-19 15:00:57 +01:00
Zbigniew Jędrzejewski-Szmek
cbff793ffb sd-event: never pass negative errnos as signalfd to signalfd
We treat any negative value as "invalid fd", but signalfd only
accepts -1.
2022-12-19 14:56:28 +01:00
Zbigniew Jędrzejewski-Szmek
da850694a9 socket-proxyd: do not hardcode -1 in a check for fd validity 2022-12-19 14:56:28 +01:00
Luca Boccassi
e5f48108cb Update TODO 2022-12-19 14:49:01 +01:00
Luca Boccassi
da035a3a24 p11kit: switch to dlopen() 2022-12-19 14:49:01 +01:00
Lennart Poettering
5ac1e0eff3
Merge pull request #25784 from poettering/bootctl-split
bootctl: split up bootctl.c into multiple files
2022-12-19 14:37:52 +01:00
Yu Watanabe
8f1359bf85 unit: use underbar for module name
For consistency with src/core/unit.c.
2022-12-19 12:12:02 +01:00
Lennart Poettering
baafb202f8 bootctl: split out "install" verb too 2022-12-19 12:08:02 +01:00
Lennart Poettering
da36788f65 bootctl: split out "status" verb too 2022-12-19 12:08:02 +01:00
Lennart Poettering
6d8ca25766 bootctl: split out "set-efivar" verbs, too 2022-12-19 12:06:33 +01:00
Lennart Poettering
6e975890a6 bootctl: also split out 'systemd-efi-options' verb 2022-12-19 11:52:09 +01:00
Lennart Poettering
85f875357b bootctl: split out random seed verb, too 2022-12-19 11:43:19 +01:00
Lennart Poettering
34ea7e0232 bootctl: let's start splitting up bootctl like we did for systemctl and others 2022-12-19 11:43:19 +01:00
Yu Watanabe
cc3254c446
Merge pull request #25779 from bluca/journa_remote_vacuum
journal-remote: follow-ups for #25076
2022-12-19 09:44:04 +09:00
Luca Boccassi
4bf277caa5 journal-remote: fix memory leak on initialization error
Follow-up for f12b399dd6 from
https://github.com/systemd/systemd/pull/25076

CID#1501550
2022-12-18 10:58:47 +00:00
Luca Boccassi
a4f82d2cd7 journal-remote: fix initialization of vacuum metrics
Follow-up for f12b399dd6 from
https://github.com/systemd/systemd/pull/25076

CID#1501551
2022-12-18 10:57:59 +00:00
asavah
2736a0c64e meson: fix cross-compilation of LONG_MAX
https://github.com/systemd/systemd/pull/25618#issuecomment-1355019553
2022-12-18 10:24:14 +01:00
berenddeschouwer
f12b399dd6
vacuum journal remote (#25076)
* Support vacuuming for journal-remote

Co-authored-by: Berend De Schouwer <berend@deschouwer.co.za>
2022-12-17 13:54:16 +00:00