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;