summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2020-12-17 01:58:30 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2021-01-22 15:19:21 +0100
commitdbf01399ad6090b1d53b0574b8c38b65e60144db (patch)
tree6fa957a3a681b65de1d5c165d80c84dd9717e2d4
parent0f29cfc0c7c6ff23cd44e51ab5df0db299e678bd (diff)
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.
-rw-r--r--src/device.c16
-rw-r--r--src/device.xml1
-rw-r--r--src/fprintd.h2
3 files changed, 19 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index 602a336..564657f 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1863,6 +1863,7 @@ delete_enrolled_fingers (FprintDevice *rdev,
FpFinger finger,
GError **error)
{
+ g_autoptr(GError) device_error = NULL;
FprintDevicePrivate *priv = fprint_device_get_instance_private (rdev);
guint i;
int r;
@@ -1910,6 +1911,14 @@ delete_enrolled_fingers (FprintDevice *rdev,
{
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.");
+
+ 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;
}
diff --git a/src/device.xml b/src/device.xml
index 1a3479f..edc62db 100644
--- a/src/device.xml
+++ b/src/device.xml
@@ -9,6 +9,7 @@
<!ENTITY ERROR_NO_ACTION_IN_PROGRESS "net.reactivated.Fprint.Error.NoActionInProgress">
<!ENTITY ERROR_INVALID_FINGERNAME "net.reactivated.Fprint.Error.InvalidFingername">
<!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">
diff --git a/src/fprintd.h b/src/fprintd.h
index dc45492..1fd6d70 100644
--- a/src/fprintd.h
+++ b/src/fprintd.h
@@ -53,6 +53,8 @@ typedef enum {
FPRINT_ERROR_NO_SUCH_DEVICE, /*< nick=net.reactivated.Fprint.Error.NoSuchDevice >*/
/* Prints cannot be deleted from the fprintd storage */
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;
/* Enum of possible permissions, orders and nick matter here: