]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
9 months agorun: add --job-mode= argument 34708/head
Gavin Li [Thu, 10 Oct 2024 20:07:16 +0000 (16:07 -0400)] 
run: add --job-mode= argument

systemctl has a --job-mode= argument, and adding the same argument to
systemd-run is useful for starting transient scopes with dependencies.
For example, if a transient scope BindsTo a service that is stopping,
specifying --job-mode=replace will wait for the service to stop before
starting it again, while the default job mode of "fail" will cause the
systemd-run invocation to fail.

9 months agobasic: move JobMode from core
Gavin Li [Fri, 3 Jan 2025 05:46:39 +0000 (00:46 -0500)] 
basic: move JobMode from core

The JobMode string table functions can be used by utilities for argument
validation.

9 months agomeasure: add policy-digest verb
Luca Boccassi [Sun, 19 Jan 2025 22:50:53 +0000 (22:50 +0000)] 
measure: add policy-digest verb

When doing offline signing we need to know the exact payload
to sign, and the 'calculate' verb doesn't really show that, it
shows the PCR values. But what we sign is the hash of the policy.
So add a new verb that outputs the json payload that goes in the
.pcrsig section, without the .sig object, so that we can take them
and give the .pol object to an offline and asynchronous signing
service, such as SUSE's Open Build Service, and then add the .sig
object to the json and attach it to a UKI.

