1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-22 22:03:43 +03:00

54334 Commits

Author SHA1 Message Date
Lennart Poettering
6b945d7031 homework: split out password cache logic into its own .c/.h file
Preparation for extending it further down the line.
2021-11-13 00:22:16 +01:00
Lennart Poettering
0881991c32
Merge pull request #21329 from poettering/homed-compress-default
homed: default to btrfs compression
2021-11-12 22:55:14 +01:00
Lennart Poettering
423de19223 man: run ninja -C build update-man-rules 2021-11-12 22:21:22 +01:00
Lennart Poettering
1783a48c87 homework: add a const where appropriate 2021-11-12 22:15:51 +01:00
Lennart Poettering
cbae575e0f keyring-util: add new keyring-util.h helpers
This adds to new helpers: keyring_read() for reading a key data from a
keyring entry, and TAKE_KEY_SERIAL which is what TAKE_FD is for fds, but
for key_serial_t.

The former is immediately used by ask-password-api.c
2021-11-12 22:15:06 +01:00
Lennart Poettering
7b9eaec069
Merge pull request #21294 from keszybz/binfmt-misc
Improve systemd-binfmt logging, fix exit value
2021-11-12 22:14:12 +01:00
Lennart Poettering
8ccb69aef0 homework: turn off compression for files backing LUKS volumes
We need random access read/write files, and compression sucks for that,
hence disable it on the underlying files.

Compression in the home directory might be desirable, but if so it
should be done *inside* the home dir fs, not on the underlying fs.
2021-11-12 22:13:48 +01:00
Luca Boccassi
c3c50474d2 tree-wide: don't ignore return code from sd_event_source_set_enabled()
CID#1465793
CID#1465794
CID#1465795
2021-11-12 22:13:24 +01:00
Lennart Poettering
fe0777fb94
Merge pull request #21320 from poettering/namespace-mkdir-umask
make pid1 namespace code independent of umask
2021-11-12 22:12:58 +01:00
Frantisek Sumsal
59f5d2f431
Merge pull request #21316 from evverx/pin-labeler
ci: pin labeler
2021-11-12 20:51:26 +00:00
Lennart Poettering
db42f011c6 docs: document new mount option env var 2021-11-12 17:36:53 +01:00
Lennart Poettering
6309512c02 homed: add env var for overriding default mount options
This adds an esay way to override the default mount options to use for
LUKS home dirs via the env vars SYSTEMD_HOME_MOUNT_OPTIONS_EXT4,
SYSTEMD_HOME_MOUNT_OPTIONS_BTRFS, SYSTEMD_HOME_MOUNT_OPTIONS_XFS.

See: #15120
2021-11-12 17:34:31 +01:00
Lennart Poettering
a428a4518b homework: default to btrfs compression
This follows what Fedora did with 34: enables compression by default,
lowering IO bandwidth and reducing disk space use, at the price of
slightly higher CPU use.

https://fedoraproject.org/wiki/Changes/BtrfsTransparentCompression
2021-11-12 17:33:16 +01:00
Zbigniew Jędrzejewski-Szmek
99a041d1ce binfmt: add logging information
In delete_rule(), we already checked that the rule name is a valid file name
(i.e. no slashes), so we can just trivially append.

Also, let's always reject rules that we would later fail to delete. It's
probably better to avoid such confusion.

And print the operations we do with file name and line number. I hope this
helps with cases like https://github.com/systemd/systemd/pull/21178. At least
we'll know what rule failed.

$ sudo SYSTEMD_LOG_LEVEL=debug build/systemd-binfmt
Flushed all binfmt_misc rules.
Applying /etc/binfmt.d/kshcomp.conf…
/etc/binfmt.d/kshcomp.conf:1: binary format 'kshcomp' registered.
2021-11-12 17:23:36 +01:00
Topi Miettinen
006d1864fb execute: always log a warning when setting SELinux context fails
Update also manual page to explain how the transition can still fail.
2021-11-12 17:17:21 +01:00
Zbigniew Jędrzejewski-Szmek
b01ee585c9 Merge pull request #21321 from yuwata/ether-addr-fix-local
ether-addr-util: fix ether_addr_is_local()
2021-11-12 17:12:46 +01:00
Evgeny Vereshchagin
33796123bc ci: run codeql-analysis daily
https://github.com/github/codeql-action

