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) | |
download | gnunet-a669108f0f2d602bfea9c7a8132fb761388493ad.tar.gz gnunet-a669108f0f2d602bfea9c7a8132fb761388493ad.zip |
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 62cc185ce..9191b9fdd 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, | |||
5940 | GNUNET_CONFIGURATION_get_value_string (cfg, "TESTING_OLD", "HOSTKEYSFILE", | 5940 | GNUNET_CONFIGURATION_get_value_string (cfg, "TESTING_OLD", "HOSTKEYSFILE", |
5941 | &hostkeys_file)) | 5941 | &hostkeys_file)) |
5942 | { | 5942 | { |
5943 | /* This is a hack to make old testing able to load keys from datadir, | ||
5944 | * just as new testing does. | ||
5945 | * No need to document it, just convert everything to the new testing | ||
5946 | * framework... | ||
5947 | */ | ||
5948 | char *DATADIR = "${DATADIR}"; | ||
5949 | size_t ddl = strlen (DATADIR); | ||
5950 | if (strncmp (hostkeys_file, DATADIR, ddl) == 0) | ||
5951 | { | ||
5952 | char *data_dir; | ||
5953 | char *filename; | ||
5954 | data_dir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR); | ||
5955 | GNUNET_asprintf (&filename, "%s%s", data_dir, &hostkeys_file[ddl]); | ||
5956 | GNUNET_free (data_dir); | ||
5957 | GNUNET_free (hostkeys_file); | ||
5958 | hostkeys_file = filename; | ||
5959 | } | ||
5943 | if (GNUNET_YES != GNUNET_DISK_file_test (hostkeys_file)) | 5960 | if (GNUNET_YES != GNUNET_DISK_file_test (hostkeys_file)) |
5944 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 5961 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
5945 | _("Could not read hostkeys file!\n")); | 5962 | _("Could not read hostkeys file `%s'!\n"), hostkeys_file); |
5946 | else | 5963 | else |
5947 | { | 5964 | { |
5948 | /* Check hostkey file size, read entire thing into memory */ | 5965 | /* Check hostkey file size, read entire thing into memory */ |