</method>
<method name="RegisterAuthenticationAgent">
- <annotation name="org.gtk.EggDBus.DocString" value="Register an authentication agent."/>
+ <annotation name="org.gtk.EggDBus.DocString" value="<para>Register an authentication agent.</para><para>Note that current versions of PolicyKit will only work if @session_id is set to the empty string. In the future it might work for non-empty strings if the caller is sufficiently privileged.</para>"/>
+
+ <arg name="session_id" direction="in" type="s">
+ <annotation name="org.gtk.EggDBus.DocString" value="The session to register the authentication for or blank for the session the caller of the method is in."/>
+ </arg>
<arg name="object_path" direction="in" type="s">
<annotation name="org.gtk.EggDBus.DocString" value="The object path of authentication agent object on the unique name of the caller."/>
<method name="UnregisterAuthenticationAgent">
<annotation name="org.gtk.EggDBus.DocString" value="Unregister an authentication agent."/>
+ <arg name="session_id" direction="in" type="s">
+ <annotation name="org.gtk.EggDBus.DocString" value="The session identifier passed to org.freedesktop.PolicyKit1.Authority.RegisterAuthenticationAgent()."/>
+ </arg>
+
<arg name="object_path" direction="in" type="s">
<annotation name="org.gtk.EggDBus.DocString" value="The object path of authentication agent object on the unique name of the caller."/>
</arg>
static guint
polkit_authority_register_authentication_agent_async (PolkitAuthority *authority,
+ const gchar *session_id,
const gchar *object_path,
GCancellable *cancellable,
GAsyncReadyCallback callback,
call_id = _polkit_authority_register_authentication_agent (authority->real,
EGG_DBUS_CALL_FLAGS_NONE,
+ session_id,
object_path,
cancellable,
generic_async_cb,
/**
* polkit_authority_register_authentication_agent:
* @authority: A #PolkitAuthority.
+ * @session_id: The identifier of the session to register for or %NULL for the session of the caller.
* @object_path: The object path for the authentication agent.
* @cancellable: A #GCancellable or %NULL.
* @callback: A #GAsyncReadyCallback to call when the request is satisfied.
**/
void
polkit_authority_register_authentication_agent (PolkitAuthority *authority,
+ const gchar *session_id,
const gchar *object_path,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
polkit_authority_register_authentication_agent_async (authority,
+ session_id,
object_path,
cancellable,
callback,
/**
* polkit_authority_register_authentication_agent_sync:
* @authority: A #PolkitAuthority.
+ * @session_id: The identifier of the session to register for or %NULL for the session of the caller.
* @object_path: The object path for the authentication agent.
* @cancellable: A #GCancellable or %NULL.
* @error: Return location for error or %NULL.
**/
gboolean
polkit_authority_register_authentication_agent_sync (PolkitAuthority *authority,
+ const gchar *session_id,
const gchar *object_path,
GCancellable *cancellable,
GError **error)
gboolean ret;
call_id = polkit_authority_register_authentication_agent_async (authority,
+ session_id,
object_path,
cancellable,
generic_cb,
static guint
polkit_authority_unregister_authentication_agent_async (PolkitAuthority *authority,
+ const gchar *session_id,
const gchar *object_path,
GCancellable *cancellable,
GAsyncReadyCallback callback,
polkit_authority_unregister_authentication_agent_async);
call_id = _polkit_authority_unregister_authentication_agent (authority->real,
- EGG_DBUS_CALL_FLAGS_NONE,
- object_path,
- cancellable,
- generic_async_cb,
- simple);
+ EGG_DBUS_CALL_FLAGS_NONE,
+ session_id,
+ object_path,
+ cancellable,
+ generic_async_cb,
+ simple);
return call_id;
}
/**
* polkit_authority_unregister_authentication_agent:
* @authority: A #PolkitAuthority.
+ * @session_id: The identifier of the session the agent is registered at or %NULL for the session of the caller.
* @object_path: The object path that the authentication agent is registered at.
* @cancellable: A #GCancellable or %NULL.
* @callback: A #GAsyncReadyCallback to call when the request is satisfied.
**/
void
polkit_authority_unregister_authentication_agent (PolkitAuthority *authority,
+ const gchar *session_id,
const gchar *object_path,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
polkit_authority_unregister_authentication_agent_async (authority,
- object_path,
- cancellable,
- callback,
- user_data);
+ session_id,
+ object_path,
+ cancellable,
+ callback,
+ user_data);
}
/**
/**
* polkit_authority_unregister_authentication_agent_sync:
* @authority: A #PolkitAuthority.
+ * @session_id: The identifier of the session the agent is registered at or %NULL for the session of the caller.
* @object_path: The object path that the authentication agent is registered at.
* @cancellable: A #GCancellable or %NULL.
* @error: Return location for error or %NULL.
**/
gboolean
polkit_authority_unregister_authentication_agent_sync (PolkitAuthority *authority,
+ const gchar *session_id,
const gchar *object_path,
GCancellable *cancellable,
GError **error)
gboolean ret;
call_id = polkit_authority_unregister_authentication_agent_async (authority,
+ session_id,
object_path,
cancellable,
generic_cb,
GError **error);
gboolean polkit_authority_register_authentication_agent_sync (PolkitAuthority *authority,
+ const gchar *session_id,
const gchar *object_path,
GCancellable *cancellable,
GError **error);
gboolean polkit_authority_unregister_authentication_agent_sync (PolkitAuthority *authority,
+ const gchar *session_id,
const gchar *object_path,
GCancellable *cancellable,
GError **error);
void polkit_authority_register_authentication_agent (PolkitAuthority *authority,
+ const gchar *session_id,
const gchar *object_path,
GCancellable *cancellable,
GAsyncReadyCallback callback,
GError **error);
void polkit_authority_unregister_authentication_agent (PolkitAuthority *authority,
+ const gchar *session_id,
const gchar *object_path,
GCancellable *cancellable,
GAsyncReadyCallback callback,
ret = FALSE;
local_error = NULL;
- /* TODO: also pass server->session_id */
if (!polkit_authority_register_authentication_agent_sync (server->authority,
+ server->session_id,
server->object_path,
NULL,
&local_error))
error = NULL;
if (!polkit_authority_unregister_authentication_agent_sync (server->authority,
+ server->session_id,
server->object_path,
NULL,
&error))
* polkit_backend_authority_register_authentication_agent:
* @authority: A #PolkitBackendAuthority.
* @caller: The system bus name that initiated the query.
+ * @session_id: The identifier of the session to register for or %NULL for the session of the caller.
* @object_path: The object path for the authentication agent.
* @error: Return location for error or %NULL.
*
gboolean
polkit_backend_authority_register_authentication_agent (PolkitBackendAuthority *authority,
PolkitSubject *caller,
+ const gchar *session_id,
const gchar *object_path,
GError **error)
{
}
else
{
- return klass->register_authentication_agent (authority, caller, object_path, error);
+ return klass->register_authentication_agent (authority, caller, session_id, object_path, error);
}
}
* polkit_backend_authority_unregister_authentication_agent:
* @authority: A #PolkitBackendAuthority.
* @caller: The system bus name that initiated the query.
+ * @session_id: The identifier of the session the agent is registered at or %NULL for the session of the caller.
* @object_path: The object path that the authentication agent is registered at.
* @error: Return location for error or %NULL.
*
gboolean
polkit_backend_authority_unregister_authentication_agent (PolkitBackendAuthority *authority,
PolkitSubject *caller,
+ const gchar *session_id,
const gchar *object_path,
GError **error)
{
}
else
{
- return klass->unregister_authentication_agent (authority, caller, object_path, error);
+ return klass->unregister_authentication_agent (authority, caller, session_id, object_path, error);
}
}
static void
authority_handle_register_authentication_agent (_PolkitAuthority *instance,
+ const gchar *session_id,
const gchar *object_path,
EggDBusMethodInvocation *method_invocation)
{
error = NULL;
if (!polkit_backend_authority_register_authentication_agent (server->authority,
caller,
+ session_id,
object_path,
&error))
{
static void
authority_handle_unregister_authentication_agent (_PolkitAuthority *instance,
+ const gchar *session_id,
const gchar *object_path,
EggDBusMethodInvocation *method_invocation)
{
error = NULL;
if (!polkit_backend_authority_unregister_authentication_agent (server->authority,
caller,
+ session_id,
object_path,
&error))
{
gboolean (*register_authentication_agent) (PolkitBackendAuthority *authority,
PolkitSubject *caller,
+ const gchar *session_id,
const gchar *object_path,
GError **error);
gboolean (*unregister_authentication_agent) (PolkitBackendAuthority *authority,
PolkitSubject *caller,
+ const gchar *session_id,
const gchar *object_path,
GError **error);
gboolean polkit_backend_authority_register_authentication_agent (PolkitBackendAuthority *authority,
PolkitSubject *caller,
+ const gchar *session_id,
const gchar *object_path,
GError **error);
gboolean polkit_backend_authority_unregister_authentication_agent (PolkitBackendAuthority *authority,
PolkitSubject *caller,
+ const gchar *session_id,
const gchar *object_path,
GError **error);
static gboolean polkit_backend_local_authority_register_authentication_agent (PolkitBackendAuthority *authority,
PolkitSubject *caller,
+ const gchar *session_id,
const gchar *object_path,
GError **error);
static gboolean polkit_backend_local_authority_unregister_authentication_agent (PolkitBackendAuthority *authority,
PolkitSubject *caller,
+ const gchar *session_id,
const gchar *object_path,
GError **error);
static gboolean
polkit_backend_local_authority_register_authentication_agent (PolkitBackendAuthority *authority,
PolkitSubject *caller,
+ const gchar *session_id,
const gchar *object_path,
GError **error)
{
local_authority = POLKIT_BACKEND_LOCAL_AUTHORITY (authority);
priv = POLKIT_BACKEND_LOCAL_AUTHORITY_GET_PRIVATE (local_authority);
+ if (session_id != NULL && strlen (session_id) > 0)
+ {
+ g_set_error (error,
+ POLKIT_ERROR,
+ POLKIT_ERROR_FAILED,
+ "The session_id parameter must be blank for now.");
+ goto out;
+ }
+
session_for_caller = polkit_backend_session_monitor_get_session_for_subject (priv->session_monitor,
caller,
NULL);
static gboolean
polkit_backend_local_authority_unregister_authentication_agent (PolkitBackendAuthority *authority,
PolkitSubject *caller,
+ const gchar *session_id,
const gchar *object_path,
GError **error)
{
ret = FALSE;
+ if (session_id != NULL && strlen (session_id) > 0)
+ {
+ g_set_error (error,
+ POLKIT_ERROR,
+ POLKIT_ERROR_FAILED,
+ "The session_id parameter must be blank for now.");
+ goto out;
+ }
+
session_for_caller = polkit_backend_session_monitor_get_session_for_subject (priv->session_monitor,
caller,
NULL);