Apparently to judge from a couple of warnings I haven't seen
before it's a bit different from LGTM.
2021-11-12 15:47:15 +00:00
Emily Gonyer
be7148ebed
Change gendered terms to be gender-neutral (#21325)
Some typos are also fixed.
2021-11-12 16:09:56 +01:00
Lennart Poettering
875afa02fa tests: add test case for UMask=+BindPaths= combination
Inspired by the test case described in #19899
2021-11-12 16:02:26 +01:00
Lennart Poettering
3044343927 namespace: make tmp dir handling code independent of umask too
Let's make all code in namespace.c robust towards weird umask. This
doesn't matter too much given that the parent dirs we deal here almost
certainly exist anyway, but let's clean this up anyway and make it fully
clean.
2021-11-12 16:02:22 +01:00
Lennart Poettering
cdf42f9bd4 namespace: make whole namespace_setup() work regardless of configured umask
Let's reset the umask during the whole namespace_setup() logic, so that
all our mkdir() + mknod() are not subjected to whatever umask might
currently be set.

This mostly moves the umask save/restore logic out of
mount_private_dev() and into the stack frame of namespace_setup() that
is further out.

Fixes #19899
2021-11-12 16:02:17 +01:00
Lennart Poettering
d73020f242 namespace: rebreak a few comments 2021-11-12 16:02:12 +01:00
Lennart Poettering
52f05ef21d umask-util: add helper that resets umask until end of current code block 2021-11-12 16:01:40 +01:00
Lennart Poettering
b0c4b28246 pid1: add a manager_trigger_run_queue() helper
We have two different places where we re-trigger the run queue now.
let's unify it under a common function, that is part of the Manager
code.

Follow-up for #20953
2021-11-12 15:52:37 +01:00
Yu Watanabe
a55277b889 test: add tests for MAC address helper functions 2021-11-12 20:00:50 +09:00
Yu Watanabe
847f1ea69e ether-addr-util: fix ether_addr_is_local() and add one more helper
Follow-up for 1f86a3fe52c71af7f46381bf45c2efe580a19dcc.
2021-11-12 20:00:29 +09:00
Lennart Poettering
6ebbcafeb4
Merge pull request #20953 from msekletar/mount-ratelimit-followup-20329
Delay running mount start jobs when we /p/s/mountinfo event source is rate limited
2021-11-12 09:23:47 +01:00
Jonas Witschel
6401279fee test: add regression test for systemd-run --scope [--user]
systemd-run --scope --user failed to run in system 249.6, cf. #21297. Add tests
for systemd-run --scope and systemd-run --scope --user to make sure this does
not regress again.
2021-11-12 13:31:46 +09:00
Lennart Poettering
e7cef2a6ea macro-fundamental: fix bool → sd_bool 2021-11-11 23:50:52 +00:00
Luca Boccassi
977e68c71b
Merge pull request #21285 from poettering/boot-os-rel-fix
sd-boot/bootspec: os-release parsing fixes
2021-11-11 20:23:17 +00:00
Luca Boccassi
1977d1477f
Merge pull request #21241 from wat-ze-hex/2021-11-04-fix-bpf-foreign-realization
core, bpf: fix bpf-foreign cgroup controller realization
2021-11-11 18:49:50 +00:00
Lennart Poettering
af11e0ef84 update TODO 2021-11-11 18:38:26 +01:00
Lennart Poettering
f22abf384d types-fundamental: introduce sd_true + sd_false
I think we should stick to the rule that stuff defined in
types-fundamental.h either:

1. adds a prefixed concept "sd_xyz" that maps differently in the two
   environments

2. adds a non-prefixed concept "xyz" that adds a type otherwise missing
   in one of the two environments but with the same definition as in the
   other.

i.e. if have have some concept that might differ the way its set up in
the two environments it really should be prefixed by "sd_" to make clear
it has semantics we defined. Only drop the prefix if it really means the
exact same thin in all environments.

Now, sd_bool is defined prefixed, because its either mapped to "BOOLEAN"
(which is an integer) in UEFI or "bool" (which is C99 _Bool) in
userspace. size_t is not defined prefixed, because it's mapped to the
same thing ultimately (on the UEFI its mapped to UINTN, but that in turn
is defined as being the type for the size of memory objects, thus it's
really the same as userspace size_t).

So far "true" and "false" where defined unprefixed even though they map
to values of different types. typeof(true) in userspace would reveal
_Bool, but typeof(false) in UEFI would reveal BOOLEAN. The distinction
actually does matter in comparisons (i.e. (_Bool) 1 == (_Bool) 2 holds
while (BOOLEAN) 1 == (BOOLEAN) 2 does not hold).

Hence, let's add sd_true and sd_false, thus indicating we defined our
own concept here, and it has similar but different semantics in UEFI and
in userspace.
2021-11-11 17:23:34 +01:00
Lennart Poettering
e514b5071c fundamental: rename type.h → types-fundamental.h
"type.h" is a very generic name, but this header is very specific to
making the "fundaemtnal" stuff work, it maps genric types in two
distinct ways. Hence let's make clear in the header name already what
this is about.
2021-11-11 17:23:09 +01:00
Lennart Poettering
81d9db6805 boot: line-break magic[] array to match osrel[] line breaks 2021-11-11 17:23:04 +01:00
Lennart Poettering
c2caeb5d54 bootspec: catch up with sd-boot's bootspec implementation
Let's parse the same fields and use them the same way as in sd-boot.

Fixes: #20093
2021-11-11 17:22:59 +01:00
Lennart Poettering
df33178416 boot: when we can't boot use the right boot loader entry display title in log message 2021-11-11 17:22:55 +01:00
Lennart Poettering
18fde343a8 boot: clean up unified boot loader entry name/version extraction
Let's make sure IMAGE_ID/IMAGE_VERSION are properly honoured, and
explain in a long comment why.

Let's also use ID= field again, which was lost by accident.

(While we are at it do some minimal OOM checks wherever we touch
something)
2021-11-11 17:22:31 +01:00
Lennart Poettering
31f7765762 bootspec: fix comment that says exactly the opposite of what is true 2021-11-11 17:22:27 +01:00
Lennart Poettering
1ce915a91c boot: const arguments should be const
Unfortunately they forgot the "const" decoration on the MetaiMatch()
prototype, but let that omission not leak into our code, let's hide it
away in the innermost use.
2021-11-11 17:22:23 +01:00
Lennart Poettering
b78a282181 boot: ternary op is your friend 2021-11-11 17:22:18 +01:00
Lennart Poettering
08cd8c4307 boot: add comments what closely related ConfigEntry fields are about 2021-11-11 17:21:37 +01:00
Michal Sekletar
edc027b4f1 mount: retrigger run queue after ratelimit expired to run delayed mount start jobs
Fixes #20329
2021-11-11 17:04:39 +01:00
Michal Sekletar
a7c93dfe91 mount: make mount units start jobs not runnable if /p/s/mountinfo ratelimit is in effect 2021-11-11 17:04:39 +01:00
Michal Sekletar
705578c3b9 core: rename/generalize UNIT(u)->test_start_limit() hook
Up until now the main reason why we didn't proceed with starting the
unit was exceed start limit burst. However, for unit types like mounts
the other reason could be effective ratelimit on /proc/self/mountinfo
event source. That means our mount unit state may not reflect current
kernel state. Hence, we need to attempt to re-run the start job again
after ratelimit on event source expires.

As we will be introducing another reason than start limit let's rename
the virtual function that implements the check.
2021-11-11 17:04:36 +01:00
Michal Sekletar
fd69f22475 sd-event: introduce callback invoked when event source ratelimit expires 2021-11-11 17:02:56 +01:00
Jonas Witschel
c65417a011 scope: count successful cgroup additions when delegating via D-Bus
Since commit 8d3e4ac7cd37200d1431411a4b98925a24b7d9b3 ("scope: refuse
activation of scopes if no PIDs to add are left") all "systemd-run --scope
--user" calls fail because cgroup attachments delegated to the system instance
are not counted towards successful additions. Fix this by incrementing the
return value in case unit_attach_pid_to_cgroup_via_bus() succeeds, similar to
what happens when cg_attach() succeeds directly.

Note that this can *not* distinguish the case when
unit_attach_pid_to_cgroup_via_bus() has been run successfully, but all
processes to attach are gone in the meantime, unlike the checks that commit
8d3e4ac7cd37200d1431411a4b98925a24b7d9b3 adds for the system instance. This is
because even though unit_attach_pid_to_cgroup_via_bus() leads to an internal
unit_attach_pids_to_cgroup() call, the return value over D-Bus does not include
the number of successfully attached processes and is always NULL on success.

Fixes: #21297
2021-11-11 15:19:51 +00:00
ml
84b10e536c man: remove unintentionally repetitive words 2021-11-11 14:36:50 +01:00
Lennart Poettering
371264b6c6
Merge pull request #21302 from yuwata/udev-drop-colon-from-ID_NET_NAME_MAC
udev: drop colon from ID_NET_NAME_MAC
2021-11-11 14:36:28 +01:00
Lennart Poettering
126c02a8fd
Merge pull request #21304 from poettering/chain-ssh-auth-keys
userdbctl: add support for chaining other ssh-authorized-keys commands from userdbctl
2021-11-11 14:35:48 +01:00