summaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-10-17 16:55:44 +0000
committerNick Mathewson <nickm@torproject.org>2007-10-17 16:55:44 +0000
commitf988f93b1a54ccbfabbf464514c526033f48e15c (patch)
treed8b7ecfa712171ad29e960c410d3fbd1017c193a /src/or/dirserv.c
parent4088a90d5580612bd3a347be3ddddf3891b60469 (diff)
downloadtor-f988f93b1a54ccbfabbf464514c526033f48e15c.tar.gz
tor-f988f93b1a54ccbfabbf464514c526033f48e15c.zip
r15877@catbus: nickm | 2007-10-17 12:54:56 -0400
Make unverified-consensus get removed when it is accepted or rejected. Make a new get_datadir_fname*() set of functions to eliminate the common code of "get the options, get the datadir, append some stuff". svn:r12000
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 083ab5f22a..4ed163e431 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -178,7 +178,7 @@ dirserv_add_own_fingerprint(const char *nickname, crypto_pk_env_t *pk)
int
dirserv_load_fingerprint_file(void)
{
- char fname[512];
+ char *fname;
char *cf;
char *nickname, *fingerprint;
authdir_config_t *fingerprint_list_new;
@@ -186,8 +186,7 @@ dirserv_load_fingerprint_file(void)
config_line_t *front=NULL, *list;
or_options_t *options = get_options();
- tor_snprintf(fname, sizeof(fname),
- "%s/approved-routers", options->DataDirectory);
+ fname = get_datadir_fname("approved-routers");
log_info(LD_GENERAL,
"Reloading approved fingerprints from \"%s\"...", fname);
@@ -195,12 +194,16 @@ dirserv_load_fingerprint_file(void)
if (!cf) {
if (options->NamingAuthoritativeDir) {
log_warn(LD_FS, "Cannot open fingerprint file '%s'. Failing.", fname);
+ tor_free(fname);
return -1;
} else {
log_info(LD_FS, "Cannot open fingerprint file '%s'. Returning.", fname);
+ tor_free(fname);
return 0;
}
}
+ tor_free(fname);
+
result = config_get_lines(cf, &front);
tor_free(cf);
if (result < 0) {