mirror of
https://gitlab.freedesktop.org/libfprint/fprintd.git
synced 2026-05-09 02:28:19 +02:00
device: Only interactively authorize if requested to do so
DBus sends a flags for whether interactive authorization is desired. Adher to it instead of just assuming we can go ahead with doing an interactive authoritzation.
This commit is contained in:
parent
b54a007ccf
commit
397995055c
1 changed files with 7 additions and 1 deletions
|
|
@ -819,6 +819,8 @@ _fprint_device_check_polkit_for_action (FprintDevice *rdev,
|
|||
GError **error)
|
||||
{
|
||||
FprintDevicePrivate *priv = fprint_device_get_instance_private (rdev);
|
||||
PolkitCheckAuthorizationFlags flags = POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE;
|
||||
GDBusMessage *message;
|
||||
const char *sender;
|
||||
|
||||
g_autoptr(GError) local_error = NULL;
|
||||
|
|
@ -829,11 +831,15 @@ _fprint_device_check_polkit_for_action (FprintDevice *rdev,
|
|||
sender = g_dbus_method_invocation_get_sender (invocation);
|
||||
subject = polkit_system_bus_name_new (sender);
|
||||
|
||||
message = g_dbus_method_invocation_get_message (invocation);
|
||||
if (g_dbus_message_get_flags (message) & G_DBUS_MESSAGE_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION)
|
||||
flags |= POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION;
|
||||
|
||||
result = polkit_authority_check_authorization_sync (priv->auth,
|
||||
subject,
|
||||
action,
|
||||
NULL,
|
||||
POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION,
|
||||
flags,
|
||||
NULL, &local_error);
|
||||
if (result == NULL)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue