]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoboot: use CMP() macro for safety 23583/head
Yu Watanabe [Tue, 31 May 2022 21:36:55 +0000 (06:36 +0900)] 
boot: use CMP() macro for safety

3 years agoboot: make several functions inline
Yu Watanabe [Tue, 31 May 2022 21:25:52 +0000 (06:25 +0900)] 
boot: make several functions inline

Follow-ups for #23512.

3 years agoboot: fix typo
Yu Watanabe [Tue, 31 May 2022 21:48:45 +0000 (06:48 +0900)] 
boot: fix typo

3 years agoDocuments the AssertCPUFeature= flag (#23594)
Steve Ramage [Thu, 2 Jun 2022 04:16:48 +0000 (21:16 -0700)] 
Documents the AssertCPUFeature= flag (#23594)

Fixes #23593

3 years agoMove basic/recovery-key.* to shared/
Zbigniew Jędrzejewski-Szmek [Tue, 31 May 2022 09:34:05 +0000 (11:34 +0200)] 
Move basic/recovery-key.* to shared/

No particular reason to have it in basic/. We should let homectl
and other users share the single copy through libsystemd-shared.

3 years agoMerge pull request #23575 from keszybz/logind-wall-message-cleanup
Zbigniew Jędrzejewski-Szmek [Wed, 1 Jun 2022 14:26:29 +0000 (16:26 +0200)] 
Merge pull request #23575 from keszybz/logind-wall-message-cleanup

Cleanup wall messages emitted by logind and systemctl

3 years agoMerge pull request #23574 from keszybz/logind-pty-wall
Zbigniew Jędrzejewski-Szmek [Wed, 1 Jun 2022 14:26:03 +0000 (16:26 +0200)] 
Merge pull request #23574 from keszybz/logind-pty-wall

Do not print logind wall message to local terminals

3 years agobuild(deps): bump actions/upload-artifact from 2.3.1 to 3.1.0
dependabot[bot] [Wed, 1 Jun 2022 10:27:03 +0000 (10:27 +0000)] 
build(deps): bump actions/upload-artifact from 2.3.1 to 3.1.0

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2.3.1 to 3.1.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/82c141cc518b40d92cc801eee768e7aafc9c2fa2...3cea5372237819ed00197afe530f5a7ea3e805c8)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agobuild(deps): bump github/super-linter from 4.9.3 to 4.9.4
dependabot[bot] [Wed, 1 Jun 2022 10:26:55 +0000 (10:26 +0000)] 
build(deps): bump github/super-linter from 4.9.3 to 4.9.4

Bumps [github/super-linter](https://github.com/github/super-linter) from 4.9.3 to 4.9.4.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md)
- [Commits](https://github.com/github/super-linter/compare/431ee7836e8cdce5a460b0db682d9169563d919b...a320804d310fdeb8d1a46c6c6c1e615d443b10c9)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agosrc: The return value of server_vacuum () is not used and could be modified to void...
Li kunyu [Wed, 18 May 2022 06:52:43 +0000 (14:52 +0800)] 
src: The return value of server_vacuum () is not used and could be modified to void type

3 years agologin: do not issue wall messages on local terminals for suspend and hibernate 23574/head
Christian Göttsche [Fri, 27 May 2022 11:47:23 +0000 (13:47 +0200)] 
login: do not issue wall messages on local terminals for suspend and hibernate

Fixes: #23520
[zjs: I added the comment and tweaked the patch a bit.

The call to reset_scheduled_shutdown() is moved down a bit to allow the
callback to have access to information about the operation being cancelled.
This all happens within the same function, so there should be no observable
change in behaviour.]

3 years agoshared/pager: print the name of the pager we'll try next in debug message 23575/head
Zbigniew Jędrzejewski-Szmek [Tue, 31 May 2022 08:59:12 +0000 (10:59 +0200)] 
shared/pager: print the name of the pager we'll try next in debug message

I had a strange failure where the pager was hanging on invocation (gdm crashed
and the kernel got into a strange state where it was hanging on some tasks).
Based on the logs from 'SYSTEMCTL_LOG_LEVEL=debug journalctl', I couldn't even
tell which pager binary we're executing. So let's shorten the function a bit and
provide a bit more detail.

3 years agoman/systemctl: improve grammar in description of --check-inhibitors
Zbigniew Jędrzejewski-Szmek [Tue, 31 May 2022 08:30:09 +0000 (10:30 +0200)] 
man/systemctl: improve grammar in description of --check-inhibitors

3 years agosystemctl: drop translation of method names to descriptions in error message
Zbigniew Jędrzejewski-Szmek [Tue, 31 May 2022 07:49:29 +0000 (09:49 +0200)] 
systemctl: drop translation of method names to descriptions in error message

We had yet-another table of descriptive strings to use in error messages.
I started thinking how to synchronize them with the strings in logind, but
ultimately I think it's better to remove those altogether. Those strings
should almost never be used: normally if the call fails, logind will provide
an error message itself, which is probably more detailed than what we can
figure out on the client side. And the most important part that we want to
show here is what exactly we called, in particular RebootWithFlags vs. Reboot,
etc. By using the "descriptive strings" we were obfuscating this. So let's just
simplify our code and print the actual method name, since this is more useful
as an error statement that is googlable and unique.

While at it, let's print the correct method name ;)

3 years agosystemctl: make function static
Zbigniew Jędrzejewski-Szmek [Mon, 30 May 2022 10:38:58 +0000 (12:38 +0200)] 
systemctl: make function static

3 years agologind: reduce scope of a few variables
Zbigniew Jędrzejewski-Szmek [Mon, 30 May 2022 12:34:05 +0000 (14:34 +0200)] 
logind: reduce scope of a few variables

3 years agologind: rework wall message about pending shutdown/halt/reboot/…
Zbigniew Jędrzejewski-Szmek [Mon, 30 May 2022 10:08:41 +0000 (12:08 +0200)] 
logind: rework wall message about pending shutdown/halt/reboot/…

Those messages simply *feel* dated: "The system is going for suspend NOW!".
Let's say "The system will suspend|power off|hibernate|… now!" instead.
The exclamation mark is enough to show the urgency.

Also, the "the" seemed out of place. We're not talking about a specific reboot.

3 years agoMerge pull request #23531 from yuwata/sd-bus-drop-version-2
Yu Watanabe [Wed, 1 Jun 2022 05:51:44 +0000 (14:51 +0900)] 
Merge pull request #23531 from yuwata/sd-bus-drop-version-2

sd-bus: drop version 2 format support

3 years agoMerge pull request #23512 from medhefgo/efi-clang
Yu Watanabe [Tue, 31 May 2022 21:16:48 +0000 (06:16 +0900)] 
Merge pull request #23512 from medhefgo/efi-clang

boot: Add string functions

3 years agologind: do not print wall messages to local pseudoterminals
Zbigniew Jędrzejewski-Szmek [Tue, 31 May 2022 13:17:52 +0000 (15:17 +0200)] 
logind: do not print wall messages to local pseudoterminals

Fixes #23520. Replaces #23555.

The problem started with cdf370626f08ed509a5dde9d5618eed29d625032 and
90b1ec03b2ce939f589239133a32f4429f2ad6a6 which together started printing the
wall message in more cases. The motivation for those change was reasonable, but
this clearly causes problems described in #23520: users are getting unexpected
wall messages. Xterm, urxvt, (anything using libutempter?), and tmux (in some
configurations), register local pty sessions in utmp.

So let's try to suppress the message for local pseudo-terminal logins. This
patch based on #23538, but instead of filtering just on /dev/pts, it uses the
.ut_addr_v6 to only filter out local entries.

3 years agotests: add a helper that dumps /run/utmp in detail
Zbigniew Jędrzejewski-Szmek [Tue, 31 May 2022 13:23:35 +0000 (15:23 +0200)] 
tests: add a helper that dumps /run/utmp in detail

utmpdump doesn't print all the details. Looking at the list if useful
when trying to tweak the wall filtering logic.

This doesn't do much, but at least it serves as a smoke test for the cleanup
functions.

3 years agosd-bus: drop constant argument for message_extend_fields() 23531/head
Yu Watanabe [Tue, 31 May 2022 18:18:38 +0000 (03:18 +0900)] 
sd-bus: drop constant argument for message_extend_fields()

3 years agosd-bus: drop D-Bus version 2 format support
Yu Watanabe [Thu, 26 May 2022 20:37:47 +0000 (05:37 +0900)] 
sd-bus: drop D-Bus version 2 format support

It seems the format is used only by kdbus.

3 years agosd-bus: merge message_peek_fields() and buffer_peek()
Yu Watanabe [Tue, 31 May 2022 18:26:24 +0000 (03:26 +0900)] 
sd-bus: merge message_peek_fields() and buffer_peek()

3 years agosd-bus: make several functions static
Yu Watanabe [Thu, 26 May 2022 23:49:19 +0000 (08:49 +0900)] 
sd-bus: make several functions static

And drop 'bus_' prefix from them.

3 years agosd-bus: use UINT32_MAX
Yu Watanabe [Thu, 26 May 2022 23:16:46 +0000 (08:16 +0900)] 
sd-bus: use UINT32_MAX

3 years agosd-bus: drop unnecessary cast
Yu Watanabe [Fri, 27 May 2022 01:36:42 +0000 (10:36 +0900)] 
sd-bus: drop unnecessary cast

3 years agosd-bus: drop redundant condition
Yu Watanabe [Fri, 27 May 2022 02:23:46 +0000 (11:23 +0900)] 
sd-bus: drop redundant condition

By the previous commit, ALIGN8() is always equal to or greater than the
argument.

3 years agosd-bus: use ALIGN8()
Yu Watanabe [Tue, 31 May 2022 18:10:28 +0000 (03:10 +0900)] 
sd-bus: use ALIGN8()

3 years agoboot: use ALIGN4()
Yu Watanabe [Tue, 31 May 2022 18:07:30 +0000 (03:07 +0900)] 
boot: use ALIGN4()

3 years agomacro: make ALIGN4() and ALIGN8() also return SIZE_MAX on overflow
Yu Watanabe [Fri, 27 May 2022 01:51:47 +0000 (10:51 +0900)] 
macro: make ALIGN4() and ALIGN8() also return SIZE_MAX on overflow

This also drops unused ALIGN4_PTR(), ALIGN8_PTR(), and ALIGN_TO_PTR().

3 years agotree-wide: use ALIGN_PTR()
Yu Watanabe [Tue, 31 May 2022 18:06:57 +0000 (03:06 +0900)] 
tree-wide: use ALIGN_PTR()

3 years agoMove message repeat
Alexander Shopov [Tue, 31 May 2022 13:07:53 +0000 (15:07 +0200)] 
Move message repeat

Original catalog file is in English
Move the repeating German message to German catalog

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
3 years agoUpdate Bulgarian translation
Alexander Shopov [Mon, 16 May 2022 17:10:04 +0000 (19:10 +0200)] 
Update Bulgarian translation

po: catalog: Bring bg.po and catalog file to 100%

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
3 years agoportable: fix command option in comment
Yu Watanabe [Tue, 31 May 2022 12:37:41 +0000 (21:37 +0900)] 
portable: fix command option in comment

Follow-up for edea370222eec3d185dd84a7d9e942ec5933af63.

3 years agologind: use consistent casing in message
Zbigniew Jędrzejewski-Szmek [Mon, 30 May 2022 09:50:29 +0000 (11:50 +0200)] 
logind: use consistent casing in message

The other strings use "sentence capitalization". Let's do the
same here.

3 years agologind: align tables
Zbigniew Jędrzejewski-Szmek [Mon, 30 May 2022 09:49:12 +0000 (11:49 +0200)] 
logind: align tables

3 years agoshared/utmp-wtmp: pass information if entry is local to filter function
Zbigniew Jędrzejewski-Szmek [Tue, 31 May 2022 13:10:18 +0000 (15:10 +0200)] 
shared/utmp-wtmp: pass information if entry is local to filter function

This just adds an unused parameter for future use. No change in
behaviour.

3 years agotty-ask-password-agent: drop unnecessary code for non-absolute paths
Zbigniew Jędrzejewski-Szmek [Tue, 31 May 2022 13:02:56 +0000 (15:02 +0200)] 
tty-ask-password-agent: drop unnecessary code for non-absolute paths

utmp_wall() always prepends /dev/, so we don't need to do this a second
time here.

3 years agoboot: Use xstrdup8/16 23512/head
Jan Janssen [Wed, 25 May 2022 09:05:19 +0000 (11:05 +0200)] 
boot: Use xstrdup8/16

Note that xstrdup is now safe to call with a NULL pointer and will
just return NULL in that case.

3 years agoboot: Add xstrdup8/16
Jan Janssen [Wed, 25 May 2022 08:59:01 +0000 (10:59 +0200)] 
boot: Add xstrdup8/16

3 years agoboot: Use memcmp/memcpy/memset
Jan Janssen [Tue, 24 May 2022 11:39:00 +0000 (13:39 +0200)] 
boot: Use memcmp/memcpy/memset

3 years agoboot: Add memcmp/memcpy/memset
Jan Janssen [Tue, 24 May 2022 11:29:43 +0000 (13:29 +0200)] 
boot: Add memcmp/memcpy/memset

3 years agoboot: Use strsize8/16
Jan Janssen [Tue, 24 May 2022 09:07:04 +0000 (11:07 +0200)] 
boot: Use strsize8/16

3 years agoboot: Add strsize8/16
Jan Janssen [Tue, 24 May 2022 08:57:00 +0000 (10:57 +0200)] 
boot: Add strsize8/16

3 years agoboot: Use strchr8/16
Jan Janssen [Tue, 24 May 2022 08:26:35 +0000 (10:26 +0200)] 
boot: Use strchr8/16

3 years agoboot: Add strchr8/16
Jan Janssen [Tue, 24 May 2022 08:21:31 +0000 (10:21 +0200)] 
boot: Add strchr8/16

3 years agoboot: Use strcpy8/16
Jan Janssen [Tue, 24 May 2022 08:16:34 +0000 (10:16 +0200)] 
boot: Use strcpy8/16

3 years agoboot: Add strcpy8/16
Jan Janssen [Tue, 24 May 2022 08:14:35 +0000 (10:14 +0200)] 
boot: Add strcpy8/16

3 years agoboot: Use strtolower8/16
Jan Janssen [Thu, 26 May 2022 08:01:03 +0000 (10:01 +0200)] 
boot: Use strtolower8/16

3 years agoboot: Add strtolower8/16
Jan Janssen [Thu, 26 May 2022 07:57:16 +0000 (09:57 +0200)] 
boot: Add strtolower8/16

3 years agoboot: Use strcmp16 for cpio sorting
Jan Janssen [Thu, 26 May 2022 07:36:30 +0000 (09:36 +0200)] 
boot: Use strcmp16 for cpio sorting

3 years agoboot: Use strcmp8/16
Jan Janssen [Tue, 24 May 2022 08:07:07 +0000 (10:07 +0200)] 
boot: Use strcmp8/16

This also replaces streq and similar functions for consistency. Note
that streq16 is null pointer safe, so streq_ptr can be safely replaced
too.

3 years agoboot: Add strcmp8/16
Jan Janssen [Mon, 23 May 2022 11:09:03 +0000 (13:09 +0200)] 
boot: Add strcmp8/16

3 years agoboot: Use strlen8/16
Jan Janssen [Mon, 23 May 2022 10:32:50 +0000 (12:32 +0200)] 
boot: Use strlen8/16

The casts in this and the next few commits are curently necessary
because CHAR8 is defined as uint8_t in gnu-efi, while char is signed.
Once we switch from gnu-efi typedefs to stdint types, the casts
will be dropped.

3 years agoboot: Add strlen8/16
Jan Janssen [Mon, 23 May 2022 09:23:40 +0000 (11:23 +0200)] 
boot: Add strlen8/16

3 years agoboot: Use stddef.h offsetof
Jan Janssen [Mon, 23 May 2022 10:08:15 +0000 (12:08 +0200)] 
boot: Use stddef.h offsetof

3 years agoseccomp: fix a typo in error message
Frantisek Sumsal [Tue, 31 May 2022 09:20:44 +0000 (11:20 +0200)] 
seccomp: fix a typo in error message

3 years agoMerge pull request #23558 from msekletar/issue-20329-followup
Yu Watanabe [Tue, 31 May 2022 08:38:25 +0000 (17:38 +0900)] 
Merge pull request #23558 from msekletar/issue-20329-followup

Actually delay running of mount start jobs when /p/s/mountinfo is rate limited

3 years agodocs: fix typo XBOOOTLDR -> XBOOTLDR
Matthias Lisin [Tue, 31 May 2022 07:58:57 +0000 (09:58 +0200)] 
docs: fix typo XBOOOTLDR -> XBOOTLDR

3 years agoSimplify random number selection
Jason A. Donenfeld [Tue, 24 May 2022 13:09:20 +0000 (15:09 +0200)] 
Simplify random number selection

We currently have a convoluted and complex selection of which random
numbers to use. We can simplify this down to two functions that cover
all of our use cases:

1) Randomness for crypto: this one needs to wait until the RNG is
   initialized. So it uses getrandom(0). If that's not available, it
   polls on /dev/random, and then reads from /dev/urandom. This function
   returns whether or not it was successful, as before.

2) Randomness for other things: this one uses getrandom(GRND_INSECURE).
   If it's not available it uses getrandom(GRND_NONBLOCK). And if that
   would block, then it falls back to /dev/urandom. And if /dev/urandom
   isn't available, it uses the fallback code. It never fails and
   doesn't return a value.

These two cases match all the uses of randomness inside of systemd.

I would prefer to make both of these return void, and get rid of the
fallback code, and simply assert in the incredibly unlikely case that
/dev/urandom doesn't exist. But Luca disagrees, so this commit attempts
to instead keep case (1) returning a return value, which all the callers
already check, and fix the fallback code in (2) to be less bad than
before.

For the less bad fallback code for (2), we now use auxval and some
timestamps, together with various counters representing the invocation,
hash it all together and provide the output. Provided that AT_RANDOM is
secure, this construction is probably okay too, though notably it
doesn't have any forward secrecy. Fortunately, it's only used by
random_bytes() and not by crypto_random_bytes().

3 years agoMerge pull request #23533 from yuwata/portable-remove-drop-in-configs
Zbigniew Jędrzejewski-Szmek [Tue, 31 May 2022 06:52:30 +0000 (08:52 +0200)] 
Merge pull request #23533 from yuwata/portable-remove-drop-in-configs

portable: remove drop-in configs

3 years agoMerge pull request #23564 from yuwata/core-unit-add-dep
Yu Watanabe [Tue, 31 May 2022 05:07:34 +0000 (14:07 +0900)] 
Merge pull request #23564 from yuwata/core-unit-add-dep

core: fix notification about unit dependency change

3 years agocgroup-util: Properly handle conditions where cgroup.threads is empty after SIGKILL...
msizanoen1 [Mon, 30 May 2022 15:08:07 +0000 (22:08 +0700)] 
cgroup-util: Properly handle conditions where cgroup.threads is empty after SIGKILL but processes still remain

After sending a SIGKILL to a process, the process might disappear from
`cgroup.threads` but still show up in `cgroup.procs` and still remains in the
cgroup and cause migrating new processes to `Delegate=yes` cgroups to fail with
`-EBUSY`. This is especially likely for heavyweight processes that consume more
kernel CPU time to clean up.

Fix this by only returning 0 when both `cgroup.threads` and
`cgroup.procs` are empty.

3 years agoMerge pull request #23560 from mrc0mmand/coccinelle
Yu Watanabe [Mon, 30 May 2022 20:02:57 +0000 (05:02 +0900)] 
Merge pull request #23560 from mrc0mmand/coccinelle

A couple of tweaks suggested by Coccinelle

3 years agoMerge pull request #23565 from bnf/man-nspawn-wording
Zbigniew Jędrzejewski-Szmek [Mon, 30 May 2022 19:50:57 +0000 (21:50 +0200)] 
Merge pull request #23565 from bnf/man-nspawn-wording

man: nspawn related wording improvements

3 years agoman/nspawn: os-release is only checked for booted containers 23565/head
Benjamin Franzke [Mon, 30 May 2022 18:21:48 +0000 (20:21 +0200)] 
man/nspawn: os-release is only checked for booted containers

/etc/os-release existence is only enforced in --boot mode,
therefore the term "starting" (which also applies to chroot-like mode)
is substituted with "booting" in this context.

3 years agoman/nspawn: add a sentence-connecting adverb to machinectl note
Benjamin Franzke [Sat, 28 May 2022 12:55:22 +0000 (14:55 +0200)] 
man/nspawn: add a sentence-connecting adverb to machinectl note

The recommendation to use machinectl login/shell instead of
trying to combine two distinct container instances seemed a
litte bit out of context and is now combined via "rather".

3 years agoman/nspawn: fix boot-option related wording
Benjamin Franzke [Sat, 28 May 2022 12:42:17 +0000 (14:42 +0200)] 
man/nspawn: fix boot-option related wording

3 years agocore: make unit_add_two_dependencies() or friends return 1 on changed 23564/head
Yu Watanabe [Mon, 30 May 2022 16:44:44 +0000 (01:44 +0900)] 
core: make unit_add_two_dependencies() or friends return 1 on changed

Follow-up for f971def3c23d780aab99d988bd71b94931d74be6.

3 years agocore/unit: fix notification about unit dependency change
Yu Watanabe [Mon, 30 May 2022 16:43:15 +0000 (01:43 +0900)] 
core/unit: fix notification about unit dependency change

This also makes unit_add_dependency() return 1 only when a dependency
is added.

3 years agoMerge pull request #23562 from yuwata/fix-typo
Yu Watanabe [Mon, 30 May 2022 16:52:39 +0000 (01:52 +0900)] 
Merge pull request #23562 from yuwata/fix-typo

Fix typo

3 years agoesp: fix typo 23562/head
Yu Watanabe [Mon, 30 May 2022 16:16:41 +0000 (01:16 +0900)] 
esp: fix typo

Follow-up for 13d7c841a24f784995a000230706f259c4baec96.

3 years agococcinelle: don't try to use IN_SET() in assert_cc() 23560/head
Frantisek Sumsal [Mon, 30 May 2022 16:17:11 +0000 (18:17 +0200)] 
coccinelle: don't try to use IN_SET() in assert_cc()

Since assert_cc() requires an integral constant expression.

3 years agodoc: fix typo
Yu Watanabe [Mon, 30 May 2022 16:16:01 +0000 (01:16 +0900)] 
doc: fix typo

Follow-ups for #23504.

3 years agojournal: return & log in one statement
Frantisek Sumsal [Mon, 30 May 2022 14:51:48 +0000 (16:51 +0200)] 
journal: return & log in one statement

3 years agoanalyze: use IN_SET() in one more place
Frantisek Sumsal [Mon, 30 May 2022 14:50:57 +0000 (16:50 +0200)] 
analyze: use IN_SET() in one more place

3 years agotest: add coverage for #23481 23533/head
Frantisek Sumsal [Wed, 25 May 2022 18:30:34 +0000 (20:30 +0200)] 
test: add coverage for #23481

Provide some coverage for systemd/systemd#23481.

Without 794da5a:
```
[   34.730815] testsuite-29.sh[600]: + portablectl detach --now --runtime --enable /tmp/rootdir minimal-app0
         Stopping minimal-app0-foo.service...
[  OK  ] Stopped minimal-app0-foo.service.
         Stopping minimal-app0.service...
[  OK  ] Stopped minimal-app0.service.
[   34.878050] testsuite-29.sh[1383]: =================================================================
[   34.878421] testsuite-29.sh[1383]: ==1383==ERROR: LeakSanitizer: detected memory leaks
[   34.878784] testsuite-29.sh[1383]: Direct leak of 48 byte(s) in 2 object(s) allocated from:
[   34.879174] testsuite-29.sh[1383]:     #0 0x7fdf9c8b0f8c in reallocarray (/lib64/libasan.so.6+0xaef8c)
[   34.879554] testsuite-29.sh[1383]:     #1 0x7fdf9b4270f5 in unit_file_changes_add ../src/shared/install.c:282
[   34.879926] testsuite-29.sh[1383]:     #2 0x7fdf9b2ad9e5 in bus_deserialize_and_dump_unit_file_changes ../src/shared/bus-unit-util.c:2688
[   34.880267] testsuite-29.sh[1383]:     #3 0x40bc27 in maybe_enable_disable ../src/portable/portablectl.c:582
[   34.880673] testsuite-29.sh[1383]:     #4 0x40ef56 in maybe_stop_disable ../src/portable/portablectl.c:810
[   34.881064] testsuite-29.sh[1383]:     #5 0x410bc2 in detach_image ../src/portable/portablectl.c:924
[   34.881493] testsuite-29.sh[1383]:     #6 0x7fdf9b5df424 in dispatch_verb ../src/shared/verbs.c:103
[   34.881953] testsuite-29.sh[1383]:     #7 0x41604a in run ../src/portable/portablectl.c:1427
[   34.882459] testsuite-29.sh[1383]:     #8 0x416106 in main ../src/portable/portablectl.c:1430
[   34.882947] testsuite-29.sh[1383]:     #9 0x7fdf99d5de8f in __libc_start_call_main (/lib64/libc.so.6+0x44e8f)
[   34.883368] testsuite-29.sh[1383]: Indirect leak of 104 byte(s) in 2 object(s) allocated from:
[   34.883732] testsuite-29.sh[1383]:     #0 0x7fdf9c85b8f7 in strdup (/lib64/libasan.so.6+0x598f7)
[   34.884089] testsuite-29.sh[1383]:     #1 0x7fdf9b4271aa in unit_file_changes_add ../src/shared/install.c:288
[   34.884508] testsuite-29.sh[1383]:     #2 0x7fdf9b2ad9e5 in bus_deserialize_and_dump_unit_file_changes ../src/shared/bus-unit-util.c:2688
[   34.884926] testsuite-29.sh[1383]:     #3 0x40bc27 in maybe_enable_disable ../src/portable/portablectl.c:582
[   34.885307] testsuite-29.sh[1383]:     #4 0x40ef56 in maybe_stop_disable ../src/portable/portablectl.c:810
[   34.885647] testsuite-29.sh[1383]:     #5 0x410bc2 in detach_image ../src/portable/portablectl.c:924
[   34.885987] testsuite-29.sh[1383]:     #6 0x7fdf9b5df424 in dispatch_verb ../src/shared/verbs.c:103
[   34.886271] testsuite-29.sh[1383]:     #7 0x41604a in run ../src/portable/portablectl.c:1427
[   34.886557] testsuite-29.sh[1383]:     #8 0x416106 in main ../src/portable/portablectl.c:1430
[   34.886892] testsuite-29.sh[1383]:     #9 0x7fdf99d5de8f in __libc_start_call_main (/lib64/libc.so.6+0x44e8f)
[   34.887187] testsuite-29.sh[1383]: Indirect leak of 2 byte(s) in 2 object(s) allocated from:
[   34.887520] testsuite-29.sh[1383]:     #0 0x7fdf9c85b8f7 in strdup (/lib64/libasan.so.6+0x598f7)
[   34.887797] testsuite-29.sh[1383]:     #1 0x7fdf9b427249 in unit_file_changes_add ../src/shared/install.c:296
[   34.888117] testsuite-29.sh[1383]:     #2 0x7fdf9b2ad9e5 in bus_deserialize_and_dump_unit_file_changes ../src/shared/bus-unit-util.c:2688
[   34.888434] testsuite-29.sh[1383]:     #3 0x40bc27 in maybe_enable_disable ../src/portable/portablectl.c:582
[   34.888693] testsuite-29.sh[1383]:     #4 0x40ef56 in maybe_stop_disable ../src/portable/portablectl.c:810
[   34.888990] testsuite-29.sh[1383]:     #5 0x410bc2 in detach_image ../src/portable/portablectl.c:924
[   34.889254] testsuite-29.sh[1383]:     #6 0x7fdf9b5df424 in dispatch_verb ../src/shared/verbs.c:103
[   34.889580] testsuite-29.sh[1383]:     #7 0x41604a in run ../src/portable/portablectl.c:1427
[   34.889877] testsuite-29.sh[1383]:     #8 0x416106 in main ../src/portable/portablectl.c:1430
[   34.890193] testsuite-29.sh[1383]:     #9 0x7fdf99d5de8f in __libc_start_call_main (/lib64/libc.so.6+0x44e8f)
[   34.890482] testsuite-29.sh[1383]: SUMMARY: AddressSanitizer: 154 byte(s) leaked in 6 allocation(s).

```

With 794da5a:
```
[  OK  ] Started minimal-app0.service.
[   36.794367] testsuite-29.sh[600]: + portablectl detach --now --runtime --enable /tmp/rootdir minimal-app0
         Stopping minimal-app0-foo.service...
[  OK  ] Stopped minimal-app0-foo.service.
         Stopping minimal-app0.service...
[  OK  ] Stopped minimal-app0.service.
[   36.851251] testsuite-29.sh[600]: + umount /tmp/rootdir
```

3 years agoportable: remove drop-in configs even if the main unit file does not exist
Yu Watanabe [Fri, 27 May 2022 05:11:56 +0000 (14:11 +0900)] 
portable: remove drop-in configs even if the main unit file does not exist

When we run `portablectl detach --enable --runtime`, then it triggers
`DisableUnitFilesWithFlags` DBus method and the main unit file is
removed, but its drop-ins are not. Hence, portable_detach() failed to
list existing portable units.

This makes the loop for listing portable units also accept drop-in
directories. So, all remaining drop-in directories are correctly
removed.

Before:
```
testsuite-29.sh[600]: + portablectl detach --now --runtime --enable /tmp/rootdir minimal-app0
portablectl[1391]: (Matching unit files with prefixes 'minimal-app0'.)
portablectl[1391]: Queued /org/freedesktop/systemd1/job/1812 to call StopUnit on portable service minimal-app0-foo.service.
portablectl[1391]: Removed "/run/systemd/system.attached/minimal-app0-foo.service".
portablectl[1391]: Queued /org/freedesktop/systemd1/job/1813 to call StopUnit on portable service minimal-app0.service.
portablectl[1391]: Removed "/run/systemd/system.attached/minimal-app0.service".
portablectl[1391]: Got result done/Success for job minimal-app0-foo.service
portablectl[1391]: Got result done/Success for job minimal-app0.service
portablectl[1391]: DetachImage failed: No unit files associated with '/tmp/rootdir' found attached to the system. Image not attached?
```

After:
```
testsuite-29.sh[508]: + portablectl detach --now --runtime --enable /tmp/rootdir minimal-app0
portablectl[1076]: (Matching unit files with prefixes 'minimal-app0'.)
portablectl[1076]: Queued /org/freedesktop/systemd1/job/1946 to call StopUnit on portable service minimal-app0-foo.service.
portablectl[1076]: Removed "/run/systemd/system.attached/minimal-app0-foo.service".
portablectl[1076]: Queued /org/freedesktop/systemd1/job/1947 to call StopUnit on portable service minimal-app0.service.
portablectl[1076]: Removed "/run/systemd/system.attached/minimal-app0.service".
portablectl[1076]: Removed /run/systemd/system.attached/minimal-app0.service.d/10-profile.conf.
portablectl[1076]: Removed /run/systemd/system.attached/minimal-app0.service.d/20-portable.conf.
portablectl[1076]: Removed /run/systemd/system.attached/minimal-app0.service.d.
portablectl[1076]: Removed /run/systemd/system.attached/minimal-app0-foo.service.d/10-profile.conf.
portablectl[1076]: Removed /run/systemd/system.attached/minimal-app0-foo.service.d/20-portable.conf.
portablectl[1076]: Removed /run/systemd/system.attached/minimal-app0-foo.service.d.
portablectl[1076]: Removed /run/portables/rootdir.
portablectl[1076]: Removed /run/systemd/system.attached.
```

3 years agoMerge pull request #23354 from DaanDeMeyer/mount-implicit-device-dep-trace
Yu Watanabe [Mon, 30 May 2022 16:00:56 +0000 (01:00 +0900)] 
Merge pull request #23354 from DaanDeMeyer/mount-implicit-device-dep-trace

core: Add trace logging to mount_add_device_dependencies()

3 years agotests: make sure we delay running mount start jobs when /p/s/mountinfo is rate limited 23558/head
Michal Sekletar [Mon, 30 May 2022 12:50:05 +0000 (14:50 +0200)] 
tests: make sure we delay running mount start jobs when /p/s/mountinfo is rate limited

3 years agounit: check for mount rate limiting before checking active state
Michal Sekletar [Mon, 30 May 2022 09:55:41 +0000 (11:55 +0200)] 
unit: check for mount rate limiting before checking active state

Having this check as part of mount_can_start() is too late because
UNIT(u)->can_start() virtual method is called after checking the active
state of unit in unit_start().

We need to hold off running mount start jobs when /p/s/mountinfo monitor
is rate limited even when given mount unit is already active.

Fixes #20329

3 years agoMerge pull request #23529 from nabijaczleweli/dollar-asterisk
Zbigniew Jędrzejewski-Szmek [Mon, 30 May 2022 08:27:14 +0000 (10:27 +0200)] 
Merge pull request #23529 from nabijaczleweli/dollar-asterisk

Don't linebreak after each initrd in kernel-install verbose mode

3 years agomeson: Build header tests with -pedantic
Jan Janssen [Fri, 27 May 2022 19:15:22 +0000 (21:15 +0200)] 
meson: Build header tests with -pedantic

By using __extension__, we can silence pedantic errors we cannot or
do not want to fix.

This in particular silences:
 - enum values being outside of int range
 - variadic macros
 - long long being C99
 - type of bit-field ‘type’ is a GCC extension
 - use of C99 bool in public header functions

3 years agoportable: try to remove unit files even in a spurious state
Yu Watanabe [Sun, 29 May 2022 19:34:29 +0000 (04:34 +0900)] 
portable: try to remove unit files even in a spurious state

3 years agotest: drop redundant log message
Yu Watanabe [Fri, 27 May 2022 04:37:27 +0000 (13:37 +0900)] 
test: drop redundant log message

3 years agoMerge pull request #23542 from medhefgo/attributes
Yu Watanabe [Sun, 29 May 2022 19:07:41 +0000 (04:07 +0900)] 
Merge pull request #23542 from medhefgo/attributes

meson: Document why -Wimplicit-fallthrough is not used with clang

3 years agotests: link tests using fabs against libm explicitly
Evgeny Vereshchagin [Thu, 26 May 2022 16:16:22 +0000 (16:16 +0000)] 
tests: link tests using fabs against libm explicitly

Some compiler wrappers like honggfuzz pass -fno-builtin explicitly
and because of that the tests where fabs is used fail to compile
with something like
```
FAILED: test-bus-marshal
...
/usr/bin/ld: test-bus-marshal.p/src_libsystemd_sd-bus_test-bus-marshal.c.o: undefined reference to symbol 'fabs@@GLIBC_2.2.5'
/usr/bin/ld: /usr/lib64/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
```

Fun fact: it took honggfuzz less than a minute to discover
https://github.com/advisories/GHSA-gmc7-pqv9-966m used by
systemd to compress/descompress some stuff.

3 years agoclang-format: Adjust style of pointers
Jan Janssen [Sat, 28 May 2022 12:25:15 +0000 (14:25 +0200)] 
clang-format: Adjust style of pointers

We gernerally have our pointers aligned to the right. SpaceAroundPointerQualifiers
makes sure "const char * const" is formatted nicely.

3 years agoMerge pull request #23550 from evverx/fuzz-i386
Frantisek Sumsal [Sun, 29 May 2022 18:35:03 +0000 (18:35 +0000)] 
Merge pull request #23550 from evverx/fuzz-i386

oss-fuzz: support i386

3 years agoMerge pull request #23548 from tpgxyz/lua2
Zbigniew Jędrzejewski-Szmek [Sun, 29 May 2022 18:08:05 +0000 (20:08 +0200)] 
Merge pull request #23548 from tpgxyz/lua2

rpm: adjust lua trigger for udevadm

3 years agooss-fuzz: support i386 23550/head
Evgeny Vereshchagin [Sun, 29 May 2022 06:52:54 +0000 (06:52 +0000)] 
oss-fuzz: support i386

Closes https://github.com/systemd/systemd/issues/23532

3 years agodocs: mention how to build 32 bit fuzz targets
Evgeny Vereshchagin [Sun, 29 May 2022 07:36:33 +0000 (07:36 +0000)] 
docs: mention how to build 32 bit fuzz targets

3 years agomeson: exclude pcre2 when dependencies are skipped
Evgeny Vereshchagin [Sun, 29 May 2022 06:44:45 +0000 (06:44 +0000)] 
meson: exclude pcre2 when dependencies are skipped

3 years agorpm: adjust lua trigger for udevadm 23548/head
Tomasz Paweł Gajc [Sat, 28 May 2022 19:38:33 +0000 (21:38 +0200)] 
rpm: adjust lua trigger for udevadm

3 years agorpm: use rpm.execute() instead of fork() and execp() for trigger scriplets 23539/head
Tomasz Paweł Gajc [Fri, 27 May 2022 14:15:01 +0000 (16:15 +0200)] 
rpm: use rpm.execute() instead of fork() and execp() for trigger scriplets

3 years agoMove homectl and userdbctl to bindir
Michael Biebl [Sat, 28 May 2022 10:00:08 +0000 (12:00 +0200)] 
Move homectl and userdbctl to bindir

Those binaries aren't needed during early boot.

3 years agomeson: Document why -Wimplicit-fallthrough is not used with clang 23542/head
Jan Janssen [Sat, 28 May 2022 09:41:10 +0000 (11:41 +0200)] 
meson: Document why -Wimplicit-fallthrough is not used with clang

This changes the macro to ensure proper fallthrough attributes are
used with clang in case this option is added in the future.

3 years agoman: Fix minor typo
Javkhlanbayar Khongorzul [Sat, 28 May 2022 09:10:58 +0000 (11:10 +0200)] 
man: Fix minor typo

3 years agomacro: Move attribute defintions to macro-fundamental
Jan Janssen [Sat, 28 May 2022 09:25:33 +0000 (11:25 +0200)] 
macro: Move attribute defintions to macro-fundamental

This also sorts them.