1. 17 Mar, 2020 3 commits
    • Marco Trevisan's avatar
      device: Cancel the ongoing operation when releasing the device · e7f804e9
      Marco Trevisan authored and Bastien Nocera's avatar Bastien Nocera committed
      If a device is currently verifying, identifying or enrolling we may want the
      user to stop the operation before we actually release the device.
      
      Otherwise we may end-up in trying to close (failing) the internal device,
      while fprintd is still considering the device active, causing a dead-lock
      (the device can't be released, but neither claimed again or stop the current
      action).
      
      In fact calling Claim() -> EnrollStart() -> Release(), we would fail with
      the error
      
        net.reactivated.Fprint.Error.Internal:
        Release failed with error: The device is still busy with another
        operation, please try again later. (36)"
      
      However, if we try to call VerifyStop, after this error, we'd fail because
      for the fprintd logic, the device is not claimed anymore, but actually
      closed, and we'd need to claim it again, but... That would still cause an
      internal error.
      
      To avoid this, in case Relase() is called cancel the ongoing operation,
      and wait until it's done before completing the release call.
      e7f804e9
    • Marco Trevisan's avatar
      device: Return 'verify-no-match' on cancelled verification · 0e993d92
      Marco Trevisan authored and Bastien Nocera's avatar Bastien Nocera committed
      We were returning a 'verify-unknown-error' while we actually know what
      happened, so better to return a soft operation failure.
      0e993d92
    • Marco Trevisan's avatar
      device: Return 'enroll-failed' on cancelled enrollment · b312a5e5
      Marco Trevisan authored and Bastien Nocera's avatar Bastien Nocera committed
      We were returning an 'enroll-unknown-error' while we actually know what
      happened, so better to return a soft operation failure.
      b312a5e5
  2. 14 Feb, 2020 5 commits
    • Marco Trevisan's avatar
      device: Fix leaked matched print on identify · 681bd1ed
      Marco Trevisan authored
      When starting an identify operation we allocate a gallery of prints from the
      gallery, although if we match one of them we get that back in the finish
      callback but with a further reference added.
      
      So, in order to clean it up, use an auto-pointer or we'd end up in leaking
      it, and the address sanitizer was catching this in our tests already:
      
        Indirect leak of 12020 byte(s) in 5 object(s) allocated from:
          #0 0x7fe8bc638ce6 in calloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10dce6)
          #1 0x7fe8bc37ffd0 in g_malloc0 ../../glib/glib/gmem.c:132
          #2 0x55d100635c01 in load_from_file ../src/file_storage.c:159
          #3 0x55d100635c01 in file_storage_print_data_load ../src/file_storage.c:182
          #4 0x55d10063e950 in fprint_device_verify_start ../src/device.c:882
          #5 0x55d10064036b in dbus_glib_marshal_fprint_device_VOID__STRING_POINTER src/device-dbus-glue.h:96
          #6 0x7fe8bc50f6f5  (/usr/lib/x86_64-linux-gnu/libdbus-glib-1.so.2+0xd6f5)
      681bd1ed
    • Marco Trevisan's avatar
      device: Don't leak the user on claim error while deleting prints · 88907321
      Marco Trevisan authored
      When using the delete method we check if the device was claimed, if this
      fails because the device is already in use we return an error, but we don't
      free the user.
      
      While this could be fixed by just a further g_free call, let's just remove
      remove the other manual free calls, and use an auto-pointer instead for this
      function.
      88907321
    • Marco Trevisan's avatar
      device: Use g_clear_error instead of doing the same manually · 7dac81dc
      Marco Trevisan authored
      We've now an utility function that can help us to free and unset an error
      double pointer, so let's use it.
      7dac81dc
    • Marco Trevisan's avatar
      device: Always free error in delete enrolled fingers2 · ba7a45d3
      Marco Trevisan authored
      During delete enrolled fingers2 call, if the check-claimed control fails, we
      would return the error without freeing it.
      
      While this could be fixed by just a further g_error_free call, let's just
      remove the other manual free call, and use an auto-pointer instead for this
      function.
      ba7a45d3
    • Marco Trevisan's avatar
      device: Always free error in delete enrolled fingers · 49dced55
      Marco Trevisan authored
      During delete enrolled fingers call, if the check-claimed control fails, and
      we get an error different from FPRINT_ERROR_CLAIM_DEVICE, we would return
      the error without freeing it.
      
      While this could be fixed by just a further g_error_free call, let's just
      remove all the manual free calls, and use an auto-pointer instead for this
      function.
      49dced55
  3. 05 Feb, 2020 1 commit
    • Marco Trevisan's avatar
      device: Mark fingers names array as const and use unique name · 7d8450e5
      Marco Trevisan authored and Bastien Nocera's avatar Bastien Nocera committed
      With the stronger warnings enabled when building with meson, we get a
      warning for all the fingers definitions:
      
        ../src/device.c:38:24: warning: initialization discards ‘const’ qualifier
        from pointer target type [-Wdiscarded-qualifiers]
          38 |  [FP_FINGER_UNKNOWN] = "unknown",
      
      As the `fingers` array name was shadowed in another file:
      
        ../src/device.c:1000:11: warning: declaration of ‘fingers’ shadows a
        global declaration [-Wshadow]
          1000 |   GSList *fingers, *finger;
      7d8450e5
  4. 04 Feb, 2020 8 commits
  5. 14 Jan, 2020 3 commits
  6. 19 Dec, 2019 1 commit
  7. 18 Dec, 2019 1 commit
  8. 04 Dec, 2019 1 commit
  9. 03 Dec, 2019 4 commits
    • Benjamin Berg's avatar
      device: Log offending API user if DeleteEnrolledFinger is used · 776b4f4c
      Benjamin Berg authored
      When the DeleteEnrolledFinger API is used, log an additional warning
      with the command that made the call.
      776b4f4c
    • Benjamin Berg's avatar
      device: Add new API and fallback to delete prints from device · b2ff316e
      Benjamin Berg authored
      Some devices require storing the print on the device, to support this,
      try deleting prints from the device before deleting them from local
      storage.
      
      To handle these devices, add a new API that requires the device to be
      claimed rather than allowing deletion without claiming the device first.
      Also add appropriate fallbacks so that the old API will continue to
      work, but warn about its use.
      b2ff316e
    • Benjamin Berg's avatar
      device: Handle full device storage including garbage collection · 9c8d0626
      Benjamin Berg authored
      The new libfprint version has support for devices that store data on the
      sensor. In that case, the on-sensor storage might fill up when the user
      tries to enroll a new print.
      
      The strategy introduced here to handle this is to try and delete prints
      from the device that we do not know about (assuming, it is e.g. from an
      old installation and unusable).
      
      It can also happen that we are not able to garbage collect old prints.
      If that happens, a new error code "enroll-data-full" will be returned
      signalling the situation to the enrolling application.
      9c8d0626
    • Benjamin Berg's avatar
      Initial port to libfprint2 · d7821aa7
      Benjamin Berg authored
      d7821aa7
  10. 02 Dec, 2019 1 commit
  11. 08 Aug, 2019 1 commit
    • Bastien Nocera's avatar
      device: Restart verification if error is "retry" · 704c19b8
      Bastien Nocera authored
      fprintd's API docs say that "retry" errors for verification
      "the verification is still ongoing" and that "[the] user should retry
      scanning their finger.
      
      Unfortunately, retry errors are fatal in libfprint. Make fprintd restart
      operations when "retry" is the error for either identification or
      verification purposes.
      
      We need to also make sure that a "*Stop" D-Bus call will return as
      normal if called while we're stopping a verification or identification
      in order to restart it.
      
      Closes: #22
      704c19b8
  12. 12 Nov, 2018 1 commit
  13. 31 May, 2018 1 commit
  14. 30 May, 2018 1 commit
  15. 16 Feb, 2017 2 commits
  16. 14 Feb, 2017 1 commit
  17. 14 Oct, 2015 1 commit
  18. 17 Nov, 2012 1 commit
  19. 18 Apr, 2011 1 commit
  20. 22 Feb, 2011 1 commit
  21. 16 Aug, 2010 1 commit