diff options
author | David Shaw <[email protected]> | 2003-01-12 15:08:16 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2003-01-12 15:08:16 +0000 |
commit | d65d805aad63d00e4b41b7b003a1866d1a93f612 (patch) | |
tree | 90976418d2886731968ed32260e6779edd1610b6 | |
parent | * trustdb.h, trustdb.c (trust_letter): Make static. (get_ownertrust_info, (diff) | |
download | gnupg-d65d805aad63d00e4b41b7b003a1866d1a93f612.tar.gz gnupg-d65d805aad63d00e4b41b7b003a1866d1a93f612.zip |
* tdbio.c (tdbio_set_dbname): Fix assertion failure with
non-fully-qualified trustdb names.
-rw-r--r-- | g10/ChangeLog | 5 | ||||
-rw-r--r-- | g10/tdbio.c | 15 |
2 files changed, 17 insertions, 3 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index 655d204d8..5f183815e 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-10 David Shaw <[email protected]> * trustdb.h, trustdb.c (trust_letter): Make static. diff --git a/g10/tdbio.c b/g10/tdbio.c index aa5c4b7d5..0f2f90b86 100644 --- a/g10/tdbio.c +++ b/g10/tdbio.c @@ -450,9 +450,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 ) { |