]> git.sommitrealweird.co.uk Git - onak.git/blobdiff - keydb_dynamic.c
Document our test keys
[onak.git] / keydb_dynamic.c
index ca489ae46b2b70a2a7b4febc172d57211ad0477a..49d77b85e110743b93308460e1587fafe22b239c 100644 (file)
@@ -39,13 +39,18 @@ bool load_backend(void)
                close_backend();
        }
 
                close_backend();
        }
 
+       if (!config.db_backend) {
+               logthing(LOGTHING_CRITICAL, "No database backend defined.");
+               exit(EXIT_FAILURE);
+       }
+
        if (config.backends_dir == NULL) {
                soname = malloc(strlen(config.db_backend)
        if (config.backends_dir == NULL) {
                soname = malloc(strlen(config.db_backend)
-                       + strlen("/libkeydb_")
+                       + strlen("./libkeydb_")
                        + strlen(".so")
                        + 1);
 
                        + strlen(".so")
                        + 1);
 
-               sprintf(soname, "libkeydb_%s.so", config.db_backend);
+               sprintf(soname, "./libkeydb_%s.so", config.db_backend);
        } else {
                soname = malloc(strlen(config.db_backend)
                        + strlen("/libkeydb_")
        } else {
                soname = malloc(strlen(config.db_backend)
                        + strlen("/libkeydb_")
@@ -61,12 +66,12 @@ bool load_backend(void)
 
        handle = dlopen(soname, RTLD_LAZY);
        if (handle == NULL) {
 
        handle = dlopen(soname, RTLD_LAZY);
        if (handle == NULL) {
-               logthing(LOGTHING_ERROR,
+               logthing(LOGTHING_CRITICAL,
                                "Failed to open handle to library '%s': %s",
                                soname, dlerror());
                free(soname);
                soname = NULL;
                                "Failed to open handle to library '%s': %s",
                                soname, dlerror());
                free(soname);
                soname = NULL;
-               return false;
+               exit(EXIT_FAILURE);
        }
        free(soname);
        soname = NULL;
        }
        free(soname);
        soname = NULL;
@@ -198,7 +203,7 @@ struct ll *getkeysigs(uint64_t keyid, bool *revoked)
                        sigs = keysigs(sigs, uids->sigs);
                }
                if (revoked != NULL) {
                        sigs = keysigs(sigs, uids->sigs);
                }
                if (revoked != NULL) {
-                       *revoked = (publickey->revocations != NULL);
+                       *revoked = publickey->revoked;
                }
                free_publickey(publickey);
        }
                }
                free_publickey(publickey);
        }
@@ -337,7 +342,7 @@ int update_keys(struct openpgp_publickey **keys, bool sendsync)
                 */
                if (oldkey != NULL) {
                        merge_keys(oldkey, curkey);
                 */
                if (oldkey != NULL) {
                        merge_keys(oldkey, curkey);
-                       if (curkey->revocations == NULL &&
+                       if (curkey->sigs == NULL &&
                                        curkey->uids == NULL &&
                                        curkey->subkeys == NULL) {
                                if (prev == NULL) {
                                        curkey->uids == NULL &&
                                        curkey->subkeys == NULL) {
                                if (prev == NULL) {