aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2003-01-12 15:46:17 +0000
committerDavid Shaw <[email protected]>2003-01-12 15:46:17 +0000
commit33d6f711ccc8a86573b419da44bb8cbcb70347b4 (patch)
treebf0834c4237d2363259ad568ff9c071d1e431fda
parent* trustdb.c (get_validity_info, get_ownertrust_info, trust_letter): (diff)
downloadgnupg-33d6f711ccc8a86573b419da44bb8cbcb70347b4.tar.gz
gnupg-33d6f711ccc8a86573b419da44bb8cbcb70347b4.zip
* tdbio.c (tdbio_set_dbname): Fix assertion failure with
non-fully-qualified trustdb names.
-rw-r--r--g10/ChangeLog5
-rw-r--r--g10/tdbio.c15
2 files changed, 17 insertions, 3 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 716705bd5..7b9d2443e 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,8 @@
+2003-01-12 David Shaw <[email protected]>
+
+ * tdbio.c (tdbio_set_dbname): Fix assertion failure with
+ non-fully-qualified trustdb names.
+
2003-01-11 David Shaw <[email protected]>
* trustdb.c (get_validity_info, get_ownertrust_info,
diff --git a/g10/tdbio.c b/g10/tdbio.c
index c7f04f441..47dc51e2d 100644
--- a/g10/tdbio.c
+++ b/g10/tdbio.c
@@ -474,9 +474,18 @@ tdbio_set_dbname( const char *new_dbname, int create )
atexit( cleanup );
initialized = 1;
}
- fname = new_dbname? m_strdup( new_dbname )
- : make_filename(opt.homedir,
- "trustdb" EXTSEP_S "gpg", NULL );
+
+ if(new_dbname==NULL)
+ fname=make_filename(opt.homedir,"trustdb" EXTSEP_S "gpg", NULL);
+ else if (*new_dbname != DIRSEP_C )
+ {
+ if (strchr(new_dbname, DIRSEP_C) )
+ fname = make_filename (new_dbname, NULL);
+ else
+ fname = make_filename (opt.homedir, new_dbname, NULL);
+ }
+ else
+ fname = m_strdup (new_dbname);
if( access( fname, R_OK ) ) {
if( errno != ENOENT ) {