diff options
author | LRN <lrn1986@gmail.com> | 2012-07-22 13:47:09 +0000 |
---|---|---|
committer | LRN <lrn1986@gmail.com> | 2012-07-22 13:47:09 +0000 |
commit | a669108f0f2d602bfea9c7a8132fb761388493ad (patch) | |
tree | f7d5d820b49c7c7f5c86cb3156666dfc4d778a1e /src/testing_old/testing_group.c | |
parent | 87ae074b51ba30501c60ff88782dc2ccd5ef0daa (diff) |
Fix hostkey loading for old testing framework
Diffstat (limited to 'src/testing_old/testing_group.c')
-rw-r--r-- | src/testing_old/testing_group.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/testing_old/testing_group.c b/src/testing_old/testing_group.c index 62cc185ce9..9191b9fdda 100644 --- a/src/testing_old/testing_group.c +++ b/src/testing_old/testing_group.c @@ -5940,9 +5940,26 @@ GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_CONFIGURATION_get_value_string (cfg, "TESTING_OLD", "HOSTKEYSFILE", &hostkeys_file)) { + /* This is a hack to make old testing able to load keys from datadir, + * just as new testing does. + * No need to document it, just convert everything to the new testing + * framework... + */ + char *DATADIR = "${DATADIR}"; + size_t ddl = strlen (DATADIR); + if (strncmp (hostkeys_file, DATADIR, ddl) == 0) + { + char *data_dir; + char *filename; + data_dir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR); + GNUNET_asprintf (&filename, "%s%s", data_dir, &hostkeys_file[ddl]); + GNUNET_free (data_dir); + GNUNET_free (hostkeys_file); + hostkeys_file = filename; + } if (GNUNET_YES != GNUNET_DISK_file_test (hostkeys_file)) GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - _("Could not read hostkeys file!\n")); + _("Could not read hostkeys file `%s'!\n"), hostkeys_file); else { /* Check hostkey file size, read entire thing into memory */ |