creds-util: fix "weak" vs. "secure" display for tmpfs/noswap backed credentials
authorLennart Poettering <lennart@poettering.net>
Wed, 12 Jun 2024 10:11:50 +0000 (12:11 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 12 Jun 2024 15:25:55 +0000 (16:25 +0100)
commit2af17b5e4c1aa67ed5bcaa105a2a36d4fac9061a
tree2f17a99956d9b76ff0aa196e95daaa718938f3de
parentbde35f4a91663ebb854330f582baeef0f9adcbfb
creds-util: fix "weak" vs. "secure" display for tmpfs/noswap backed credentials

When we display passed credentials we show a brief safety level based on
how the credential is pass in: if it's backed by swappable memory we
give it a "weak" level. This check was so far done by checking if the
file is backed by ramfs. However, since
1155f44f48f8fd59c863d71b3938e34a0b2fec2a we actually prefer tmpfs with
the new "noswap" option for this.

Hence, fix this, and explicitly look for "noswap" among the mount
options in case we detect tmpfs.
src/creds/creds.c
src/creds/meson.build