Package: onak
Version: 0.3.7-1
Severity: minor
Tags: patch

Hello,
I discovered a few minor bugs when I was tracking down an internal problem with gpgwww:

Sometimes the key IDs are not left padded when printed:

--- gpgwww.c.orig    2009-06-02 17:15:08.000000000 +0200
+++ gpgwww.c    2009-08-06 16:12:28.000000000 +0200
@@ -154,7 +154,7 @@
    }

    if (op != OP_GET) {
-        printf("<P>Looking for path from 0x%" PRIX64" to 0x%" PRIX64
+        printf("<P>Looking for path from 0x%08" PRIX64" to 0x%08" PRIX64
                ".\n",
                from, to);
        printf("<A HREF=\"gpgwww?from=0x%08" PRIX64 "&to=0x%08" PRIX64
@@ -173,7 +173,7 @@
    catchsignals();
    config.dbbackend->initdb(true);
    inithash();
-    logthing(LOGTHING_NOTICE, "Looking for path from 0x%" PRIX64 " to 0x%"
+ logthing(LOGTHING_NOTICE, "Looking for path from 0x%08" PRIX64 " to 0x%08"
            PRIX64,
            from,
            to);
--- stats.c.orig    2009-06-02 17:15:08.000000000 +0200
+++ stats.c    2009-08-06 16:55:46.000000000 +0200
@@ -139,11 +139,11 @@
    (void) config.dbbackend->cached_getkeysigs(fullwant);

    if ((keyinfoa = findinhash(fullhave)) == NULL) {
-        printf("Couldn't find key 0x%" PRIX64 ".\n", have);
+        printf("Couldn't find key 0x%08" PRIX64 ".\n", have);
        return;
    }
    if ((keyinfob = findinhash(fullwant)) == NULL) {
-        printf("Couldn't find key 0x%" PRIX64 ".\n", want);
+        printf("Couldn't find key 0x%08" PRIX64 ".\n", want);
        return;
    }
--- sixdegrees.c.orig    2009-06-02 17:15:08.000000000 +0200
+++ sixdegrees.c    2009-08-06 16:57:32.000000000 +0200
@@ -86,12 +86,12 @@
    config.dbbackend->cached_getkeysigs(keyid);

    if ((keyinfo = findinhash(keyid)) == NULL) {
-        printf("Couldn't find key 0x%" PRIX64 ".\n", keyid);
+        printf("Couldn't find key 0x%08" PRIX64 ".\n", keyid);
        return;
    }

    uid = config.dbbackend->keyid2uid(keyinfo->keyid);
-    printf("Six degrees for 0x%" PRIX64 " (%s):\n", keyinfo->keyid, uid);
+    printf("Six degrees for 0x%08" PRIX64 " (%s):\n", keyinfo->keyid, uid);
    free(uid);
    uid = NULL;
--- keyindex.c.orig    2009-06-02 17:15:08.000000000 +0200
+++ keyindex.c    2009-08-06 16:58:33.000000000 +0200
@@ -87,7 +87,7 @@
        } else if (uids->packet->tag == 17) {
            printf("                                ");
            if (html) {
-                printf("<img src=\"lookup?op=photo&search=0x%"
+                printf("<img src=\"lookup?op=photo&search=0x%08"
                    PRIX64 "&idx=%d\" alt=\"[photo id]\">"
                    "\n",
                    keyid,


When specifying an unknown key ID to gpgwww, I expected it to print "key not found" instead of "couldn't find a link between the keys" as the source suggests:

void dofindpath(uint64_t have, uint64_t want, bool html, int count) { [...] fullhave = config.dbbackend->getfullkeyid(have); fullwant = config.dbbackend->getfullkeyid(want); (void) config.dbbackend->cached_getkeysigs(fullhave); (void) config.dbbackend->cached_getkeysigs(fullwant); if ((keyinfoa = findinhash(fullhave)) == NULL) { printf("Couldn't find key 0x%" PRIX64 ".\n", have); return; } So here findinhash(fullhave/fullwant) is never returning NULL even if the key is unknown. Now I'm not sure where the bug is, apparently cached_getkeysigs() shouldn't put anything in the cache if the key doesn't exist...

The same problem occurs in:
- sixdegrees() function in sixdegrees.c (doesn't recognize the key is unknown, try: ./sixdegrees 1)
and maybe also in:
- DFSVisit() in gpgstats-0.0.2/graphstuff.c
- DFSVisit() in gpgstats-0.0.2/dotrees.c
- showkeysigs() in gpgstats-0.0.2/gpgstats.c
as they all use the same  findinhash(keyid)) == NULL principle

Phil




--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to