summaryrefslogtreecommitdiffstats
path: root/debian/patches/bus-util-treat-org.freedesktop.DBus.Error.ServiceUnknown-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/bus-util-treat-org.freedesktop.DBus.Error.ServiceUnknown-.patch')
-rw-r--r--debian/patches/bus-util-treat-org.freedesktop.DBus.Error.ServiceUnknown-.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/debian/patches/bus-util-treat-org.freedesktop.DBus.Error.ServiceUnknown-.patch b/debian/patches/bus-util-treat-org.freedesktop.DBus.Error.ServiceUnknown-.patch
new file mode 100644
index 0000000..ffd349f
--- /dev/null
+++ b/debian/patches/bus-util-treat-org.freedesktop.DBus.Error.ServiceUnknown-.patch
@@ -0,0 +1,34 @@
+From: Yu Watanabe <watanabe.yu+github@gmail.com>
+Date: Thu, 4 Apr 2019 13:35:29 +0900
+Subject: bus-util: treat org.freedesktop.DBus.Error.ServiceUnknown nicely
+ when polkit does not exist
+
+Fixes #12209.
+
+(cherry picked from commit 8c69fe79df6394f6b8b8d0bb536a265caf417868)
+(cherry picked from commit 0bb488b22144aeb87d93e97123f71babe116261f)
+---
+ src/shared/bus-util.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
+index 9d31fba..a406dd8 100644
+--- a/src/shared/bus-util.c
++++ b/src/shared/bus-util.c
+@@ -410,14 +410,14 @@ int bus_verify_polkit_async(
+ if (sd_bus_message_is_method_error(q->reply, NULL)) {
+ const sd_bus_error *e;
+
+- /* Copy error from polkit reply */
+ e = sd_bus_message_get_error(q->reply);
+- sd_bus_error_copy(error, e);
+
+ /* Treat no PK available as access denied */
+ if (sd_bus_error_has_name(e, SD_BUS_ERROR_SERVICE_UNKNOWN))
+ return -EACCES;
+
++ /* Copy error from polkit reply */
++ sd_bus_error_copy(error, e);
+ return -sd_bus_error_get_errno(e);
+ }
+