9 months agopidfd: cache our own pidfd inode id, and use it at various places (#36060)
Mike Yuan [Mon, 20 Jan 2025 23:16:12 +0000 (00:16 +0100)] 
pidfd: cache our own pidfd inode id, and use it at various places (#36060)

This is split out of and preparation for #35224, but makes a ton of
sense on its own

9 months agoukify: print debug/progress messages to stderr and pass through --json to systemd...
Luca Boccassi [Mon, 20 Jan 2025 21:34:59 +0000 (21:34 +0000)] 
ukify: print debug/progress messages to stderr and pass through --json to systemd-measure (#36081)

9 months agoudev: allow to enable trace logging in systemd-udevd (#36070)
Lennart Poettering [Mon, 20 Jan 2025 21:02:13 +0000 (22:02 +0100)] 
udev: allow to enable trace logging in systemd-udevd (#36070)

split out of #35968.

9 months agoupdate TODO 36060/head
Lennart Poettering [Fri, 17 Jan 2025 13:54:24 +0000 (14:54 +0100)] 
update TODO

9 months agonotify: add support for MANAGERPIDFDID
Lennart Poettering [Sun, 19 Jan 2025 20:43:43 +0000 (21:43 +0100)] 
notify: add support for MANAGERPIDFDID

9 months agopid1: pass pidfdids to invoked services in $MAINPIDFDID and $MANAGERPIDFDID
Lennart Poettering [Fri, 17 Jan 2025 13:09:53 +0000 (14:09 +0100)] 
pid1: pass pidfdids to invoked services in $MAINPIDFDID and $MANAGERPIDFDID

9 months agorandom-util: include pidfdid in fallback RNG buffer
Lennart Poettering [Mon, 18 Nov 2024 10:23:26 +0000 (11:23 +0100)] 
random-util: include pidfdid in fallback RNG buffer

This doesn't make the RNG cryptographic strength, but if we have it
easily accessible, why not include the pidfd id. It is after all not
vulnerable to reuse.

9 months agopidref: now that we have the cached pidfdid of our own process, use it
Lennart Poettering [Fri, 17 Jan 2025 13:02:08 +0000 (14:02 +0100)] 
pidref: now that we have the cached pidfdid of our own process, use it

Note that this drops a lot of "const" qualifiers on PidRef arguments.
That's because pidref_is_self() suddenly might end changing the PidRef
because it acquires the pidfd ID.

We had this previously already with pidfd_equal(), but this amplifies
the problem.

I guess we C's "const" doesn't really work for stuff that contains
caches, that is just conceptually constant, but not actually.

9 months agopidfd-util: add helper for getting our own pidfdid
Lennart Poettering [Mon, 18 Nov 2024 10:23:07 +0000 (11:23 +0100)] 
pidfd-util: add helper for getting our own pidfdid

let's start caching our own pidfd id, since it's somewhat involved to
get but a much better identifier for things than the classic PID is.

9 months agopidfd-util: dont open a new pidfd unnecessarily in pidfd_check_pidfs()
Lennart Poettering [Fri, 17 Jan 2025 13:01:30 +0000 (14:01 +0100)] 
pidfd-util: dont open a new pidfd unnecessarily in pidfd_check_pidfs()

9 months agobuild: fail the build if we accidentally drop a "const" qualifier on a parameter
Lennart Poettering [Fri, 17 Jan 2025 13:47:34 +0000 (14:47 +0100)] 
build: fail the build if we accidentally drop a "const" qualifier on a parameter

let's be strict here, our codebase allows it.

9 months agomachine-id-setup: move code to use chase() (#35979)
Lennart Poettering [Mon, 20 Jan 2025 20:18:24 +0000 (21:18 +0100)] 
machine-id-setup: move code to use chase() (#35979)

I just wanted to switch the machine id setup code to use chase() or its
changes, given it supports --root=/--image= operation. That turned out
to be a rabbit hole, and became much bigger...

9 months agocryptsetup and friends: use dispatch_verb() (#36072)
Lennart Poettering [Mon, 20 Jan 2025 20:17:01 +0000 (21:17 +0100)] 
cryptsetup and friends: use dispatch_verb() (#36072)

9 months agonspawn: downgrade log message about usrquota to debug
Luca Boccassi [Mon, 20 Jan 2025 19:05:11 +0000 (19:05 +0000)] 
nspawn: downgrade log message about usrquota to debug

This is shown every time nspawn is started, which is annoying
and there's nothing a user can do about it, since it depends on
an extremely new kernel. Downgrade to debug.

Follow-up for 611ae598889471830b2f1d7251c271b79884b1c4

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 agointegritysetup: use dispatch_verb() 36072/head
Yu Watanabe [Sat, 18 Jan 2025 20:17:14 +0000 (05:17 +0900)] 
integritysetup: use dispatch_verb()

9 months agoveritysetup: use dispatch_verb()
Yu Watanabe [Sat, 18 Jan 2025 20:10:04 +0000 (05:10 +0900)] 
veritysetup: use dispatch_verb()

9 months agocryptsetup: use dispatch_verb()
Yu Watanabe [Sat, 18 Jan 2025 19:58:54 +0000 (04:58 +0900)] 
cryptsetup: use dispatch_verb()

9 months agocryptsetup: drop doubled space
Yu Watanabe [Sat, 18 Jan 2025 19:42:31 +0000 (04:42 +0900)] 
cryptsetup: drop doubled space

9 months agocryptsetup: use mangle_none() at one more place
Yu Watanabe [Sat, 18 Jan 2025 19:42:20 +0000 (04:42 +0900)] 
cryptsetup: use mangle_none() at one more place

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 agoupdate TODO 35979/head
Lennart Poettering [Mon, 20 Jan 2025 10:30:32 +0000 (11:30 +0100)] 
update TODO

9 months agochase: move appending of trailing slash out of loop
Lennart Poettering [Mon, 13 Jan 2025 12:20:29 +0000 (13:20 +0100)] 
chase: move appending of trailing slash out of loop

let's move final processing of the filename out of the loop, and apply
it in all cases, uniformly, even if we are asked to only return the
final filename.

9 months agochase: introduce flags that verify that chased inode is regular file or dir
Lennart Poettering [Mon, 13 Jan 2025 12:12:23 +0000 (13:12 +0100)] 
chase: introduce flags that verify that chased inode is regular file or dir

This also implies the new CHASE_MUST_BE_DIRECTORY flag in case the
specified path ends in a slash. This makes the rules stricter, it means
we'll be closer to how this is handled in kernel: if a path ends in a
slash it can never refer to a non-directory.

9 months agomachine-id-setup: rework writing of /etc/machine-id around chase()
Lennart Poettering [Mon, 13 Jan 2025 11:09:03 +0000 (12:09 +0100)] 
machine-id-setup: rework writing of /etc/machine-id around chase()

Let's make sure we properly stay inside of the root fs if one is
provided, i.e. stop using prefix_roota() at one more place.

9 months agomachine-id-setup: remove unnecessary 'else'
Lennart Poettering [Mon, 13 Jan 2025 11:19:18 +0000 (12:19 +0100)] 
machine-id-setup: remove unnecessary 'else'

9 months agomachine-id-setup: rework --commit based on chase()
Lennart Poettering [Sat, 11 Jan 2025 23:17:03 +0000 (00:17 +0100)] 
machine-id-setup: rework --commit based on chase()

9 months agomachine-id-setup: do sync() stuff only when operating on the real rootfs
Lennart Poettering [Thu, 16 Jan 2025 09:22:39 +0000 (10:22 +0100)] 
machine-id-setup: do sync() stuff only when operating on the real rootfs

If we operate relative some explicit rootfs the reason for the sync()ing
is not really given, we are not really acting as a milestone at boot,
but "offline".

9 months agomachine-id-setup: rearrange --help to match how we do them these days
Lennart Poettering [Wed, 15 Jan 2025 20:58:31 +0000 (21:58 +0100)] 
machine-id-setup: rearrange --help to match how we do them these days

9 months agochase: use streq() not path_equal() to compare filenames
Lennart Poettering [Mon, 13 Jan 2025 11:56:57 +0000 (12:56 +0100)] 
chase: use streq() not path_equal() to compare filenames

9 months agochase: allow using chase() as mkdir_p() replacement
Lennart Poettering [Mon, 13 Jan 2025 11:53:54 +0000 (12:53 +0100)] 
chase: allow using chase() as mkdir_p() replacement

This allows using CHASE_MKDIR_0755 without CHASE_NONEXISTENT or
CHASE_PARENT, so that it will create the final component of the path
too should it be missing.

This is really useful as a mkdir_p() replacement that returns an fd to
the final component, and knows how to operate relative to a root fs.

Kinda reverts 4ea0bcb9229fe12e0c428659d76934351b821872 (which only
refused the flags combination which didn't work, instead of making it
work, which is what this commit does.)

This also corrects behaviour if CHASE_MKDIR_0755 is used in one more
way: we'll now always open the dir as O_PATH. This is generally the
better idea, but matters in particular once with allow using
CHASE_MKDIR_0755 to create the final component: we should uniformly
return an O_PATH dir that must be converted to a proper fd first before
using it.

9 months agomount-util: introduce umountat_detach_verbose()
Lennart Poettering [Thu, 16 Jan 2025 09:17:44 +0000 (10:17 +0100)] 
mount-util: introduce umountat_detach_verbose()

This new helper allows unmounting paths by fd.

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 agoukify: print debug/progress messages to stderr 36081/head
Luca Boccassi [Sun, 19 Jan 2025 15:42:47 +0000 (15:42 +0000)] 
ukify: print debug/progress messages to stderr

Otherwise json will be interleaved with plain text messages

9 months agoukify: pass through --json to systemd-measure
Luca Boccassi [Sun, 19 Jan 2025 15:43:14 +0000 (15:43 +0000)] 
ukify: pass through --json to systemd-measure

So that --measure --json prints usable json output

9 months agolinter: run ruff format --diff so that the needed changes are actually printed
Luca Boccassi [Sun, 19 Jan 2025 15:58:47 +0000 (15:58 +0000)] 
linter: run ruff format --diff so that the needed changes are actually printed

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()