summaryrefslogtreecommitdiffstats
path: root/src/shared/bus-polkit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/bus-polkit.c')
-rw-r--r--src/shared/bus-polkit.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/shared/bus-polkit.c b/src/shared/bus-polkit.c
index 0382d0b..58cffb6 100644
--- a/src/shared/bus-polkit.c
+++ b/src/shared/bus-polkit.c
@@ -786,11 +786,13 @@ int varlink_verify_polkit_async_full(
if (r != 0)
log_debug("Found matching previous polkit authentication for '%s'.", action);
if (r < 0) {
- /* Reply with a nice error */
- if (sd_bus_error_has_name(&error, SD_BUS_ERROR_INTERACTIVE_AUTHORIZATION_REQUIRED))
- (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);
+ if (!FLAGS_SET(flags, POLKIT_DONT_REPLY)) {
+ /* Reply with a nice error */
+ if (sd_bus_error_has_name(&error, SD_BUS_ERROR_INTERACTIVE_AUTHORIZATION_REQUIRED))
+ (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;
}