]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agotest-strxcpyx: check result of snprintf 21355/head
Luca Boccassi [Sun, 14 Nov 2021 01:28:42 +0000 (01:28 +0000)] 
test-strxcpyx: check result of snprintf

3 years agosd-event: one more assert when turning off an event source
Luca Boccassi [Sat, 13 Nov 2021 19:11:28 +0000 (19:11 +0000)] 
sd-event: one more assert when turning off an event source

CID#1465866

3 years agojournal-remote: more handling of sd_event_source_set_enabled failures
Luca Boccassi [Sat, 13 Nov 2021 19:07:59 +0000 (19:07 +0000)] 
journal-remote: more handling of sd_event_source_set_enabled failures

But avoid clobbering the return value if it works

CID#1465793
CID#1465794

3 years agoMerge pull request #21341 from yuwata/network-route-flags
Luca Boccassi [Sat, 13 Nov 2021 18:43:50 +0000 (18:43 +0000)] 
Merge pull request #21341 from yuwata/network-route-flags

network: manage route and nexthop flags

3 years agobuild(deps): bump actions/checkout from 2 to 2.4.0
dependabot[bot] [Sat, 13 Nov 2021 09:36:24 +0000 (09:36 +0000)] 
build(deps): bump actions/checkout from 2 to 2.4.0

Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 2.4.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...ec3a7ce113134d7a93b817d10a8272cb61118579)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agoMerge pull request #21342 from evverx/dependabot-error
Frantisek Sumsal [Sat, 13 Nov 2021 09:35:51 +0000 (09:35 +0000)] 
Merge pull request #21342 from evverx/dependabot-error

ci: try to fix a Dependabot error

3 years agoMerge pull request #21337 from poettering/uid-alloc-range-split
Lennart Poettering [Sat, 13 Nov 2021 07:13:44 +0000 (08:13 +0100)] 
Merge pull request #21337 from poettering/uid-alloc-range-split

split out UID allocation range stuff from user-record.c/h (i.e. login.defs parsing)

3 years agotest: rename test-user-record → test-uid-alloc-range 21337/head
Lennart Poettering [Fri, 12 Nov 2021 18:36:40 +0000 (19:36 +0100)] 
test: rename test-user-record → test-uid-alloc-range

It doesn't actually test any of the JSON stuff, hence name it
test-uid-alloc-range, since it tests the stuff from uid-alloc-range.

3 years agouid-alloc-range: maintain only a single default alloc range structure
Lennart Poettering [Fri, 12 Nov 2021 17:57:14 +0000 (18:57 +0100)] 
uid-alloc-range: maintain only a single default alloc range structure

Either way we need these four values, let's simplify the code by keeping
only one const struct of this around.

3 years agoshared: split out UID allocation range stuff from user-record.h
Lennart Poettering [Fri, 12 Nov 2021 17:50:44 +0000 (18:50 +0100)] 
shared: split out UID allocation range stuff from user-record.h

user-record.[ch] are about the UserRecord JSON stuff, and the UID
allocation range stuff (i.e. login.defs handling) is a very different
thing, and complex enough on its own, let's give it its own c/h files.

No code changes, just some splitting out of code.

3 years agohomework: sync dir after moving file in, not before
Lennart Poettering [Thu, 4 Nov 2021 22:29:12 +0000 (23:29 +0100)] 
homework: sync dir after moving file in, not before

3 years agoMerge pull request #21333 from poettering/homed-report-fs-and-access-mode
Lennart Poettering [Sat, 13 Nov 2021 07:04:33 +0000 (08:04 +0100)] 
Merge pull request #21333 from poettering/homed-report-fs-and-access-mode

homed: report actual home dir access mode and fs type in effect

3 years agoMerge pull request #21331 from poettering/luks-extra-mount-options
Lennart Poettering [Sat, 13 Nov 2021 07:03:55 +0000 (08:03 +0100)] 
Merge pull request #21331 from poettering/luks-extra-mount-options

homed: allow per-user additional LUKS mount options

3 years agotest: Create convenience macros to declare tests
Jan Janssen [Fri, 12 Nov 2021 09:54:44 +0000 (10:54 +0100)] 
test: Create convenience macros to declare tests

