]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-device: introduce device_get_sysattr_safe_string()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 11 Mar 2026 20:39:42 +0000 (05:39 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 May 2026 17:55:56 +0000 (02:55 +0900)
commit0341058ee6a237f4990be0825218dfdd4587a0d0
tree11a9eaf230c33f4b7679998f8669b33be8193cfa
parentb74f016e598c2428b55db1b04788e82061f79153
sd-device: introduce device_get_sysattr_safe_string()

This introduce a helper function that verifies read sysattr value.
Some sysattr value may come from firmware, and kernel may expose unsafe
string. The introduced function should be used when we use the result as
a string.
src/libsystemd/sd-device/device-private.h
src/libsystemd/sd-device/sd-device.c
src/libsystemd/sd-device/test-sd-device.c