diff options
author | Jakub Jelen <jjelen@redhat.com> | 2020-03-04 11:03:20 +0100 |
---|---|---|
committer | Frediano Ziglio <freddy77@gmail.com> | 2020-04-17 08:58:55 +0100 |
commit | e63bc9f3d63a74a07cd6b56e86a410ba0ab33249 (patch) | |
tree | 2c6b88c781f7204cc1b733650a4ecbcca16a47ee /src | |
parent | 243d116407f9a3ce134dfb02fa6bc5c4064fc970 (diff) |
vcard_emul_nss: Log message if the NSS_Init fails (with db dir used)
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/vcard_emul_nss.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/vcard_emul_nss.c b/src/vcard_emul_nss.c index f8bf9fb..f5783c3 100644 --- a/src/vcard_emul_nss.c +++ b/src/vcard_emul_nss.c @@ -86,7 +86,7 @@ enum { }; struct VCardEmulOptionsStruct { - void *nss_db; + char *nss_db; VirtualReaderOptions *vreader; int vreader_count; VCardEmulType hw_card_type; @@ -991,6 +991,10 @@ vcard_emul_init(const VCardEmulOptions *options) /* first initialize NSS */ if (options->nss_db) { rv = NSS_Init(options->nss_db); + if (rv != SECSuccess) { + g_debug("%s: NSS_Init failed. Does the DB directory '%s' exist?", __func__, options->nss_db); + return VCARD_EMUL_FAIL; + } } else { gchar *path; #ifndef _WIN32 @@ -1006,11 +1010,13 @@ vcard_emul_init(const VCardEmulOptions *options) #endif rv = NSS_Init(path); + if (rv != SECSuccess) { + g_debug("%s: NSS_Init failed. Does the DB directory '%s' exist?", __func__, path); + g_free(path); + return VCARD_EMUL_FAIL; + } g_free(path); } - if (rv != SECSuccess) { - return VCARD_EMUL_FAIL; - } /* Set password callback function */ PK11_SetPasswordFunc(vcard_emul_get_password); |