3 years agoci: run the unit_tests and mkosi jobs on stable branches as well
Frantisek Sumsal [Fri, 12 Nov 2021 16:37:15 +0000 (17:37 +0100)] 
ci: run the unit_tests and mkosi jobs on stable branches as well

To provide more coverage for the systemd-stable repo.

See: https://github.com/systemd/systemd-stable/issues/24

3 years agohomework: split out password cache logic into its own .c/.h file
Lennart Poettering [Tue, 2 Nov 2021 22:03:17 +0000 (23:03 +0100)] 
homework: split out password cache logic into its own .c/.h file

Preparation for extending it further down the line.

3 years agonetwork: manage route and nexthop flags 21341/head
Yu Watanabe [Fri, 12 Nov 2021 06:26:06 +0000 (15:26 +0900)] 
network: manage route and nexthop flags

3 years agonetwork: mention that errors will be ignored
Yu Watanabe [Fri, 12 Nov 2021 05:35:32 +0000 (14:35 +0900)] 
network: mention that errors will be ignored

3 years agosd-netlink: introduce sd_rtnl_message_nexthop_get_flags()
Yu Watanabe [Fri, 12 Nov 2021 06:18:01 +0000 (15:18 +0900)] 
sd-netlink: introduce sd_rtnl_message_nexthop_get_flags()

3 years agosd-netlink: clear previous flags or state by _set_flags() or _set_state()
Yu Watanabe [Fri, 12 Nov 2021 06:16:31 +0000 (15:16 +0900)] 
sd-netlink: clear previous flags or state by _set_flags() or _set_state()

Otherwise, there is no way to reset the previous value.

3 years agoMerge pull request #21329 from poettering/homed-compress-default
Lennart Poettering [Fri, 12 Nov 2021 21:55:14 +0000 (22:55 +0100)] 
Merge pull request #21329 from poettering/homed-compress-default

homed: default to btrfs compression

3 years agoupdate TODO 21333/head
Lennart Poettering [Fri, 12 Nov 2021 17:03:45 +0000 (18:03 +0100)] 
update TODO

3 years agodoc: document the two new accessMode/fileSystemType fields
Lennart Poettering [Fri, 12 Nov 2021 17:04:03 +0000 (18:04 +0100)] 
doc: document the two new accessMode/fileSystemType fields

3 years agohomed: include actual fs type + access mode as part of "status" section of user record
Lennart Poettering [Fri, 5 Nov 2021 15:34:12 +0000 (16:34 +0100)] 
homed: include actual fs type + access mode as part of "status" section of user record

So far we have two properties for the intended fstype + access mode of
home dirs, but they might differ from what is actually used (because the
user record changed from the home dir, after it was created, or vice
versa). Let's hence add these props also to the "status" section of user
record, which report the status quo. That way we can always show the
correct, current settings.

3 years agohomed: allow querying disk free status separetely from generating JSON from it
Lennart Poettering [Sat, 30 Oct 2021 16:05:52 +0000 (18:05 +0200)] 
homed: allow querying disk free status separetely from generating JSON from it

We later want to query per-home free status for implementing automatic
grow/shrink of home directories, hence let's separate the JSON
generation from the disk free status determination.

3 years agodoc: document the new luksExtraMountOptions concept 21331/head
Lennart Poettering [Fri, 12 Nov 2021 16:48:50 +0000 (17:48 +0100)] 
doc: document the new luksExtraMountOptions concept

3 years agohomectl: make new LUKS extra mount option field settable
Lennart Poettering [Fri, 5 Nov 2021 14:41:59 +0000 (15:41 +0100)] 
homectl: make new LUKS extra mount option field settable

3 years agohomework: also add a way to configure additional mount options via a JSON user record...
Lennart Poettering [Fri, 5 Nov 2021 14:27:56 +0000 (15:27 +0100)] 
homework: also add a way to configure additional mount options via a JSON user record field

Fixes: #15120
3 years agoman: run ninja -C build update-man-rules
Lennart Poettering [Fri, 12 Nov 2021 21:21:22 +0000 (22:21 +0100)] 
man: run ninja -C build update-man-rules

