]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
9 months agoudevadm-control: allow to enable/disable trace logging in systemd-udevd 36070/head
Yu Watanabe [Sat, 11 Jan 2025 17:05:43 +0000 (02:05 +0900)] 
udevadm-control: allow to enable/disable trace logging in systemd-udevd

Should be useful for debugging udev rules.

9 months agoudev-varlink: allow to enable/disable trace logging through varlink
Yu Watanabe [Sat, 11 Jan 2025 16:43:12 +0000 (01:43 +0900)] 
udev-varlink: allow to enable/disable trace logging through varlink

This introduces io.systemd.Udev.SetTrace varlink method. With the
method, trace logging by udev worker can be dynamically controlled.

9 months agoudev-config: allow to enable trace logging through kernel command line
Yu Watanabe [Sat, 11 Jan 2025 16:35:48 +0000 (01:35 +0900)] 
udev-config: allow to enable trace logging through kernel command line

This adds udev.trace[=BOOL] kernel command line option to control trace
logging.

9 months agoudev-control: move setting of log level to manager_adjust_config()
Yu Watanabe [Mon, 20 Jan 2025 19:03:05 +0000 (04:03 +0900)] 
udev-control: move setting of log level to manager_adjust_config()

No functional change, just refactoring.

9 months agoresolved: empty "ipv4hint" and "ipv6hint" SvcParams are invalid
Tommi Rantala [Mon, 20 Jan 2025 11:05:49 +0000 (13:05 +0200)] 
resolved: empty "ipv4hint" and "ipv6hint" SvcParams are invalid

According to RFC 9460 "An empty list of addresses is invalid."

https://www.rfc-editor.org/rfc/rfc9460.html#section-7.3

