From: Valentin David Date: Sat, 26 Jul 2025 10:36:18 +0000 (+0200) Subject: pcrlock: Return positive exit status X-Git-Tag: v258-rc2~70 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5e2ad03dd8119b724a742efb952651cde58ec96d;p=thirdparty%2Fsystemd.git pcrlock: Return positive exit status Follow-up for 89e83aada829a6d92e29f321168d2bb1462c678d. `is-supported` expects to return a positive exit status. To achieve that, verb_make_policy() needs to return 0 on success. Finishes the fix for #38019. Co-authored-by: Yu Watanabe --- diff --git a/src/pcrlock/pcrlock.c b/src/pcrlock/pcrlock.c index 9926720127c..72f02229010 100644 --- a/src/pcrlock/pcrlock.c +++ b/src/pcrlock/pcrlock.c @@ -4846,7 +4846,13 @@ static int make_policy(bool force, RecoveryPinMode recovery_pin_mode) { } static int verb_make_policy(int argc, char *argv[], void *userdata) { - return make_policy(arg_force, arg_recovery_pin); + int r; + + r = make_policy(arg_force, arg_recovery_pin); + if (r < 0) + return r; + + return 0; } static int undefine_policy_nv_index( @@ -5454,4 +5460,4 @@ static int run(int argc, char *argv[]) { return pcrlock_main(argc, argv); } -DEFINE_MAIN_FUNCTION(run); +DEFINE_MAIN_FUNCTION_WITH_POSITIVE_FAILURE(run);