From ca9e84b24f04aa253317f3e372b3a83d87c098ad Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Wed, 2 Sep 2026 22:13:27 +0200 Subject: [PATCH] Log the map path and resolved uid on ListEnrolledFingers A seeded map was reported as empty. The instrumented path shows why in one line: `user` on postmarketOS is uid 10000, not 1000, so the daemon looked for fingers-10000.map and the file I had written was fingers-1000.map. Two probe-mode enrolments today also went into gid 1000 on the same assumption -- a group the daemon will never select for that user, since gid is the uid by design. Nothing to correct in the daemon; the assumption was mine, and the fix is to enrol through the daemon rather than around it. The log line stays because "which uid did we resolve and which file did we open" is the first question every time this surface says a user has nothing enrolled. --- implementations/main.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/implementations/main.cpp b/implementations/main.cpp index 642caef..6577884 100644 --- a/implementations/main.cpp +++ b/implementations/main.cpp @@ -1528,10 +1528,16 @@ std::string MapPath(std::uint32_t uid) { } fingerprintd::store::Map LoadMap(std::uint32_t uid) { - std::ifstream f(MapPath(uid)); - if (!f) return {}; + std::string path = MapPath(uid); + std::ifstream f(path); + if (!f) { + std::println("map {}: {}", path, ::strerror(errno)); + return {}; + } std::string text((std::istreambuf_iterator(f)), std::istreambuf_iterator()); - return fingerprintd::store::Map::Decode(text); + auto m = fingerprintd::store::Map::Decode(text); + std::println("map {}: {} bytes, {} finger(s)", path, text.size(), m.Size()); + return m; } void SaveMap(std::uint32_t uid, const fingerprintd::store::Map& m) { @@ -1712,6 +1718,8 @@ void HandleDevice(GDBusMethodInvocation* inv, std::string_view method, GVariant* g_variant_get(params, "(&s)", &username); auto who = ResolveUser(username ? username : "", inv); if (!who) { ReturnError(inv, "Internal", "no such user"); return; } + std::println("ListEnrolledFingers('{}') -> {} uid {}", username ? username : "", + who->first, who->second); auto m = LoadMap(who->second); if (m.Size() == 0) { ReturnError(inv, "NoEnrolledPrints", "no fingers enrolled"); return; } GVariantBuilder b;