3 years agohomework: add a const where appropriate
Lennart Poettering [Thu, 4 Nov 2021 21:13:55 +0000 (22:13 +0100)] 
homework: add a const where appropriate

3 years agokeyring-util: add new keyring-util.h helpers
Lennart Poettering [Tue, 2 Nov 2021 17:20:12 +0000 (18:20 +0100)] 
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

3 years agoMerge pull request #21294 from keszybz/binfmt-misc
Lennart Poettering [Fri, 12 Nov 2021 21:14:12 +0000 (22:14 +0100)] 
Merge pull request #21294 from keszybz/binfmt-misc

Improve systemd-binfmt logging, fix exit value

3 years agohomework: turn off compression for files backing LUKS volumes
Lennart Poettering [Thu, 4 Nov 2021 20:58:22 +0000 (21:58 +0100)] 
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.

3 years agotree-wide: don't ignore return code from sd_event_source_set_enabled()
Luca Boccassi [Wed, 10 Nov 2021 23:18:06 +0000 (23:18 +0000)] 
tree-wide: don't ignore return code from sd_event_source_set_enabled()

CID#1465793
CID#1465794
CID#1465795

3 years agoMerge pull request #21320 from poettering/namespace-mkdir-umask
Lennart Poettering [Fri, 12 Nov 2021 21:12:58 +0000 (22:12 +0100)] 
Merge pull request #21320 from poettering/namespace-mkdir-umask

make pid1 namespace code independent of umask

3 years agoMerge pull request #21316 from evverx/pin-labeler
Frantisek Sumsal [Fri, 12 Nov 2021 20:51:26 +0000 (20:51 +0000)] 
Merge pull request #21316 from evverx/pin-labeler

ci: pin labeler

3 years agodocs: document new mount option env var 21329/head
Lennart Poettering [Fri, 12 Nov 2021 16:36:53 +0000 (17:36 +0100)] 
docs: document new mount option env var

3 years agohomed: add env var for overriding default mount options
Lennart Poettering [Fri, 5 Nov 2021 14:26:29 +0000 (15:26 +0100)] 
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

3 years agohomework: default to btrfs compression
Lennart Poettering [Fri, 5 Nov 2021 14:24:58 +0000 (15:24 +0100)] 
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

3 years agobinfmt: add logging information 21294/head
Zbigniew Jędrzejewski-Szmek [Wed, 10 Nov 2021 14:44:06 +0000 (15:44 +0100)] 
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.

3 years agoexecute: always log a warning when setting SELinux context fails
Topi Miettinen [Thu, 11 Nov 2021 22:33:01 +0000 (00:33 +0200)] 
execute: always log a warning when setting SELinux context fails

Update also manual page to explain how the transition can still fail.

3 years agoMerge pull request #21321 from yuwata/ether-addr-fix-local
Zbigniew Jędrzejewski-Szmek [Fri, 12 Nov 2021 16:12:46 +0000 (17:12 +0100)] 
Merge pull request #21321 from yuwata/ether-addr-fix-local

ether-addr-util: fix ether_addr_is_local()

3 years agoci: run codeql-analysis daily
Evgeny Vereshchagin [Wed, 10 Nov 2021 23:02:05 +0000 (23:02 +0000)] 
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.