9 months agotree-wide: drop merely used _cleanup_ macros, and introduce several new ones (#36071)
Yu Watanabe [Mon, 20 Jan 2025 18:41:27 +0000 (03:41 +0900)] 
tree-wide: drop merely used _cleanup_ macros, and introduce several new ones (#36071)

9 months agoudev: cleanups around sd_listen_fds() (#36030)
Lennart Poettering [Mon, 20 Jan 2025 17:06:56 +0000 (18:06 +0100)] 
udev: cleanups around sd_listen_fds() (#36030)

Fixes a bug introduced by 2f0aa9a80445ef18086260a60fad71920ad9486c.

In the offending commit, `sd_varlink_server_listen_auto()` is used. That
may add file descriptors of netlink socket for uevent and legacy control
socket varlink server. Then, udevd may fail to receive uevents.

9 months agotree-wide: several follow-ups for varlink methods (#36080)
Lennart Poettering [Mon, 20 Jan 2025 17:00:21 +0000 (18:00 +0100)] 
tree-wide: several follow-ups for varlink methods (#36080)

Follow-ups for #35914.

9 months agoudev-rules: introduce OPTIONS="dump" (#36069)
Lennart Poettering [Mon, 20 Jan 2025 16:59:40 +0000 (17:59 +0100)] 
udev-rules: introduce OPTIONS="dump" (#36069)

split out of #35968.

9 months agosbsign: Make sure output file respects umask (#36083)
Daan De Meyer [Mon, 20 Jan 2025 13:02:29 +0000 (14:02 +0100)] 
sbsign: Make sure output file respects umask (#36083)

9 months agosbsign: Make sure output file mode respects umask 36083/head
Daan De Meyer [Sun, 19 Jan 2025 21:48:21 +0000 (22:48 +0100)] 
sbsign: Make sure output file mode respects umask

9 months agosbsign: Make two debug logs into error logs
Daan De Meyer [Mon, 20 Jan 2025 08:01:37 +0000 (09:01 +0100)] 
sbsign: Make two debug logs into error logs

9 months agoudev-varlink: add io.systemd.service.GetEnvironment 36080/head
Yu Watanabe [Sun, 19 Jan 2025 15:08:07 +0000 (00:08 +0900)] 
udev-varlink: add io.systemd.service.GetEnvironment

There is no reason to not support the method in udevd.

Follow-up for c8127075ae22ad0f64d3072f400818f6e1a9ab48.

9 months agotree-wide: rely on sd_varlink_dispatch() for validating zero-argument method calls...
Yu Watanabe [Sun, 19 Jan 2025 15:04:01 +0000 (00:04 +0900)] 
tree-wide: rely on sd_varlink_dispatch() for validating zero-argument method calls, too

Follow-ups for a7cc7038ac06d2c02cbaa5a749aa47b4f7cbe786.

9 months agoudev,network: drop unnecessary check for result of sd_listen_fds_with_names() 36030/head
Yu Watanabe [Wed, 15 Jan 2025 20:27:34 +0000 (05:27 +0900)] 
udev,network: drop unnecessary check for result of sd_listen_fds_with_names()

9 months agoudev-manager: rework initialization of device monitor
Yu Watanabe [Wed, 15 Jan 2025 19:47:20 +0000 (04:47 +0900)] 
udev-manager: rework initialization of device monitor

Let's determine the socket for device monitor based on its name.

9 months agoudev-ctrl: use -EBADF for invalid file descriptor
Yu Watanabe [Wed, 15 Jan 2025 20:13:57 +0000 (05:13 +0900)] 
udev-ctrl: use -EBADF for invalid file descriptor

9 months agoudev: split out legacy control socket handling to udev-manager-ctrl.c
Yu Watanabe [Wed, 15 Jan 2025 20:07:41 +0000 (05:07 +0900)] 
udev: split out legacy control socket handling to udev-manager-ctrl.c

Mostly no functional change, except for that now the socket for device
monitor is determined by its name.

9 months agocapability-util: rename output argument of capability_gain_cap_setpcap()
Yu Watanabe [Sat, 18 Jan 2025 22:37:39 +0000 (07:37 +0900)] 
capability-util: rename output argument of capability_gain_cap_setpcap()

9 months agocore: use usec_add() at one more place
Yu Watanabe [Sun, 19 Jan 2025 02:55:54 +0000 (11:55 +0900)] 
core: use usec_add() at one more place

Follow-up for 8af1b296cb2cec8ddbb2cb47f4194269eb6cee2b.
Fixes CID#1590317.

9 months agoTweaks to generic "io.systemd.service" Varlink interface, and hook it up in all long...
Yu Watanabe [Sun, 19 Jan 2025 02:54:10 +0000 (11:54 +0900)] 
Tweaks to generic "io.systemd.service" Varlink interface, and hook it up in all long-running Varlink daemons (#35914)

9 months agopid1,nspawn: enable usrquota on /tmp/ + /dev/shm/ (#36036)
Yu Watanabe [Sun, 19 Jan 2025 02:51:54 +0000 (11:51 +0900)] 
pid1,nspawn: enable usrquota on /tmp/ + /dev/shm/ (#36036)

Split out of #36010.

This simply enables the "usrquota" mount option on the two dirs if they
are backed by tmpfs.

#36010 contains a test that actually verifies that the mount option does
its thing.

9 months agotree-wide: coding style fixlets done by coccinelle (#36074)
Yu Watanabe [Sun, 19 Jan 2025 02:51:12 +0000 (11:51 +0900)] 
tree-wide: coding style fixlets done by coccinelle (#36074)

9 months agoman/systemd.special: Add suspend-then-hibernate.target to sleep.target documentation
Hendrik Wolff [Fri, 17 Jan 2025 16:59:08 +0000 (17:59 +0100)] 
man/systemd.special: Add suspend-then-hibernate.target to sleep.target documentation

9 months agotree-wide: coding style fixlets done by coccinelle 36074/head
Yu Watanabe [Sat, 18 Jan 2025 23:28:14 +0000 (08:28 +0900)] 
tree-wide: coding style fixlets done by coccinelle

9 months agococcinelle: add .gitignore for cache files
Yu Watanabe [Sat, 18 Jan 2025 23:25:56 +0000 (08:25 +0900)] 
coccinelle: add .gitignore for cache files

9 months agotree-wide: use log_level_is_valid() more 35914/head
Lennart Poettering [Tue, 7 Jan 2025 22:44:41 +0000 (23:44 +0100)] 
tree-wide: use log_level_is_valid() more

9 months agotest: add superficial test for generic per-service varlink API
Lennart Poettering [Tue, 7 Jan 2025 22:37:31 +0000 (23:37 +0100)] 
test: add superficial test for generic per-service varlink API

9 months agotree-wide: implement generic io.systemd.service Varlink interface in all long-running...
Lennart Poettering [Tue, 7 Jan 2025 14:21:53 +0000 (15:21 +0100)] 
tree-wide: implement generic io.systemd.service Varlink interface in all long-running services

Given we have the generic interface, let's hook it up everywhere.

This doesnt bother with the Reload() call usually, since that's more
involved, but hooks up the other relevant functions where applicable.

9 months agovarlink: add generic GetEnvironment() call to the Varlink "service" interface
Lennart Poettering [Tue, 7 Jan 2025 14:23:28 +0000 (15:23 +0100)] 
varlink: add generic GetEnvironment() call to the Varlink "service" interface

It's just so useful being able to retrieve the current env block from
our services. Add a concept for that. It's really simple, and dumb.

In many ways it's like /proc/$PID/environ, but shows the actual
environ[] array visible to the app, not just some memory that was
originally used for the env block passed in, but might have been rearranged.

9 months agovarlink: tweak introspection description for Reload()
Lennart Poettering [Tue, 7 Jan 2025 13:45:06 +0000 (14:45 +0100)] 
varlink: tweak introspection description for Reload()

9 months agovarlink: drop redundant check
Lennart Poettering [Tue, 7 Jan 2025 13:46:00 +0000 (14:46 +0100)] 
varlink: drop redundant check

sd_varlink_dispatch() alredy validates all this, no need to check this
manually.

9 months agovarlink: rely on sd_varlink_dispatch() for validating zero-argument method calls...
Lennart Poettering [Tue, 7 Jan 2025 13:48:22 +0000 (14:48 +0100)] 
varlink: rely on sd_varlink_dispatch() for validating zero-argument method calls, too

9 months agojson-util: fine tune json_dispatch_log_level()
Lennart Poettering [Tue, 7 Jan 2025 13:24:33 +0000 (14:24 +0100)] 
json-util: fine tune json_dispatch_log_level()

Let's give the user control on how to handle JSON "null" assignments of
the log level. As one of three cases: as failure, as LOG_NULL (i.e. to
turn off logging) or as LOG_INFO (as our usual default log level).

Let's then use that in the generic SetLogLevel() call, so that callers
can use it to explicitly turn off logging in a service.

Note that this was (probably accidentally) already implemented, except
that the introspection enforcement blocked it. Let's clean this up and
make this officially a thing, since it's generally useful to turn off
logging I think.

9 months agonspawn: enable usrquota support on /tmp/ and /dev/shm/ 36036/head
Lennart Poettering [Tue, 14 Jan 2025 15:51:27 +0000 (16:51 +0100)] 
nspawn: enable usrquota support on /tmp/ and /dev/shm/

9 months agounits: enable usrquota support on /tmp/
Lennart Poettering [Tue, 14 Jan 2025 15:52:04 +0000 (16:52 +0100)] 
units: enable usrquota support on /tmp/

9 months agopid1: enable usrquota support on /dev/shm
Lennart Poettering [Tue, 14 Jan 2025 15:51:49 +0000 (16:51 +0100)] 
pid1: enable usrquota support on /dev/shm

9 months agoman: replace "-" with "none" in cryptsetup commands and crypttab
nl6720 [Sat, 18 Jan 2025 15:46:03 +0000 (17:46 +0200)] 
man: replace "-" with "none" in cryptsetup commands and crypttab

`none` is more explicit and harder to overlook than `-` which in certain
contexts could be misunderstood to mean standard input.

9 months agoTODO: fix typo
Yu Watanabe [Sat, 18 Jan 2025 19:25:19 +0000 (04:25 +0900)] 
TODO: fix typo

Follow-up for fb8d46cffeac5a9607f94022978ae6ce95e6b8dc.

9 months agoprocess-util: fix typo
Yu Watanabe [Sat, 18 Jan 2025 19:24:05 +0000 (04:24 +0900)] 
process-util: fix typo

Also rebreak comment.

Follow-up for 03b89cf213d5d1a60601ff158a6366718461fa4b.

9 months agologin: fix typo
Yu Watanabe [Sat, 18 Jan 2025 19:22:11 +0000 (04:22 +0900)] 
login: fix typo

Follow-up for a6ad410ffa5d63647ea9048932b7b459cbe55662.

9 months agoboot: introduce _cleanup_strv_free_ 36071/head
Yu Watanabe [Sat, 18 Jan 2025 19:18:04 +0000 (04:18 +0900)] 
boot: introduce _cleanup_strv_free_

9 months agoboot: introduce _cleanup_file_close_
Yu Watanabe [Sat, 18 Jan 2025 19:15:27 +0000 (04:15 +0900)] 
boot: introduce _cleanup_file_close_

9 months agoselinux-util: drop _cleanup_context_free_
Yu Watanabe [Sat, 18 Jan 2025 19:09:52 +0000 (04:09 +0900)] 
selinux-util: drop _cleanup_context_free_

It is used at only one place, not necessary.

9 months agocapability-util: drop _cleanup_cap_free_charp_
Yu Watanabe [Sat, 18 Jan 2025 19:04:44 +0000 (04:04 +0900)] 
capability-util: drop _cleanup_cap_free_charp_

Also moves cap_free_charpp() to test-cap-list.c, as it is used only
there.

9 months agotree-wide: use _cleanup_hashmap_free_ and friends
Yu Watanabe [Sat, 18 Jan 2025 18:37:24 +0000 (03:37 +0900)] 
tree-wide: use _cleanup_hashmap_free_ and friends

9 months agoudev-rules: introduce OPTIONS="dump" token 36069/head
Yu Watanabe [Sat, 11 Jan 2025 08:00:17 +0000 (17:00 +0900)] 
udev-rules: introduce OPTIONS="dump" token

Should be useful for debugging.

9 months agoudev-dump: split out dump_event() from udevadm-test.c
Yu Watanabe [Sat, 11 Jan 2025 06:56:27 +0000 (15:56 +0900)] 
udev-dump: split out dump_event() from udevadm-test.c

9 months agopid1: when a password is requested during PAMName= processing, query it via the ask...
Lennart Poettering [Tue, 14 Jan 2025 23:24:29 +0000 (00:24 +0100)] 
pid1: when a password is requested during PAMName= processing, query it via the ask-password logic

9 months agoudev: add --verbose option for 'udevadm test' and add more verbose logs (#36021)
Yu Watanabe [Fri, 17 Jan 2025 21:12:31 +0000 (06:12 +0900)] 
udev: add --verbose option for 'udevadm test' and add more verbose logs (#36021)

split out of #35968.

9 months agotree-wide: switch various uses of mkdtemp() over to mkdtemp_malloc() (#36057)
Luca Boccassi [Fri, 17 Jan 2025 19:49:49 +0000 (19:49 +0000)] 
tree-wide: switch various uses of mkdtemp() over to mkdtemp_malloc() (#36057)

9 months agoescape: make 'bad' parameter optional
Lennart Poettering [Mon, 18 Nov 2024 22:10:38 +0000 (23:10 +0100)] 
escape: make 'bad' parameter optional

Treat a NULL bad parameter just like an empty one: do not escape any
additional characters except for the CC chars.

9 months agomeson: bump C std to gnu17
Mike Yuan [Thu, 16 Jan 2025 17:50:54 +0000 (18:50 +0100)] 
meson: bump C std to gnu17

GCC 8.4 (our baseline) defaults to gnu17 already.

9 months agoudev-rules: add trace logs for GOTO and parent conditions 36021/head
Yu Watanabe [Sun, 12 Jan 2025 20:18:25 +0000 (05:18 +0900)] 
udev-rules: add trace logs for GOTO and parent conditions

9 months agoudev-rules: update log messages
Yu Watanabe [Wed, 15 Jan 2025 14:47:05 +0000 (23:47 +0900)] 
udev-rules: update log messages

This also adds trace logs about token result, and skipping assignment
caused by final value already assigned.

9 months agoudev-rules: ignore whole command result if it is too long and does not contain newline
Yu Watanabe [Wed, 15 Jan 2025 14:43:37 +0000 (23:43 +0900)] 
udev-rules: ignore whole command result if it is too long and does not contain newline

9 months agoudev-rules: introduce udev_replace_chars_and_log()
Yu Watanabe [Wed, 15 Jan 2025 13:09:05 +0000 (22:09 +0900)] 
udev-rules: introduce udev_replace_chars_and_log()

And logs about replacement only when trace logging is enabled.

9 months agoudev-rules: add more trace logs for string match
Yu Watanabe [Sun, 12 Jan 2025 19:03:11 +0000 (04:03 +0900)] 
udev-rules: add more trace logs for string match

9 months agoudev-rules: logs result of format substitution
Yu Watanabe [Sat, 11 Jan 2025 15:12:52 +0000 (00:12 +0900)] 
udev-rules: logs result of format substitution

This also drops redundant token string in log message on truncation.

No functional change, but should improve debuggability.

9 months agoudev-rules: show original token string in log_event_error() and friends
Yu Watanabe [Sun, 12 Jan 2025 20:12:40 +0000 (05:12 +0900)] 
udev-rules: show original token string in log_event_error() and friends

This also makes
- make many loggers refactored,
- log_event_error() and friends UdevEvent object,
- introduces log_event_trace().

No functional change, just refactoring and preparation for later
commits.

9 months agoudevadm-test: introduce -v/--verbose option to show verbose log messages
Yu Watanabe [Sun, 12 Jan 2025 20:09:15 +0000 (05:09 +0900)] 
udevadm-test: introduce -v/--verbose option to show verbose log messages

Currently this does not show any extra log messages. In later commits,
more verbose log messages will be added.

9 months agohexdump: if size is SIZE_MAX, use strlen()
Lennart Poettering [Mon, 18 Nov 2024 11:32:24 +0000 (12:32 +0100)] 
hexdump: if size is SIZE_MAX, use strlen()

Similar how we do this as various places: if SIZE_MAX is specified as
size determine the size automatically via strlen().

9 months agonspawn: assorted coding style fixes 36057/head
Lennart Poettering [Fri, 17 Jan 2025 08:50:01 +0000 (09:50 +0100)] 
nspawn: assorted coding style fixes

9 months agotree-wide: switch various uses of mkdtemp() over to mkdtemp_malloc()
Lennart Poettering [Fri, 17 Jan 2025 08:49:17 +0000 (09:49 +0100)] 
tree-wide: switch various uses of mkdtemp() over to mkdtemp_malloc()

9 months agomkosi: update fedora commit reference
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jan 2025 21:26:30 +0000 (22:26 +0100)] 
mkosi: update fedora commit reference

c7fecc18eb Skip test_sysusers_defined on upstream builds
f257050ddd Add a .editorconfig file
aa5546e9ed Add a few mkosi artifact directories to .gitignore
01e5bc1c93 Set SBAT in sd-boot when building on OBS
a7eec4d33d Run upstream integration test suite with Fedora CI

9 months agoSeveral fixlets for GCC warnings (#36051)
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jan 2025 21:41:31 +0000 (22:41 +0100)] 
Several fixlets for GCC warnings (#36051)

Replaces #36043 and #36039.

9 months agoTwo readme tweaks (#36053)
Lennart Poettering [Thu, 16 Jan 2025 21:40:07 +0000 (22:40 +0100)] 
Two readme tweaks (#36053)

9 months agoREADME: add sgx to list of required groups 36053/head
Zbigniew Jędrzejewski-Szmek [Thu, 16 Jan 2025 20:18:11 +0000 (21:18 +0100)] 
README: add sgx to list of required groups

Follow-up for c9c4899f4444d9586e541b5e72597a37f949433a.

9 months agodocs/HACKING: use 'run0' to indicate which commands require privileges
Zbigniew Jędrzejewski-Szmek [Mon, 9 Dec 2024 19:24:34 +0000 (20:24 +0100)] 
docs/HACKING: use 'run0' to indicate which commands require privileges

9 months agoupdate TODO
Lennart Poettering [Thu, 16 Jan 2025 20:58:30 +0000 (21:58 +0100)] 
update TODO

9 months agoREADME: update requirements
Yu Watanabe [Thu, 16 Jan 2025 20:36:11 +0000 (05:36 +0900)] 
README: update requirements

9 months agoudev: set clock group for PTP and RTC devices
Miroslav Lichvar [Thu, 16 Jan 2025 14:34:47 +0000 (15:34 +0100)] 
udev: set clock group for PTP and RTC devices

Add a new group for clock devices to enable applications like linuxptp
to open clocks without root privileges.

9 months agofundamental-macro: conditionalize several gcc warning pragmas 36051/head
Yu Watanabe [Thu, 16 Jan 2025 19:27:36 +0000 (04:27 +0900)] 
fundamental-macro: conditionalize several gcc warning pragmas

This fixes the following error:

In file included from ../src/basic/macro.h:13,
                 from ../src/basic/env-util.h:9,
                 from ../src/nss-systemd/nss-systemd.c:7:
../src/fundamental/macro-fundamental.h:61:9: error: option ‘-Wzero-as-null-pointer-constant’ is valid for C++/ObjC++ but not for C [-Werror=pragmas]
   61 |         _Pragma("GCC diagnostic ignored \"-Wzero-as-null-pointer-constant\"")
      |         ^~~~~~~
../src/nss-systemd/nss-systemd.c:106:1: note: in expansion of macro ‘DISABLE_WARNING_ZERO_AS_NULL_POINTER_CONSTANT’
  106 | DISABLE_WARNING_ZERO_AS_NULL_POINTER_CONSTANT;
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

9 months agonss-systemd: work around -Werror=zero-as-null-pointer-constant issue with PTHREAD_MUT...
Lennart Poettering [Thu, 16 Jan 2025 12:46:18 +0000 (13:46 +0100)] 
nss-systemd: work around -Werror=zero-as-null-pointer-constant issue with PTHREAD_MUTEX_INITIALIZER

This fixes builds on Fedora:

../src/nss-systemd/nss-systemd.c:105:18: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant]
  105 |         .mutex = PTHREAD_MUTEX_INITIALIZER,
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~
../src/nss-systemd/nss-systemd.c:105:18: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant]
../src/nss-systemd/nss-systemd.c:109:18: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant]
  109 |         .mutex = PTHREAD_MUTEX_INITIALIZER,
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~
../src/nss-systemd/nss-systemd.c:109:18: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant]
../src/nss-systemd/nss-systemd.c:113:18: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant]
  113 |         .mutex = PTHREAD_MUTEX_INITIALIZER,
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~
../src/nss-systemd/nss-systemd.c:113:18: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant]
../src/nss-systemd/nss-systemd.c:117:18: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant]
  117 |         .mutex = PTHREAD_MUTEX_INITIALIZER,
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~
../src/nss-systemd/nss-systemd.c:117:18: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant]
cc1: all warnings being treated as errors

9 months agofundamental: unify gcc warning pragmas at one place
Lennart Poettering [Thu, 16 Jan 2025 15:01:56 +0000 (16:01 +0100)] 
fundamental: unify gcc warning pragmas at one place

This also drops HAVE_WSTRINGOP_TRUNCATION as the corresponding option
was introduced in GCC 8, and our baseline is GCC 8.4.

9 months agotest: add link to Ubuntu autopkgtest status page in README
Luca Boccassi [Thu, 16 Jan 2025 13:47:14 +0000 (13:47 +0000)] 
test: add link to Ubuntu autopkgtest status page in README

Known issues will be listed there by the team managing the infra

9 months agoprocess-util: port pid_from_same_root_fs() to pidref + more (#35975)
Lennart Poettering [Thu, 16 Jan 2025 12:48:48 +0000 (13:48 +0100)] 
process-util: port pid_from_same_root_fs() to pidref + more (#35975)

Let's continue our move to PidRef.

9 months agoprocess-util: slightly update comment in freeze() 35975/head
Lennart Poettering [Wed, 15 Jan 2025 16:24:14 +0000 (17:24 +0100)] 
process-util: slightly update comment in freeze()

9 months agoprocess-util: port pid_from_same_root_fs() to pidref, and port three places over...
Lennart Poettering [Mon, 13 Jan 2025 10:09:49 +0000 (11:09 +0100)] 
process-util: port pid_from_same_root_fs() to pidref, and port three places over to it

9 months agotest-process-util: don't run rest of test suite in forked off child
Lennart Poettering [Mon, 13 Jan 2025 10:10:09 +0000 (11:10 +0100)] 
test-process-util: don't run rest of test suite in forked off child

We left the test suite running in the child after forking off a
temporary child for testing. That's bad. fix it.

9 months agoprocess-util: introduce new FORK_FREEZE flag for safe_fork()
Lennart Poettering [Mon, 13 Jan 2025 10:04:19 +0000 (11:04 +0100)] 
process-util: introduce new FORK_FREEZE flag for safe_fork()

Often we want to fork off a process that just hangs until we kill it,
let's add a simple flag to create one of this type, and use it at
various places.

9 months agopidref: various shortcuts to pidref_equal()
Lennart Poettering [Mon, 13 Jan 2025 10:06:27 +0000 (11:06 +0100)] 
pidref: various shortcuts to pidref_equal()

This adds some shortcuts to pidref_equal(), so that we don't have to
query the pidfs id if there's no need.

9 months agotree-wide: drop support for kernels without pidfd_open() and pidfd_send_signal()...
Lennart Poettering [Thu, 16 Jan 2025 10:37:17 +0000 (11:37 +0100)] 
tree-wide: drop support for kernels without pidfd_open() and pidfd_send_signal() (#35971)

9 months agonamespace-util: don't reset UID/GIDs in namespace_enter() unless we enter a userns
Lennart Poettering [Wed, 15 Jan 2025 22:18:39 +0000 (23:18 +0100)] 
namespace-util: don't reset UID/GIDs in namespace_enter() unless we enter a userns

The reset of UID/GID only really makes sense if we enter a userns, hence
let#s restrict it to that.

9 months agoshared/bus-util: add missing `set.h` include
Jan Macku [Wed, 15 Jan 2025 14:06:46 +0000 (15:06 +0100)] 
shared/bus-util: add missing `set.h` include

```
In file included from ../src/shared/bus-get-properties.c:4:
../src/shared/bus-message-util.h:22:60: error: unknown type name ‘Set’
   22 | int bus_message_append_string_set(sd_bus_message *m, const Set *s);
      |                                                            ^~~
../src/shared/bus-get-properties.c: In function ‘bus_property_get_string_set’:
../src/shared/bus-get-properties.c:178:9: error: unknown type name ‘Set’
  178 |         Set **s = ASSERT_PTR(userdata);
      |         ^~~
```

follow-up to https://github.com/systemd/systemd/commit/91080bc9733b5b2478bfc0ed58f6a7ae5da7e639

9 months agoshell-completions: add systemctl sleep
Duncan Overbruck [Thu, 16 Jan 2025 02:51:52 +0000 (03:51 +0100)] 
shell-completions: add systemctl sleep

9 months agomeson: enable -Wzero-as-null-pointer-constant (#36028)
Lennart Poettering [Thu, 16 Jan 2025 06:48:21 +0000 (07:48 +0100)] 
meson: enable -Wzero-as-null-pointer-constant (#36028)

Support for C added in gcc 15:

https://github.com/gcc-mirror/gcc/commit/236c0829ee21a179c81b83f0d7f112ca23c47a4d

9 months agopid1: add GracefulOptions= setting to .mount units (#36023)
Lennart Poettering [Thu, 16 Jan 2025 06:47:08 +0000 (07:47 +0100)] 
pid1: add GracefulOptions= setting to .mount units (#36023)

This new setting can be used to specify mount options that shall only be
added to the mount option string if the kernel supports them.

This shall be used for adding "usrquota" to tmp.mount without breaking
compat, but is generally be useful.

9 months agomeson: enable -Wzero-as-null-pointer-constant 36028/head
Mike Yuan [Wed, 15 Jan 2025 17:41:51 +0000 (18:41 +0100)] 
meson: enable -Wzero-as-null-pointer-constant

Support for C added in gcc 15:
https://github.com/gcc-mirror/gcc/commit/236c0829ee21a179c81b83f0d7f112ca23c47a4d

9 months agotree-wide: remove unnecessary gcc >= 7 version check
Mike Yuan [Wed, 15 Jan 2025 18:16:06 +0000 (19:16 +0100)] 
tree-wide: remove unnecessary gcc >= 7 version check

Our baseline is gcc 8.4.

9 months agoRevert "OBS: build Fedora/Debian/Ubuntu x86_64 packages on PRs"
Luca Boccassi [Thu, 16 Jan 2025 00:42:23 +0000 (00:42 +0000)] 
Revert "OBS: build Fedora/Debian/Ubuntu x86_64 packages on PRs"

This does not work yet, as we configure multiple git sources,
and the workflow service gets confused. We need to update one
(the actual code repo) and leave the recipe repos intact, but
this is not supported right now.

This reverts commit 01f05f0087204914e489057baf12317815325956.

9 months agoOBS: build Fedora/Debian/Ubuntu x86_64 packages on PRs
Luca Boccassi [Wed, 15 Jan 2025 23:45:32 +0000 (23:45 +0000)] 
OBS: build Fedora/Debian/Ubuntu x86_64 packages on PRs

Start with a subset of what is built from main, can be expanded as
needed

9 months agolog: check isempty for object_field and extra_field
hanjinpeng [Tue, 14 Jan 2025 17:10:06 +0000 (01:10 +0800)] 
log: check isempty for object_field and extra_field

9 months agopty_open_peer() follow-up (#36027)
Lennart Poettering [Wed, 15 Jan 2025 20:05:59 +0000 (21:05 +0100)] 
pty_open_peer() follow-up (#36027)

9 months agopid1: add GracefulOptions= setting to .mount units 36023/head
Lennart Poettering [Tue, 14 Jan 2025 15:49:52 +0000 (16:49 +0100)] 
pid1: add GracefulOptions= setting to .mount units

This new setting can be used to specify mount options that shall only be
added to the mount option string if the kernel supports them.

This shall be used for adding "usrquota" to tmp.mount without breaking compat,
but is generally be useful.

9 months agopam-systemd: introduce "user-light" session type, and make "background-light" the...
Lennart Poettering [Wed, 15 Jan 2025 19:55:01 +0000 (20:55 +0100)] 
pam-systemd: introduce "user-light" session type, and make "background-light" the default for system users (#35987)

This implements one idea from #34988: default to "user-light" and
"background-light" for system users, so that the service manager is only
pulled in for sessions that likely need them, i.e. not cron jobs or ftp
logins.

This is a compat break to some degree, but I think a worthy one. I
updated the NEWS file to explain this.

9 months agorandom-util: fix compilation error
Yu Watanabe [Wed, 15 Jan 2025 16:29:04 +0000 (01:29 +0900)] 
random-util: fix compilation error

Fixes the following error:
```
../src/basic/random-util.c: In function "fallback_random_bytes":
../src/basic/random-util.c:45:26: error: initializer-string for array of "char" is too long [-Werror=unterminated-string-initialization]
   45 |                 .label = "systemd fallback random bytes v1",
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
```

9 months agouserdb: optionally parse numeric UIDs/GIDs where a username is expected
Lennart Poettering [Tue, 14 Jan 2025 17:28:27 +0000 (18:28 +0100)] 
userdb: optionally parse numeric UIDs/GIDs where a username is expected

Let's move this logic from userdbctl into generic code so that we can
use it elsewhere.

9 months agoanalyze: fix assignment of object_field
Yu Watanabe [Wed, 15 Jan 2025 15:13:19 +0000 (00:13 +0900)] 
analyze: fix assignment of object_field

Prompted by #36000.

9 months agocurl-util: use curl_getdate instead of implementing http spec
jane400 [Wed, 15 Jan 2025 00:24:20 +0000 (01:24 +0100)] 
curl-util: use curl_getdate instead of implementing http spec

Available since curl 7.1, which is less than the version required in
meson.build

https://curl.se/libcurl/c/curl_getdate.html