From: Lennart Poettering Date: Tue, 16 Jan 2024 12:27:32 +0000 (+0100) Subject: bus-polkit: don't return positive in varlink_verify_polkit_async() just because we... X-Git-Tag: v256-rc1~1144^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e96202fa5da8292b6ff5b3845ed53672d69b1055;p=thirdparty%2Fsystemd.git bus-polkit: don't return positive in varlink_verify_polkit_async() just because we already sent an error reply A positive return value means "access granted", hence if we already reply to the method call don't accidentally return positive. Follow-up for: d04c1a1c8e7c95daa483d8d52d5fc4c25fbc67f2 --- diff --git a/src/shared/bus-polkit.c b/src/shared/bus-polkit.c index 1043d33b5e6..d05c474e7f0 100644 --- a/src/shared/bus-polkit.c +++ b/src/shared/bus-polkit.c @@ -747,10 +747,9 @@ int varlink_verify_polkit_async( if (r < 0) { /* Reply with a nice error */ if (sd_bus_error_has_name(&error, SD_BUS_ERROR_INTERACTIVE_AUTHORIZATION_REQUIRED)) - return varlink_error(link, VARLINK_ERROR_INTERACTIVE_AUTHENTICATION_REQUIRED, NULL); - - if (ERRNO_IS_NEG_PRIVILEGE(r)) - return varlink_error(link, VARLINK_ERROR_PERMISSION_DENIED, NULL); + (void) varlink_error(link, VARLINK_ERROR_INTERACTIVE_AUTHENTICATION_REQUIRED, NULL); + else if (ERRNO_IS_NEG_PRIVILEGE(r)) + (void) varlink_error(link, VARLINK_ERROR_PERMISSION_DENIED, NULL); return r; }