3 years agoChange gendered terms to be gender-neutral (#21325)
Emily Gonyer [Fri, 12 Nov 2021 15:09:56 +0000 (10:09 -0500)] 
Change gendered terms to be gender-neutral (#21325)

Some typos are also fixed.

3 years agotests: add test case for UMask=+BindPaths= combination 21320/head
Lennart Poettering [Fri, 12 Nov 2021 12:41:59 +0000 (13:41 +0100)] 
tests: add test case for UMask=+BindPaths= combination

Inspired by the test case described in #19899

3 years agonamespace: make tmp dir handling code independent of umask too
Lennart Poettering [Fri, 12 Nov 2021 10:16:02 +0000 (11:16 +0100)] 
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.

3 years agonamespace: make whole namespace_setup() work regardless of configured umask
Lennart Poettering [Fri, 12 Nov 2021 10:11:27 +0000 (11:11 +0100)] 
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

3 years agonamespace: rebreak a few comments
Lennart Poettering [Fri, 12 Nov 2021 10:09:40 +0000 (11:09 +0100)] 
namespace: rebreak a few comments

3 years agoumask-util: add helper that resets umask until end of current code block
Lennart Poettering [Fri, 12 Nov 2021 10:06:46 +0000 (11:06 +0100)] 
umask-util: add helper that resets umask until end of current code block

3 years agopid1: add a manager_trigger_run_queue() helper
Lennart Poettering [Fri, 12 Nov 2021 08:43:07 +0000 (09:43 +0100)] 
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

3 years agotest: add tests for MAC address helper functions 21321/head
Yu Watanabe [Fri, 12 Nov 2021 10:56:14 +0000 (19:56 +0900)] 
test: add tests for MAC address helper functions

3 years agoether-addr-util: fix ether_addr_is_local() and add one more helper
Yu Watanabe [Fri, 12 Nov 2021 10:55:43 +0000 (19:55 +0900)] 
ether-addr-util: fix ether_addr_is_local() and add one more helper

Follow-up for 1f86a3fe52c71af7f46381bf45c2efe580a19dcc.

3 years agoMerge pull request #20953 from msekletar/mount-ratelimit-followup-20329
Lennart Poettering [Fri, 12 Nov 2021 08:23:47 +0000 (09:23 +0100)] 
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

3 years agotest: add regression test for systemd-run --scope [--user]
Jonas Witschel [Thu, 11 Nov 2021 21:25:40 +0000 (22:25 +0100)] 
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.

3 years agomacro-fundamental: fix bool → sd_bool
Lennart Poettering [Thu, 11 Nov 2021 21:02:56 +0000 (22:02 +0100)] 
macro-fundamental: fix bool → sd_bool

3 years agoMerge pull request #21285 from poettering/boot-os-rel-fix
Luca Boccassi [Thu, 11 Nov 2021 20:23:17 +0000 (20:23 +0000)] 
Merge pull request #21285 from poettering/boot-os-rel-fix

sd-boot/bootspec: os-release parsing fixes

3 years agoMerge pull request #21241 from wat-ze-hex/2021-11-04-fix-bpf-foreign-realization
Luca Boccassi [Thu, 11 Nov 2021 18:49:50 +0000 (18:49 +0000)] 
Merge pull request #21241 from wat-ze-hex/2021-11-04-fix-bpf-foreign-realization

core, bpf: fix bpf-foreign cgroup controller realization

3 years agoupdate TODO
Lennart Poettering [Wed, 10 Nov 2021 14:59:58 +0000 (15:59 +0100)] 
update TODO

3 years agoci: allow Dependabot to open up to 2 PRs 21342/head
Evgeny Vereshchagin [Thu, 11 Nov 2021 16:54:40 +0000 (16:54 +0000)] 
ci: allow Dependabot to open up to 2 PRs

Apparently version updates aren't always disabled on old forks,
which leads to new PRs opened there. To somewhat mitigate the
issue let's limit the number of PRs Dependabot can create.

It was reported in https://github.com/yuwata/systemd/pull/2#issuecomment-967737195

3 years agotypes-fundamental: introduce sd_true + sd_false 21285/head
Lennart Poettering [Thu, 11 Nov 2021 14:31:17 +0000 (15:31 +0100)] 
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.

3 years agofundamental: rename type.h → types-fundamental.h
Lennart Poettering [Thu, 11 Nov 2021 14:29:53 +0000 (15:29 +0100)] 
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.

3 years agoboot: line-break magic[] array to match osrel[] line breaks
Lennart Poettering [Thu, 11 Nov 2021 14:20:51 +0000 (15:20 +0100)] 
boot: line-break magic[] array to match osrel[] line breaks

3 years agobootspec: catch up with sd-boot's bootspec implementation
Lennart Poettering [Tue, 9 Nov 2021 22:58:08 +0000 (23:58 +0100)] 
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
3 years agoboot: when we can't boot use the right boot loader entry display title in log message
Lennart Poettering [Tue, 9 Nov 2021 22:57:49 +0000 (23:57 +0100)] 
boot: when we can't boot use the right boot loader entry display title in log message

3 years agoboot: clean up unified boot loader entry name/version extraction
Lennart Poettering [Tue, 9 Nov 2021 22:54:10 +0000 (23:54 +0100)] 
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)

3 years agobootspec: fix comment that says exactly the opposite of what is true
Lennart Poettering [Tue, 9 Nov 2021 22:51:35 +0000 (23:51 +0100)] 
bootspec: fix comment that says exactly the opposite of what is true

3 years agoboot: const arguments should be const
Lennart Poettering [Tue, 9 Nov 2021 22:49:01 +0000 (23:49 +0100)] 
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.

3 years agoboot: ternary op is your friend
Lennart Poettering [Tue, 9 Nov 2021 22:48:37 +0000 (23:48 +0100)] 
boot: ternary op is your friend

3 years agoboot: add comments what closely related ConfigEntry fields are about
Lennart Poettering [Tue, 9 Nov 2021 22:47:45 +0000 (23:47 +0100)] 
boot: add comments what closely related ConfigEntry fields are about

3 years agotry to fix a Dependabot error
Evgeny Vereshchagin [Thu, 11 Nov 2021 16:04:09 +0000 (16:04 +0000)] 
try to fix a Dependabot error

```
updater | ERROR <job_232492775> Error processing actions/checkout (RuntimeError)
updater | ERROR <job_232492775> No files changed!
updater | ERROR <job_232492775> /home/dependabot/dependabot-updater/vendor/ruby/2.7.0/gems/dependabot-github_actions-0.166.0/lib/dependabot/github_actions/file_updater.rb:28:in `updated_dependency_files'
updater | ERROR <job_232492775> /home/dependabot/dependabot-updater/lib/dependabot/updater.rb:676:in `generate_dependency_files_for'
updater | ERROR <job_232492775> /home/dependabot/dependabot-updater/lib/dependabot/updater.rb:274:in `check_and_create_pull_request'
updater | ERROR <job_232492775> /home/dependabot/dependabot-updater/lib/dependabot/updater.rb:82:in `check_and_create_pr_with_error_handling'
updater | ERROR <job_232492775> /home/dependabot/dependabot-updater/lib/dependabot/updater.rb:56:in `block in run'
updater | ERROR <job_232492775> /home/dependabot/dependabot-updater/lib/dependabot/updater.rb:56:in `each'
updater | ERROR <job_232492775> /home/dependabot/dependabot-updater/lib/dependabot/updater.rb:56:in `run'
updater | ERROR <job_232492775> /home/dependabot/dependabot-updater/lib/dependabot/update_files_job.rb:17:in `perform_job'
updater | ERROR <job_232492775> /home/dependabot/dependabot-updater/lib/dependabot/base_job.rb:28:in `run'
updater | ERROR <job_232492775> bin/update_files.rb:21:in `<main>`
```

3 years agomount: retrigger run queue after ratelimit expired to run delayed mount start jobs 20953/head
Michal Sekletar [Mon, 4 Oct 2021 18:31:49 +0000 (20:31 +0200)] 
mount: retrigger run queue after ratelimit expired to run delayed mount start jobs

Fixes #20329

3 years agomount: make mount units start jobs not runnable if /p/s/mountinfo ratelimit is in...
Michal Sekletar [Mon, 4 Oct 2021 17:41:34 +0000 (19:41 +0200)] 
mount: make mount units start jobs not runnable if /p/s/mountinfo ratelimit is in effect

3 years agocore: rename/generalize UNIT(u)->test_start_limit() hook
Michal Sekletar [Mon, 4 Oct 2021 15:51:52 +0000 (17:51 +0200)] 
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.

3 years agosd-event: introduce callback invoked when event source ratelimit expires
Michal Sekletar [Mon, 4 Oct 2021 17:44:06 +0000 (19:44 +0200)] 
sd-event: introduce callback invoked when event source ratelimit expires

3 years agoscope: count successful cgroup additions when delegating via D-Bus
Jonas Witschel [Wed, 10 Nov 2021 21:46:35 +0000 (22:46 +0100)] 
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
3 years agoman: remove unintentionally repetitive words
ml [Thu, 11 Nov 2021 09:01:19 +0000 (10:01 +0100)] 
man: remove unintentionally repetitive words

3 years agoMerge pull request #21302 from yuwata/udev-drop-colon-from-ID_NET_NAME_MAC
Lennart Poettering [Thu, 11 Nov 2021 13:36:28 +0000 (14:36 +0100)] 
Merge pull request #21302 from yuwata/udev-drop-colon-from-ID_NET_NAME_MAC

udev: drop colon from ID_NET_NAME_MAC

3 years agoMerge pull request #21304 from poettering/chain-ssh-auth-keys
Lennart Poettering [Thu, 11 Nov 2021 13:35:48 +0000 (14:35 +0100)] 
Merge pull request #21304 from poettering/chain-ssh-auth-keys

userdbctl: add support for chaining other ssh-authorized-keys commands from userdbctl

3 years agoMerge pull request #21301 from yuwata/network-neighbor-use-hw-addr-data
Luca Boccassi [Thu, 11 Nov 2021 10:32:11 +0000 (10:32 +0000)] 
Merge pull request #21301 from yuwata/network-neighbor-use-hw-addr-data

network: neighbor: use "struct hw_addr_data"

3 years agoci: pin some workflows to SHAs 21316/head
Evgeny Vereshchagin [Thu, 11 Nov 2021 05:04:56 +0000 (05:04 +0000)] 
ci: pin some workflows to SHAs

to let Dependabot keep track of them using SHAs

codeql-actions doesn't point to SHAs because it isn't clear
whether Dependabot supports their release cycle mentioned
at https://github.com/github/codeql-action/issues/307

3 years agoci: pin labeler
Evgeny Vereshchagin [Thu, 11 Nov 2021 01:56:02 +0000 (01:56 +0000)] 
ci: pin labeler

Turns out GHActions where `pull_request_target` is used are capable
of pwning repositories: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/

labeler doesn't check out the source code or build anything so
it's safe in its current form but to avoid surprises let's just pin
it to the latest version. It's annoying to manage dependencies like this
manually so additionally dependabot.yml is introduced to make it
easier to keep GHActions up to date more or less automatically:
https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/keeping-your-actions-up-to-date-with-dependabot

3 years agotest: use kbd-mode-map we ship in one more test case
Yu Watanabe [Wed, 10 Nov 2021 23:55:10 +0000 (08:55 +0900)] 
test: use kbd-mode-map we ship in one more test case

Follow-up for be0cc2ce6c947aafadb3f42dba405269f670b31c.

Fixes https://github.com/systemd/systemd/pull/19670#issuecomment-965817823.

3 years agoudev: drop colon from ID_NET_NAME_MAC 21302/head
Yu Watanabe [Thu, 11 Nov 2021 02:56:53 +0000 (11:56 +0900)] 
udev: drop colon from ID_NET_NAME_MAC

Fixes a bug introduced by eaba9bb3e69635d2c490c5e1b0d262b763753e1d.

3 years agoether-addr-util: introduce hw_addr_to_string_full()
Yu Watanabe [Thu, 11 Nov 2021 02:55:04 +0000 (11:55 +0900)] 
ether-addr-util: introduce hw_addr_to_string_full()

3 years agoman: document new --chain switch to userdbctl 21304/head
Lennart Poettering [Thu, 11 Nov 2021 09:04:31 +0000 (10:04 +0100)] 
man: document new --chain switch to userdbctl

And while we are at it, make 'ssh-authorized-keys' verb properly
documented. Given that OpenSSH documents the interface in its man page
it's fine to just document our implementation of it too.

3 years agouserdbctl: add support for chaining command lines in "authorized-keys" verb
Lennart Poettering [Thu, 11 Nov 2021 08:33:39 +0000 (09:33 +0100)] 
userdbctl: add support for chaining command lines in "authorized-keys" verb

3 years agoescape: return unused memory in quote_command_line()
Lennart Poettering [Thu, 11 Nov 2021 08:33:31 +0000 (09:33 +0100)] 
escape: return unused memory in quote_command_line()

3 years agoprocess-util: use quote_command_line() at one more place
Lennart Poettering [Thu, 11 Nov 2021 08:33:10 +0000 (09:33 +0100)] 
process-util: use quote_command_line() at one more place

3 years agoescape: add flags argument to quote_command_line()
Lennart Poettering [Thu, 11 Nov 2021 08:32:32 +0000 (09:32 +0100)] 
escape: add flags argument to quote_command_line()

That way, we can reuse the call at one more place (see later patch).

3 years agocore: check fs type of BPFProgram= property path 21241/head
Julia Kartseva [Fri, 5 Nov 2021 01:55:55 +0000 (18:55 -0700)] 
core: check fs type of BPFProgram= property path

Tests:

```
% stat --file-system --format="%T" /root/bpf/trivial/
bpf_fs

% systemd-nspawn -D/ --volatile=yes \
--property=BPFProgram=egress:/root/bpf/trivial/cgroup_skb_egress \
--quiet -- ping -c 5 -W 1 ::1
PING ::1(::1) 56 data bytes

--- ::1 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4110ms
```

```
% stat --file-system --format='%T' /root/meh
btrfs

% systemd-nspawn -D/ --volatile=yes --property=BPFProgram=egress:/root/meh
--quiet -- ping -c 5 -W 1 ::1
```
sudo ./build/systemd-nspawn \
-D/ --volatile=yes --property=BPFProgram=egress:/home/hex --quiet -- \
ping -c 1 -W 1 ::1
PING ::1(::1) 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=0.017 ms

--- ::1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms

3 years agocore: fix bpf-foreign cg controller realization
Julia Kartseva [Fri, 5 Nov 2021 01:52:02 +0000 (18:52 -0700)] 
core: fix bpf-foreign cg controller realization

Requiring /sys/fs/bpf path to be a mount point at the moment of cgroup
controllers realization does more harm than good, because:
* Realization happens early on boot, the mount point may not be ready at
the time. That happens if mounts are made by a .mount unit (the issue we
encountered).
* BPF filesystem may be mounted on another point.

Remove the check. Instead verify that path provided by BPFProgram= is
within BPF fs when unit properties are parsed.

Split in two commits for simple backport.

3 years agonetwork: neighbor: accept an empty string assignment 21301/head
Yu Watanabe [Thu, 11 Nov 2021 00:24:56 +0000 (09:24 +0900)] 
network: neighbor: accept an empty string assignment

3 years agonetwork: neighbor: use "struct hw_addr_data" to store link layer address
Yu Watanabe [Thu, 11 Nov 2021 00:21:59 +0000 (09:21 +0900)] 
network: neighbor: use "struct hw_addr_data" to store link layer address

3 years agoether-addr-util: expose hw_addr_hash_func()
Yu Watanabe [Thu, 11 Nov 2021 00:21:26 +0000 (09:21 +0900)] 
ether-addr-util: expose hw_addr_hash_func()

3 years agosd-netlink: fix type of NDA_LLADDR attribute
Yu Watanabe [Thu, 11 Nov 2021 03:49:25 +0000 (12:49 +0900)] 
sd-netlink: fix type of NDA_LLADDR attribute

3 years agoMerge pull request #21273 from yuwata/hostname-device-tree
Luca Boccassi [Wed, 10 Nov 2021 23:15:20 +0000 (23:15 +0000)] 
Merge pull request #21273 from yuwata/hostname-device-tree

hostnamed: use /proc/device-tree to get chassis type

3 years agonetif-util: fix stack-use-after-scope
Yu Watanabe [Wed, 10 Nov 2021 19:03:02 +0000 (04:03 +0900)] 
netif-util: fix stack-use-after-scope

Fixes a bug introduced by 0295b2fd1d97c68010c7528af13e2952886d52e0.

Fixes #21292.

3 years agoci: take CIFuzz's matrix into consideration
Frantisek Sumsal [Wed, 10 Nov 2021 19:15:41 +0000 (20:15 +0100)] 
ci: take CIFuzz's matrix into consideration

Otherwise the jobs will try to cancel each other out.

Follow-up to 3884837610168e6fb69fc2d5709f6c017a30beb9.

3 years agosd-id128: use /proc/device-tree 21273/head
Yu Watanabe [Tue, 9 Nov 2021 01:31:17 +0000 (10:31 +0900)] 
sd-id128: use /proc/device-tree

3 years agocondition: use /proc/device-tree/
Yu Watanabe [Tue, 9 Nov 2021 01:28:43 +0000 (10:28 +0900)] 
condition: use /proc/device-tree/