]> git.ipfire.org Git - thirdparty/systemd.git/commit
parse-util: Add parse_capability_set()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 29 Oct 2025 21:39:48 +0000 (22:39 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 1 Nov 2025 19:47:21 +0000 (04:47 +0900)
commit10e82fde7b01e42aedbbfa978a7bfca47f21d341
tree3c108984077b0c2da82421ee698f45b213e6fd25
parent1a3b3c57c6ad140befb43c8d239d546d8925dd3b
parse-util: Add parse_capability_set()

Let's extract common capability parsing code into a generic function
parse_capability_set() with a comprehensive set of unit tests.

We also replace usages of UINT64_MAX with CAP_MASK_UNSET where
applicable and replace the default value of CapabilityBoundingSet
with CAP_MASK_ALL which more clearly identifies that it is initialized
to all capabilities.

AI (copilot) was used to extract the generic function and write the
unit tests, with manual review and fixing afterwards to make sure
everything was correct.
12 files changed:
src/analyze/analyze-security.c
src/basic/parse-util.c
src/basic/parse-util.h
src/core/execute.c
src/core/load-fragment.c
src/core/main.c
src/home/homectl.c
src/login/pam_systemd.c
src/nspawn/nspawn-oci.c
src/nspawn/nspawn.c
src/shared/user-record-show.c
src/test/test-parse-util.c