mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 11:04:58 -06:00
libcacard: use system config directory for nss db on win32
It's a bit nicer to look for default database under CSIDL_COMMON_APPDATA\pki\nss rather that /etc/pki/nss. Signed-off-by: Marc-André Lureau <mlureau@redhat.com> Reviewed-by: Alon Levy <alevy@redhat.com>
This commit is contained in:
parent
da000a4867
commit
e2d9c5e769
1 changed files with 17 additions and 1 deletions
|
@ -893,7 +893,23 @@ vcard_emul_init(const VCardEmulOptions *options)
|
||||||
if (options->nss_db) {
|
if (options->nss_db) {
|
||||||
rv = NSS_Init(options->nss_db);
|
rv = NSS_Init(options->nss_db);
|
||||||
} else {
|
} else {
|
||||||
rv = NSS_Init("sql:/etc/pki/nssdb");
|
gchar *path, *db;
|
||||||
|
#ifndef _WIN32
|
||||||
|
path = g_strdup("/etc/pki/nssdb");
|
||||||
|
#else
|
||||||
|
if (g_get_system_config_dirs() == NULL ||
|
||||||
|
g_get_system_config_dirs()[0] == NULL) {
|
||||||
|
return VCARD_EMUL_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
path = g_build_filename(
|
||||||
|
g_get_system_config_dirs()[0], "pki", "nssdb", NULL);
|
||||||
|
#endif
|
||||||
|
db = g_strdup_printf("sql:%s", path);
|
||||||
|
|
||||||
|
rv = NSS_Init(db);
|
||||||
|
g_free(db);
|
||||||
|
g_free(path);
|
||||||
}
|
}
|
||||||
if (rv != SECSuccess) {
|
if (rv != SECSuccess) {
|
||||||
return VCARD_EMUL_FAIL;
|
return VCARD_EMUL_FAIL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue