find-esp: change "unprivileged_mode" parameter to be tristate
authorLennart Poettering <lennart@poettering.net>
Wed, 31 May 2023 07:32:52 +0000 (09:32 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 31 May 2023 08:12:47 +0000 (10:12 +0200)
commit0b2aa2064f93cc154e704b262713de4fc395ce56
tree6c2dfbf4691ef53663bce2f5c1128a3dd467e2ae
parent40fb9eebbc075ce1e63100386d2c5f177ad7d738
find-esp: change "unprivileged_mode" parameter to be tristate

Previously, unprivileged mode for find_esp_and_warn() and
find_xbootldr_and_warn() could be enabled or disabled. With this change
it can also be set to negative in which case the functions will enable
it automatically if found to be executing without privileges.

This just moves te geteuid() check we often do for the param inside of
the functions.

At the same time internally in the functions we also pass around the
VerifyESPFlags field across the various functions instead of booleans.

Both changes are just refactoring. No changes in behaviour.
src/boot/bootctl-status.c
src/boot/bootctl.c
src/boot/bootctl.h
src/shared/find-esp.c
src/shared/find-esp.h