commit b62e34846f1413467641647444bfaf2d6ed1a498
Author: Jan Safranek <jsafrane@redhat.com>
Date:   Tue Nov 4 12:40:40 2014 +0100

    Introduce new DBus call flag to allow interactive authorization.
    
    DBus has recently introduced new message flag
    DBUS_HEADER_FLAG_ALLOW_INTERACTIVE_AUTHORIZATION, which tells that caller
    is willing to wait for unspecified amount of time for the call to return,
    as the service may perform interactive authorization (e.g. using polkit).
    
    See https://bugs.freedesktop.org/show_bug.cgi?id=83449 for details.
    
    In glib, we add G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION into
    GDBusCallFlags for this purpose.

diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index cd53c96..d20e3c9 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -5361,8 +5361,14 @@ static void
 add_call_flags (GDBusMessage           *message,
                          GDBusCallFlags  flags)
 {
+  GDBusMessageFlags msg_flags = 0;
+
   if (flags & G_DBUS_CALL_FLAGS_NO_AUTO_START)
-    g_dbus_message_set_flags (message, G_DBUS_MESSAGE_FLAGS_NO_AUTO_START);
+    msg_flags |= G_DBUS_MESSAGE_FLAGS_NO_AUTO_START;
+  if (flags & G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION)
+    msg_flags |= G_DBUS_MESSAGE_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION;
+  if (msg_flags)
+    g_dbus_message_set_flags (message, msg_flags);
 }
 
 static GVariant *
diff --git a/gio/gioenums.h b/gio/gioenums.h
index 1ca5be5..6e025eb 100644
--- a/gio/gioenums.h
+++ b/gio/gioenums.h
@@ -1185,6 +1185,8 @@ typedef enum {
  * @G_DBUS_CALL_FLAGS_NO_AUTO_START: The bus must not launch
  * an owner for the destination name in response to this method
  * invocation.
+ * @G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION: the caller is prepared to
+ * wait for interactive authorization.
  *
  * Flags used in g_dbus_connection_call() and similar APIs.
  *
@@ -1192,7 +1194,8 @@ typedef enum {
  */
 typedef enum {
   G_DBUS_CALL_FLAGS_NONE = 0,
-  G_DBUS_CALL_FLAGS_NO_AUTO_START = (1<<0)
+  G_DBUS_CALL_FLAGS_NO_AUTO_START = (1<<0),
+  G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION = (1<<1)
 } GDBusCallFlags;
 /* (1<<31) is reserved for internal use by GDBusConnection, do not use it. */
 
@@ -1222,6 +1225,9 @@ typedef enum {
  * @G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED: A reply is not expected.
  * @G_DBUS_MESSAGE_FLAGS_NO_AUTO_START: The bus must not launch an
  * owner for the destination name in response to this message.
+ * @G_DBUS_MESSAGE_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION: If set on a method
+ * call, this flag means that the caller is prepared to wait for interactive
+ * authorization.
  *
  * Message flags used in #GDBusMessage.
  *
@@ -1230,7 +1236,8 @@ typedef enum {
 typedef enum {
   G_DBUS_MESSAGE_FLAGS_NONE = 0,
   G_DBUS_MESSAGE_FLAGS_NO_REPLY_EXPECTED = (1<<0),
-  G_DBUS_MESSAGE_FLAGS_NO_AUTO_START = (1<<1)
+  G_DBUS_MESSAGE_FLAGS_NO_AUTO_START = (1<<1),
+  G_DBUS_MESSAGE_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION = (1<<2)
 } GDBusMessageFlags;
 
 /**
