mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02:00
device: Throw an error if we failed to delete a device storage print
Although this error is not fatal as the local print reference has been properly removed.
This commit is contained in:
16
src/device.c
16
src/device.c
@ -1863,6 +1863,7 @@ delete_enrolled_fingers (FprintDevice *rdev,
|
|||||||
FpFinger finger,
|
FpFinger finger,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
|
g_autoptr(GError) device_error = NULL;
|
||||||
FprintDevicePrivate *priv = fprint_device_get_instance_private (rdev);
|
FprintDevicePrivate *priv = fprint_device_get_instance_private (rdev);
|
||||||
guint i;
|
guint i;
|
||||||
int r;
|
int r;
|
||||||
@ -1910,6 +1911,14 @@ delete_enrolled_fingers (FprintDevice *rdev,
|
|||||||
{
|
{
|
||||||
g_warning ("Error deleting print from device: %s", local_error->message);
|
g_warning ("Error deleting print from device: %s", local_error->message);
|
||||||
g_warning ("This might indicate an issue in the libfprint driver or in the fingerprint device.");
|
g_warning ("This might indicate an issue in the libfprint driver or in the fingerprint device.");
|
||||||
|
|
||||||
|
if (!device_error)
|
||||||
|
{
|
||||||
|
g_set_error (&device_error, FPRINT_ERROR,
|
||||||
|
FPRINT_ERROR_PRINTS_NOT_DELETED_FROM_DEVICE,
|
||||||
|
"Failed to delete print from device storage: %s",
|
||||||
|
local_error->message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1956,6 +1965,13 @@ delete_enrolled_fingers (FprintDevice *rdev,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (device_error)
|
||||||
|
{
|
||||||
|
/* This is a low priority error, higher priority errors would have returned failure already */
|
||||||
|
g_propagate_error (error, g_steal_pointer (&device_error));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
<!ENTITY ERROR_NO_ACTION_IN_PROGRESS "net.reactivated.Fprint.Error.NoActionInProgress">
|
<!ENTITY ERROR_NO_ACTION_IN_PROGRESS "net.reactivated.Fprint.Error.NoActionInProgress">
|
||||||
<!ENTITY ERROR_INVALID_FINGERNAME "net.reactivated.Fprint.Error.InvalidFingername">
|
<!ENTITY ERROR_INVALID_FINGERNAME "net.reactivated.Fprint.Error.InvalidFingername">
|
||||||
<!ENTITY ERROR_PRINTS_NOT_DELETED "net.reactivated.Fprint.Error.PrintsNotDeleted">
|
<!ENTITY ERROR_PRINTS_NOT_DELETED "net.reactivated.Fprint.Error.PrintsNotDeleted">
|
||||||
|
<!ENTITY ERROR_PRINTS_NOT_DELETED_FROM_DEVICE "net.reactivated.Fprint.Error.PrintsNotDeletedFromDevice">
|
||||||
]>
|
]>
|
||||||
|
|
||||||
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
|
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
|
||||||
|
|||||||
@ -53,6 +53,8 @@ typedef enum {
|
|||||||
FPRINT_ERROR_NO_SUCH_DEVICE, /*< nick=net.reactivated.Fprint.Error.NoSuchDevice >*/
|
FPRINT_ERROR_NO_SUCH_DEVICE, /*< nick=net.reactivated.Fprint.Error.NoSuchDevice >*/
|
||||||
/* Prints cannot be deleted from the fprintd storage */
|
/* Prints cannot be deleted from the fprintd storage */
|
||||||
FPRINT_ERROR_PRINTS_NOT_DELETED, /*< nick=net.reactivated.Fprint.Error.PrintsNotDeleted >*/
|
FPRINT_ERROR_PRINTS_NOT_DELETED, /*< nick=net.reactivated.Fprint.Error.PrintsNotDeleted >*/
|
||||||
|
/* Prints cannot be deleted from the device storage */
|
||||||
|
FPRINT_ERROR_PRINTS_NOT_DELETED_FROM_DEVICE, /*< nick=net.reactivated.Fprint.Error.PrintsNotDeletedFromDevice >*/
|
||||||
} FprintError;
|
} FprintError;
|
||||||
|
|
||||||
/* Enum of possible permissions, orders and nick matter here:
|
/* Enum of possible permissions, orders and nick matter here:
|
||||||
|
|||||||
Reference in New Issue
Block a user