]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
12 months agofirstboot: generalize prompt_loop more 34958/head
Michael Ferrari [Wed, 9 Oct 2024 15:30:44 +0000 (17:30 +0200)] 
firstboot: generalize prompt_loop more

Allows unifying the custom logic for the hostname and root shell. Root
password prompting remains separate as it's logic is substantially
different to the other prompts.

12 months agofirstboot: use consistent wording for prompts
Michael Ferrari [Tue, 8 Oct 2024 23:19:43 +0000 (01:19 +0200)] 
firstboot: use consistent wording for prompts

12 months agofirstboot: clean up welcome message
Michael Ferrari [Tue, 8 Oct 2024 16:58:04 +0000 (18:58 +0200)] 
firstboot: clean up welcome message

12 months agofirstboot: order non-interactive options last
Michael Ferrari [Mon, 7 Oct 2024 09:02:16 +0000 (11:02 +0200)] 
firstboot: order non-interactive options last

12 months agomkosi: Update packaging specs to latest (#34951)
Yu Watanabe [Wed, 30 Oct 2024 17:31:03 +0000 (02:31 +0900)] 
mkosi: Update packaging specs to latest (#34951)

12 months agoFix display of qrcodes by bsod and other related cleanups (#34914)
Lennart Poettering [Wed, 30 Oct 2024 16:44:40 +0000 (17:44 +0100)] 
Fix display of qrcodes by bsod and other related cleanups (#34914)

12 months agoask-password: Allow configuring the keyring timeout via an environment variable
Daan De Meyer [Wed, 30 Oct 2024 12:53:31 +0000 (13:53 +0100)] 
ask-password: Allow configuring the keyring timeout via an environment variable

In mkosi, we want an easy way to set the keyring timeout for every
tool we invoke that might use systemd-ask-password to query for a
password which is then stored in the kernel keyring. Let's make this
possible via a new $SYSTEMD_ASK_PASSWORD_KEYRING_TIMEOUT_SEC environment
variable.

Using an environment variable means we don't have to modify every separate
tool to add a CLI option allowing to specify the timeout. In mkosi specifically,
we'll set up a new session keyring for the mkosi process linked to the user keyring
so that any pins in the user keyring are used if available, and otherwise we'll query
for and store password in mkosi's session keyring with a zero timeout so that they stay
in the keyring until the mkosi process exits at which point they're removed from the
keyring.

12 months agologind: add BlockWeakInhibited property
Luca Boccassi [Wed, 30 Oct 2024 13:44:00 +0000 (13:44 +0000)] 
logind: add BlockWeakInhibited property

Fixes https://github.com/systemd/systemd/issues/34091
Follow-up for 804874d26ac73e0af07c4c5d7165c95372f03f6d

12 months agocore: make mount(8) and swapon(8) inherit SMACK label from systemd
Łukasz Stelmach [Tue, 29 Oct 2024 14:53:45 +0000 (15:53 +0100)] 
core: make mount(8) and swapon(8) inherit SMACK label from systemd

By default mount(8), umount(8), swapon(8) and swapoff(8) should run with
with the SMACK label inherited from systemd rather than the default one
meant for services.

Fixes: aa5ae9711ef3cd0c69b7fcfbd65bca05fb704a8a
Follow-up-for: 20bbf5ee4c6c80599a91e7a4b7474e931a27db4a

12 months agomkosi: update debian commit reference 34951/head
Daan De Meyer [Wed, 30 Oct 2024 15:31:39 +0000 (16:31 +0100)] 
mkosi: update debian commit reference

2f288667e0 Install sysupdate.feature manpage
384393a955 d/systemd.postrm: delete more internal state directories on purge

12 months agomkosi: update arch commit reference
Daan De Meyer [Wed, 30 Oct 2024 15:29:43 +0000 (16:29 +0100)] 
mkosi: update arch commit reference

62c224b60c Specify --no-rebuild when calling meson install
b5c20dc6b0 fix redirection for dash
7fef8e4cdd upgpkg: 256.7-1: new upstream release

12 months agocoredump: AccessContainer= bunch of followups (#34333)
Luca Boccassi [Wed, 30 Oct 2024 14:37:44 +0000 (14:37 +0000)] 
coredump: AccessContainer= bunch of followups (#34333)

Fixes #34130

12 months agoNEWS: remove duplicated entry
Zbigniew Jędrzejewski-Szmek [Sat, 26 Oct 2024 05:22:01 +0000 (07:22 +0200)] 
NEWS: remove duplicated entry

The same item is described below.

Also reflow some paragraphs (presumably indented with emacs, which does this
wrong).

12 months agocryptenroll,homectl,journalctl: adjust messages before qrcodes 34914/head
Zbigniew Jędrzejewski-Szmek [Mon, 28 Oct 2024 12:59:05 +0000 (13:59 +0100)] 
cryptenroll,homectl,journalctl: adjust messages before qrcodes

Users will generally know what a qrcode is, so let's not treat them as dumb and
explain that it can be scanned. OTOH, we should say what the qrcode contains
and it is useful to give a hint why the users would want to scan it. Reword
messages accordingly.

(Also, don't say "to your phone", when somebody might be using a stolen phone,
or something else then a phone.)

12 months agobsod: make message for qrcode more useful
Zbigniew Jędrzejewski-Szmek [Mon, 28 Oct 2024 12:51:25 +0000 (13:51 +0100)] 
bsod: make message for qrcode more useful

People know what a qrcode is. We don't need to tell them to scan it.
Instead, we should say what the code contains.

While at it, rename "stream" to "f" in line with the usual style.

12 months agotest: add test coverage for EnterNamespace= 34333/head
Michal Sekletar [Fri, 6 Sep 2024 17:23:09 +0000 (19:23 +0200)] 
test: add test coverage for EnterNamespace=

12 months agocoredump: return correct error variable
Michal Sekletár [Tue, 29 Oct 2024 17:41:55 +0000 (17:41 +0000)] 
coredump: return correct error variable

12 months agocoredump: rename AccessContainer= to EnterNamespace=
Michal Sekletar [Tue, 10 Sep 2024 17:32:57 +0000 (19:32 +0200)] 
coredump: rename AccessContainer= to EnterNamespace=

12 months agocoredump: rework gather_pid_mount_tree_fd()
Michal Sekletar [Tue, 10 Sep 2024 17:15:46 +0000 (19:15 +0200)] 
coredump: rework gather_pid_mount_tree_fd()

12 months agocoredump: use FORK_WAIT
Michal Sekletar [Mon, 9 Sep 2024 16:48:48 +0000 (18:48 +0200)] 
coredump: use FORK_WAIT

12 months agocore: add EXEC_DIRECTORY_TYPE_SHALL_CHOWN() helper
Lennart Poettering [Wed, 30 Oct 2024 09:59:57 +0000 (10:59 +0100)] 
core: add EXEC_DIRECTORY_TYPE_SHALL_CHOWN() helper

Let's make ConfigurationDirectory= a bit less "special-casey", by hiding
the fact that it's the only per-service dir we do not do chown()ing for
inside of a new EXEC_DIRECTORY_TYPE_SHALL_CHOWN() helper.

12 months agocoredump: store actual fd in appropriate variable
Michal Sekletar [Mon, 9 Sep 2024 16:31:57 +0000 (18:31 +0200)] 
coredump: store actual fd in appropriate variable

12 months agocoredump: use FORK_LOG to get more precise logging
Michal Sekletar [Mon, 9 Sep 2024 16:28:13 +0000 (18:28 +0200)] 
coredump: use FORK_LOG to get more precise logging

12 months agocoredump: fix coding style
Michal Sekletar [Mon, 9 Sep 2024 16:25:21 +0000 (18:25 +0200)] 
coredump: fix coding style

12 months agocoredump: get rid of redundant double space
Michal Sekletar [Mon, 9 Sep 2024 16:18:35 +0000 (18:18 +0200)] 
coredump: get rid of redundant double space

12 months agocoredump: use more appropriate return code
Michal Sekletar [Mon, 9 Sep 2024 16:17:18 +0000 (18:17 +0200)] 
coredump: use more appropriate return code

12 months agocoredump: check for and close unexpected FDs
Michal Sekletar [Mon, 9 Sep 2024 16:07:14 +0000 (18:07 +0200)] 
coredump: check for and close unexpected FDs

12 months agocoredump: fix line spacing
Michal Sekletar [Mon, 9 Sep 2024 14:15:57 +0000 (16:15 +0200)] 
coredump: fix line spacing

12 months agocoredump: merge variable definitions
Michal Sekletar [Mon, 9 Sep 2024 13:48:39 +0000 (15:48 +0200)] 
coredump: merge variable definitions

12 months agocoredump: rework attaching container mount trees
Michal Sekletar [Mon, 9 Sep 2024 13:44:30 +0000 (15:44 +0200)] 
coredump: rework attaching container mount trees

12 months agodocs: Update instructions for building distribution packages in HACKING.md (#34941)
Lennart Poettering [Wed, 30 Oct 2024 11:11:28 +0000 (12:11 +0100)] 
docs: Update instructions for building distribution packages in HACKING.md (#34941)

When building distribution packages without building an image, the
distribution packages will only be located in mkosi.builddir/ now and
not in mkosi.output/, so update the documentation to reflect that.

Also add installation instructions for distributions other than
CentOS/Fedora while we're at it.

12 months agodocs: Update instructions for building distribution packages in HACKING.md 34941/head
Daan De Meyer [Wed, 30 Oct 2024 09:43:58 +0000 (10:43 +0100)] 
docs: Update instructions for building distribution packages in HACKING.md

When building distribution packages without building an image, the
distribution packages will only be located in mkosi.builddir/ now and
not in mkosi.output/, so update the documentation to reflect that.

Also add installation instructions for distributions other than CentOS/Fedora
while we're at it.

12 months agodocs: Align some comments in HACKING.md
Daan De Meyer [Wed, 30 Oct 2024 10:16:13 +0000 (11:16 +0100)] 
docs: Align some comments in HACKING.md

12 months agoanalyze: Add times in seconds for Activating and Activated in tooltip
hugo303 [Fri, 25 Oct 2024 10:15:02 +0000 (12:15 +0200)] 
analyze: Add times in seconds for Activating and Activated in tooltip

Print the times in seconds in the tooltip to remove the need to count
and trying to follow the lines in the svg diagram in order to see at
what times these events happen.

12 months agonetwork/tunnel: allow Local=/Remote=any for all tunnel types
Yu Watanabe [Tue, 29 Oct 2024 17:51:18 +0000 (02:51 +0900)] 
network/tunnel: allow Local=/Remote=any for all tunnel types

It seems there is no restriction for local and remote addresses.

Fixes #34930.

12 months agosd-netlink,network: do not set NLM_F_CREATE and NLM_F_EXCL flags if an interface...
Yu Watanabe [Mon, 28 Oct 2024 14:32:50 +0000 (23:32 +0900)] 
sd-netlink,network: do not set NLM_F_CREATE and NLM_F_EXCL flags if an interface index is specified

If an ifindex is specified, we are modifying the existing interface.
Hence, these flags should not be set. Otherwise, the request will be
refused with -EEXIST.

12 months agonetwork: skip processing netdev if it is already detached (#34935)
Daan De Meyer [Wed, 30 Oct 2024 09:27:24 +0000 (10:27 +0100)] 
network: skip processing netdev if it is already detached (#34935)

split-out of #34909.

12 months agopretty-print: add format-string version of draw_progress_bar() (#34939)
Daan De Meyer [Wed, 30 Oct 2024 09:26:48 +0000 (10:26 +0100)] 
pretty-print: add format-string version of draw_progress_bar() (#34939)

We often format the prefix string via asprintf() before, let's hence add
a helper for that.

12 months agoupdate NEWS
Lennart Poettering [Wed, 30 Oct 2024 08:13:48 +0000 (09:13 +0100)] 
update NEWS

12 months agoupdate TODO
Lennart Poettering [Wed, 30 Oct 2024 08:06:33 +0000 (09:06 +0100)] 
update TODO

12 months agocore/service: support sd_notify() MAINPIDFD=1 and MAINPIDFDID= (#34932)
Lennart Poettering [Wed, 30 Oct 2024 07:45:25 +0000 (08:45 +0100)] 
core/service: support sd_notify() MAINPIDFD=1 and MAINPIDFDID= (#34932)

12 months agonetwork: add missing else in dhcp_lease_load (#34927)
Lennart Poettering [Wed, 30 Oct 2024 07:39:15 +0000 (08:39 +0100)] 
network: add missing else in dhcp_lease_load (#34927)

Fixes: 3fd6708cde0f (network: Serialize DNR servers)
---

Fixes: #34926
12 months agonetwork: Restrict the valid charset of DNR names 34927/head
Ronan Pigott [Tue, 29 Oct 2024 04:26:51 +0000 (21:26 -0700)] 
network: Restrict the valid charset of DNR names

Not all possible DNS names will survive serialization. Restrict the set
of valid dns names to LDH encoded names.

Fixes: 25c33e350042 (network: parse RFC9463 DHCPv4 DNR option, 2024-01-16)
Fixes: a07e83cc58f6 (network: Parse RFC9463 DHCPv6 DNR option, 2024-01-17)
Fixes: 0c90d1d2f243 (ndisc: Parse RFC9463 encrypted DNS (DNR) option, 2024-01-19)
12 months agopretty-print: add format-string version of draw_progress_bar() 34939/head
Lennart Poettering [Tue, 29 Oct 2024 20:32:28 +0000 (21:32 +0100)] 
pretty-print: add format-string version of draw_progress_bar()

We often format the prefix string via asprintf() before, let's hence add
a helper for that.

12 months agopretty-print: rename draw_progress_bar_impl()→draw_progress_bar_unbuffered()
Lennart Poettering [Tue, 29 Oct 2024 20:14:54 +0000 (21:14 +0100)] 
pretty-print: rename draw_progress_bar_impl()→draw_progress_bar_unbuffered()

12 months agobusctl: minor tweak to help text for --limit-messages=
Lennart Poettering [Tue, 29 Oct 2024 20:13:51 +0000 (21:13 +0100)] 
busctl: minor tweak to help text for --limit-messages=

12 months agoimport: Draw progress bars
Daan De Meyer [Fri, 25 Oct 2024 15:03:37 +0000 (17:03 +0200)] 
import: Draw progress bars

Currently every progress update results in a new progress message
which is extremely verbose. Instead, let's use the progress bar infra
to draw a proper progress bar similar to what we do in systemd-repart
now.

12 months agoprogress-bar: issue Windows Terminal progress indicating ANSI sequences (#34929)
Lennart Poettering [Tue, 29 Oct 2024 20:00:15 +0000 (21:00 +0100)] 
progress-bar: issue Windows Terminal progress indicating ANSI sequences (#34929)

This generates the Windows Terminal OSC sequences indicating progress.
This let's the terminal know that we are doing a slow operation, and how
we are progressing.

Windows Terminal uses this in two ways: it shows a circle in the tab
that completes, and it highlights the progress in the task bar.

I found no Linux terminal that currently supports it, but also none that
didn't like it. Thankfully most terminals correctly ignore unrecognized
OSC sequences.

I think we should just merge this, and see if this trips up too many
people, but I have reason to believe this shouldn't be too bad.

And yes, I do work from Windows Terminal sometimes, ssh into my Linux
build systems, and it is really cute seeing the progress animation
there.

12 months agosysusers: optionally create fully locked accounts (#34876)
Luca Boccassi [Tue, 29 Oct 2024 18:46:14 +0000 (18:46 +0000)] 
sysusers: optionally create fully locked accounts (#34876)

Let's ramp up security for system user accounts, at least where
possible, by creating them fully locked (instead of just with an invalid
password). This matters when taking non-password (i.e. SSH) logins into
account.

Fixes: #13522
12 months agobusctl: various bugfixes + tweaks (#34928)
Luca Boccassi [Tue, 29 Oct 2024 18:15:16 +0000 (18:15 +0000)] 
busctl: various bugfixes + tweaks (#34928)

Fixes: #34048
Replaces: #34796
Follow-up for: #33961

12 months agoanalyze: don't use Yoda conditions
Michal Sekletar [Mon, 9 Sep 2024 12:36:35 +0000 (14:36 +0200)] 
analyze: don't use Yoda conditions

12 months agoanalyze: modernize opening ELF binary a bit
Michal Sekletar [Mon, 9 Sep 2024 10:54:16 +0000 (12:54 +0200)] 
analyze: modernize opening ELF binary a bit

12 months agonetwork/netdev: skip processing netdev if it is already detached 34935/head
Yu Watanabe [Sun, 27 Oct 2024 14:36:11 +0000 (23:36 +0900)] 
network/netdev: skip processing netdev if it is already detached

No functional change, as currently networkd detaches NetDev objects only
on stop (or invalid .netdev file is loaded).
Preparation for later commits.

12 months agonetwork/netdev: split out netdev_attach_name_full()
Yu Watanabe [Sun, 27 Oct 2024 14:02:50 +0000 (23:02 +0900)] 
network/netdev: split out netdev_attach_name_full()

No functional change, preparation for later commits.

12 months agoTEST-80-NOTIFYACCESS: don't specify --pid= if MAINPID= is provided explicitly 34932/head
Mike Yuan [Tue, 29 Oct 2024 17:35:50 +0000 (18:35 +0100)] 
TEST-80-NOTIFYACCESS: don't specify --pid= if MAINPID= is provided explicitly

Otherwise, with recent additions, the MAINPIDFDID= generated by
systemd-notify would mismatch with overridden MAINPID=.

12 months agonotify: send MAINPIDFDID= for --pid= too if available
Mike Yuan [Fri, 25 Oct 2024 23:51:18 +0000 (01:51 +0200)] 
notify: send MAINPIDFDID= for --pid= too if available

12 months agocore/service: support sd_notify() MAINPIDFD=1 and MAINPIDFDID=
Mike Yuan [Fri, 25 Oct 2024 22:49:18 +0000 (00:49 +0200)] 
core/service: support sd_notify() MAINPIDFD=1 and MAINPIDFDID=

These serve as race-free alternatives for MAINPID= notification.

12 months agoshared/fdset: minor modernization
Mike Yuan [Fri, 25 Oct 2024 23:15:38 +0000 (01:15 +0200)] 
shared/fdset: minor modernization

12 months agomkosi: update fedora commit reference 34876/head
Lennart Poettering [Tue, 29 Oct 2024 16:22:23 +0000 (17:22 +0100)] 
mkosi: update fedora commit reference

e42eed4afd test_sysusers_defined: support new ! line flag for creating fully locked accounts
2c6a4e2f90 Version 256.7
bedc0270e7 Move yum/dnf protection removal config file under /usr
5a82129a41 Reword some descriptions
ce99022f7b Version 256.6

12 months agoMerge pull request #34245 from bluca/logind_drop_weak_delay_inhibitor
Zbigniew Jędrzejewski-Szmek [Tue, 29 Oct 2024 16:13:11 +0000 (17:13 +0100)] 
Merge pull request #34245 from bluca/logind_drop_weak_delay_inhibitor

logind: drop new delay-weak inhibitor

12 months agobusctl: add the usual section highlighting to our --help texts 34928/head
Lennart Poettering [Mon, 28 Oct 2024 13:04:05 +0000 (14:04 +0100)] 
busctl: add the usual section highlighting to our --help texts

12 months agobusctl: add a testcase that definitely causes the timeout to trigger
Lennart Poettering [Mon, 28 Oct 2024 12:59:28 +0000 (13:59 +0100)] 
busctl: add a testcase that definitely causes the timeout to trigger

12 months agobusctl: if --timeout= or --limit-messages= are specified with no argument, reset...
Lennart Poettering [Mon, 28 Oct 2024 12:52:04 +0000 (13:52 +0100)] 
busctl: if --timeout= or --limit-messages= are specified with no argument, reset to defaults.

Follow-up for: 989e843e7543b21b91de4368da44692d674722a5
See: #34048

12 months agobusctl: rename --num-matches= → --limit-messages=
Lennart Poettering [Mon, 28 Oct 2024 12:48:30 +0000 (13:48 +0100)] 
busctl: rename --num-matches= → --limit-messages=

We should avoid unnecessary abbreviations for such messages, and this
puts a maximum limit on things, hence it should indicate this in the
name.

Moreover, matches is a bit confusing, since most people will probably
call "busctl monitor" without any match specification, i.e. zero
matches, but that's not what was meant here at all.

Also, add a brief switch for this (-N) since I figure in particular
"-N1" might be a frequent operation people might want to use.

Follow-up for: 989e843e7543b21b91de4368da44692d674722a5
See: #34048

12 months agobusctl: fix timeout calculation for "busctl monitor"
Lennart Poettering [Mon, 28 Oct 2024 12:36:00 +0000 (13:36 +0100)] 
busctl: fix timeout calculation for "busctl monitor"

The --timeout= logic was implemented incorrectly, as it would not put a
a limit on the runtime of the operation, but only on the IO sleep.
However, spurious wakeups are possible, hence the timer would be reset
too often.

Fix that, by determining the absolute timestamp early, and checking
against that.

Follow-up for: 989e843e7543b21b91de4368da44692d674722a5
See: #34048

12 months agoNEWS: be less misleading since systemd-run does not support ExtraFileDescriptors...
Mike Yuan [Tue, 29 Oct 2024 15:32:34 +0000 (16:32 +0100)] 
NEWS: be less misleading since systemd-run does not support ExtraFileDescriptors= yet

12 months agomeson.build: do not mark test-progress-bar as manual 34929/head
Lennart Poettering [Tue, 29 Oct 2024 14:55:12 +0000 (15:55 +0100)] 
meson.build: do not mark test-progress-bar as manual

It will finish on its own always and cleanly, and running it always
should increase test coverage.

12 months agoprogress-bar: issue Windows Terminal progress indicating ANSI sequences
Lennart Poettering [Tue, 29 Oct 2024 10:27:51 +0000 (11:27 +0100)] 
progress-bar: issue Windows Terminal progress indicating ANSI sequences

This generates the Windows Terminal OSC sequences indicating progress.
This let's the terminal know that we are doing a slow operation, and how
we are progressing.

Windows Terminal uses this in two ways: it shows a circle in the tab
that completes, and it highlights the progress in the task bar.

I found no Linux terminal that currently supports it, but also none that
didn't like it. Thankfully most terminals correctly ignore unrecognized
OSC sequences.

I think we should just merge this, and see if this trips up too many
people, but I have reason to believe this shouldn't be too bad.

And yes, I do work from Windows Terminal sometimes, ssh into my Linux
build systems, and it is really cute seeing the progress animation
there.

12 months agoudevadm: automatically anable JSON-SEQ in case JSON is used for "udevadm info -a"
Lennart Poettering [Mon, 28 Oct 2024 12:26:01 +0000 (13:26 +0100)] 
udevadm: automatically anable JSON-SEQ in case JSON is used for "udevadm info -a"

We are going to output a series of JSON objects, hence let's
automatically enable JSON-SEQ output mode, as we usually do.

"jq --seq" supports this natively, hence this should not really restrict
us.

Follow-up for: 67ea8a4c0edef33b1775536bc81d5de2c8ac4d88

12 months agomkosi: Move copying packages to the output directory to the postinst script
Daan De Meyer [Mon, 28 Oct 2024 20:12:19 +0000 (21:12 +0100)] 
mkosi: Move copying packages to the output directory to the postinst script

Now that we have the mkosi.clangd script to run clangd from the mkosi
build script, it becomes clear that doing cleanup with mkosi.clean has
a big gap in that we always run the mkosi.clean script and thus we also
run it when we run the mkosi.clangd script, causing the previously built
packages to be removed when we run clangd without producing new ones.

In mkosi we're improving the situation by only running clean scripts when we
clean up the output directory and disallowing writing to the output directory
from build scripts.

Let's adapt systemd to these changes by moving the copying of packages to the
output directory to the postinst script.

12 months agotest: test new 'u' sysusers.d lines
Lennart Poettering [Thu, 24 Oct 2024 08:01:14 +0000 (10:01 +0200)] 
test: test new 'u' sysusers.d lines

12 months agosysusers.d: lock all system users defined by us
Lennart Poettering [Wed, 23 Oct 2024 20:22:54 +0000 (22:22 +0200)] 
sysusers.d: lock all system users defined by us

12 months agosysusers: add new ! line flag for creating fully locked accounts
Lennart Poettering [Wed, 23 Oct 2024 20:22:15 +0000 (22:22 +0200)] 
sysusers: add new ! line flag for creating fully locked accounts

Fixes: #13522
12 months agoMerge pull request #34391 from poettering/dns-long-label-fix
Lennart Poettering [Tue, 29 Oct 2024 09:47:14 +0000 (10:47 +0100)] 
Merge pull request #34391 from poettering/dns-long-label-fix

resolved: fixes when trying to serialize overly long DNS names

12 months agoqrcode-util: avoid memleak in error path
Zbigniew Jędrzejewski-Szmek [Mon, 28 Oct 2024 12:45:40 +0000 (13:45 +0100)] 
qrcode-util: avoid memleak in error path

12 months agotest-terminal-util: print value of colors_enabled()
Zbigniew Jędrzejewski-Szmek [Mon, 28 Oct 2024 12:39:36 +0000 (13:39 +0100)] 
test-terminal-util: print value of colors_enabled()

This makes it easier to diagnose why colors are disabled.

12 months agobsod: do not check for color support
Zbigniew Jędrzejewski-Szmek [Mon, 28 Oct 2024 12:38:58 +0000 (13:38 +0100)] 
bsod: do not check for color support

When invoked on a running system, bsod would not print the qrcode.
The check for "color support" on stdout is pointless, since we're not
printing to stdout but to a terminal fd that is opened separately.

12 months agonetwork: add missing else in dhcp_lease_load
Ronan Pigott [Tue, 29 Oct 2024 03:33:35 +0000 (20:33 -0700)] 
network: add missing else in dhcp_lease_load

Fixes: 3fd6708cde0f (network: Serialize DNR servers)
12 months agoupdate-utmp: wait slightly longer for the private bus socket being active
Yu Watanabe [Sat, 26 Oct 2024 14:28:32 +0000 (23:28 +0900)] 
update-utmp: wait slightly longer for the private bus socket being active

Before a339495b1d67f69f49ffffdd96002164a28f1c93, update-utmp typically
connects the public DBus socket when disconnected from the private DBus
socket, as dbus service should be active even during PID1 is being reexecuted.

However, after a339495b1d67f69f49ffffdd96002164a28f1c93, update-utmp
tries to connect only the private DBus socket, but reexecution of PID1
may be slow, hence all trials may fail when the reexecution is slow.

With this change, now it waits for 100ms to 2000ms, so in total it waits
about 37 seconds in average, previously about 4 seconds.

12 months agoman: fix return parameter type of sd_device_get_device_id()
Lennart Poettering [Mon, 28 Oct 2024 22:34:40 +0000 (23:34 +0100)] 
man: fix return parameter type of sd_device_get_device_id()

12 months agosocket: support setting ownership of message queues
David Michael [Fri, 25 Oct 2024 14:45:44 +0000 (10:45 -0400)] 
socket: support setting ownership of message queues

This applies the existing SocketUser=/SocketGroup= options to units
defining a POSIX message queue, bringing them in line with UNIX
sockets and FIFOs.  They are set on the file descriptor rather than
a file system path because the /dev/mqueue path interface is an
optional mount unit.

12 months agoupdate NEWS for v257
Lennart Poettering [Mon, 28 Oct 2024 22:34:19 +0000 (23:34 +0100)] 
update NEWS for v257

12 months agoMerge pull request #34633 from keszybz/sd-json-enum-formatting
Yu Watanabe [Mon, 28 Oct 2024 18:29:03 +0000 (03:29 +0900)] 
Merge pull request #34633 from keszybz/sd-json-enum-formatting

Add sd_json_format_enabled() helper

12 months agoMerge pull request #34806 from ryantimwilson/protect-control-groups
Yu Watanabe [Mon, 28 Oct 2024 17:53:11 +0000 (02:53 +0900)] 
Merge pull request #34806 from ryantimwilson/protect-control-groups

cgroup: Add support for ProtectControlGroups= private and strict

12 months agopo: Translated using Weblate (Czech)
Pavel Borecki [Mon, 28 Oct 2024 15:47:46 +0000 (16:47 +0100)] 
po: Translated using Weblate (Czech)

Currently translated at 86.5% (219 of 253 strings)

Co-authored-by: Pavel Borecki <pavel.borecki@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/cs/
Translation: systemd/main

12 months agocgroup: Add support for ProtectControlGroups= private and strict 34806/head
Ryan Wilson [Fri, 18 Oct 2024 18:41:09 +0000 (11:41 -0700)] 
cgroup: Add support for ProtectControlGroups= private and strict

This commit adds two settings private and strict to
the ProtectControlGroups= property. Private will unshare the cgroup
namespace and mount a read-write private cgroup2 filesystem at /sys/fs/cgroup.
Strict does the same except the mount is read-only. Since the unit is
running in a cgroup namespace, the new root of /sys/fs/cgroup is the unit's
own cgroup.

We also add a new dbus property ProtectControlGroupsEx which accepts strings
instead of boolean. This will allow users to use private/strict via dbus
and systemd-run in addition to service files.

Note private and strict fall back to no and yes respectively if the kernel
doesn't support cgroup2 or system is not using unified hierarchy.

Fixes: #34634
12 months agocore: Refactor ProtectControlGroups= to use enum vs bool
Ryan Wilson [Wed, 16 Oct 2024 23:51:17 +0000 (16:51 -0700)] 
core: Refactor ProtectControlGroups= to use enum vs bool

This commit refactors ProtectControlGroups= from using a boolean
in the dbus/execute backend to using an enum. There is no functional
change but this will allow adding new non-boolean values (e.g. strict,
private) a la PrivateHome.

12 months agoqrcode-util: add debug message to show why a qrcode wasn't printed
Zbigniew Jędrzejewski-Szmek [Mon, 28 Oct 2024 12:15:32 +0000 (13:15 +0100)] 
qrcode-util: add debug message to show why a qrcode wasn't printed

12 months agosysv-generator: break long message into lines
Zbigniew Jędrzejewski-Szmek [Fri, 18 Oct 2024 17:41:25 +0000 (19:41 +0200)] 
sysv-generator: break long message into lines

The journal handles multi-line messages nicely, and they are easier
to read. Drop the recycling symbol, there is no circular process here,
we go from a to b and never back to a again.

12 months agosd-json,tree-wide: add sd_json_format_enabled() and use it everwhere 34633/head
Zbigniew Jędrzejewski-Szmek [Fri, 4 Oct 2024 16:08:35 +0000 (18:08 +0200)] 
sd-json,tree-wide: add sd_json_format_enabled() and use it everwhere

We often used a pattern like if (!FLAGS_SET(flags, SD_JSON_FORMAT_OFF)),
which is rather verbose and also contains a double negative, which we try
to avoid. Add a little helper to avoid an explicit bit check.

This change clarifies an aditional thing: in some cases we treated
SD_JSON_FORMAT_OFF as a flag (flags & SD_JSON_FORMAT_OFF), while in other cases
we treated it as an independent enum value (flags == SD_JSON_FORMAT_OFF).
In the first form, flags like SD_JSON_FORMAT_SSE do _not_ turn the json
output on, while in the second form they do. Let's use the first form
everywhere.

No functional change intended.

Initially I wasn't sure if this helper should be made public or just internal,
but it seems such a common pattern that if we expose the flags, we might just
as well expose it too, to make life easier for any consumers.

12 months agosd-id128: mark functions as const, not pure
Zbigniew Jędrzejewski-Szmek [Mon, 28 Oct 2024 08:20:32 +0000 (09:20 +0100)] 
sd-id128: mark functions as const, not pure

We would need to use pure if the funtion was getting pointers and
dereferencing them. But sd128_t is a structure and those functions
only access the parameters of the call.

12 months agosd-common: add __const__
Zbigniew Jędrzejewski-Szmek [Mon, 28 Oct 2024 08:13:10 +0000 (09:13 +0100)] 
sd-common: add __const__

const is stronger than pure, see
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-pure-function-attribute
and
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-const-function-attribute.

12 months agomeson: add loongarch64's definition to cpu_arch_defines
Zhou Qiankang [Mon, 28 Oct 2024 04:47:20 +0000 (12:47 +0800)] 
meson: add loongarch64's definition to cpu_arch_defines

The default definition to add is `-D__loongarch64__`, which is not searched in [bpf_tracing.h](https://github.com/libbpf/libbpf/blob/09b9e83102eb8ab9e540d36b4559c55f3bcdb95d/src/bpf_tracing.h#L68)

This may avoid `error: Must specify a BPF target arch via __TARGET_ARCH_xxx` in loongarch64

Signed-off-by: Zhou Qiankang <wszqkzqk@qq.com>
12 months agopo: Translated using Weblate (Indonesian)
Andika Triwidada [Sun, 27 Oct 2024 05:38:33 +0000 (06:38 +0100)] 
po: Translated using Weblate (Indonesian)

Currently translated at 100.0% (253 of 253 strings)

Co-authored-by: Andika Triwidada <andika@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/id/
Translation: systemd/main

12 months agoMerge pull request #34902 from ryantimwilson/root-dir-not-exists-error
Yu Watanabe [Sun, 27 Oct 2024 04:49:05 +0000 (13:49 +0900)] 
Merge pull request #34902 from ryantimwilson/root-dir-not-exists-error

core: Add RootDirectory= path to error message if directory does not exist

12 months agocore: Add RootDirectory= path to error message if directory does not exist 34902/head
Ryan Wilson [Sat, 26 Oct 2024 22:33:30 +0000 (15:33 -0700)] 
core: Add RootDirectory= path to error message if directory does not exist

A colleague reported when RootDirectory= does not exist, systemd reports an error like:
```
Failed to set up mount namespacing: No such file or directory
```

Unfortunately, with large spec files, it can be hard to diagnose which path systemd is talking
about. Thus, to make the error message more helpful and similar to mount error messages, we add
the root directory/image path into the error message like:
```
Failed to set up mount namespacing: /tmp/thisdoesnotexist: No such file or directory
```

12 months agocore/execute: Rename error_path -> reterr_path/ret_path per coding guidelines
Ryan Wilson [Sat, 26 Oct 2024 22:28:49 +0000 (15:28 -0700)] 
core/execute: Rename error_path -> reterr_path/ret_path per coding guidelines

This is a non-functional change to ensure error_path used to print out the
offending mount causing an error follows coding guidelines.

12 months agocore/cgroup: rename CGROUP_PRESSURE_WATCH_ON/OFF -> CGROUP_PRESSURE_WATCH_YES/NO
Yu Watanabe [Sat, 26 Oct 2024 16:24:49 +0000 (01:24 +0900)] 
core/cgroup: rename CGROUP_PRESSURE_WATCH_ON/OFF -> CGROUP_PRESSURE_WATCH_YES/NO

No functional change, but let's print yes/no rather than on/off in systemd-analyze.

Similar to 2e8a581b9cc1132743c2341fc334461096266ad4 and
edd3f4d9b7a63dc9a142ef20119e80d1d9527f2f.
(Note, the commit messages of those commits are wrong, as
 parse_boolean() supports on/off anyway.)

12 months agohwdb: add Stream Deck Neo (#34903)
Sascha Mester [Sat, 26 Oct 2024 15:27:29 +0000 (17:27 +0200)] 
hwdb: add Stream Deck Neo (#34903)

12 months agosd-event: fix memleak when built without assertion
Yu Watanabe [Fri, 25 Oct 2024 18:25:26 +0000 (03:25 +0900)] 
sd-event: fix memleak when built without assertion

Fixes a bug introduced by baf3fdec27f0b3a1f3d39c7def2a778824cbee51.

This also adds several assertions at the beginning of the function.

Fixes #34899.