diff options
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/config.c | 42 | ||||
-rw-r--r-- | src/or/main.c | 4 | ||||
-rw-r--r-- | src/or/rendservice.c | 10 | ||||
-rw-r--r-- | src/or/router.c | 26 |
4 files changed, 41 insertions, 41 deletions
diff --git a/src/or/config.c b/src/or/config.c index d62b17171d..60e55c9195 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -440,7 +440,7 @@ options_act(or_options_t *old_options) /* Ensure data directory is private; create if possible. */ if (check_private_dir(options->DataDirectory, CPD_CREATE) != 0) { - log_fn(LOG_ERR, "Couldn't access/create private data directory %s", + log_fn(LOG_ERR, "Couldn't access/create private data directory \"%s\"", options->DataDirectory); return -1; } @@ -969,14 +969,14 @@ get_assigned_option(config_format_t *fmt, or_options_t *options, const char *key result->value = tor_strdup(""); break; case CONFIG_TYPE_OBSOLETE: - log_fn(LOG_WARN,"You asked me for the value of an obsolete config option %s.", key); + log_fn(LOG_WARN,"You asked me for the value of an obsolete config option '%s'.", key); tor_free(result->key); tor_free(result); return NULL; default: tor_free(result->key); tor_free(result); - log_fn(LOG_WARN,"Bug: unknown type %d for known key %s", var->type, key); + log_fn(LOG_WARN,"Bug: unknown type %d for known key '%s'", var->type, key); return NULL; } @@ -1186,7 +1186,7 @@ resolve_my_address(or_options_t *options, uint32_t *addr_out, char **hostname_ou explicit_ip = 0; rent = (struct hostent *)gethostbyname(hostname); if (!rent) { - log_fn(LOG_WARN,"Could not resolve local Address %s. Failing.", hostname); + log_fn(LOG_WARN,"Could not resolve local Address '%s'. Failing.", hostname); return -1; } tor_assert(rent->h_length == 4); @@ -1213,7 +1213,7 @@ resolve_my_address(or_options_t *options, uint32_t *addr_out, char **hostname_ou } } - log_fn(LOG_DEBUG, "Resolved Address to %s.", tmpbuf); + log_fn(LOG_DEBUG, "Resolved Address to '%s'.", tmpbuf); *addr_out = ntohl(in.s_addr); if (old_addr && old_addr != *addr_out) { log_fn(LOG_NOTICE,"Your IP seems to have changed. Updating."); @@ -1569,7 +1569,7 @@ options_validate(or_options_t *options) if (server_mode(options)) { if (!(options->Nickname = get_default_nickname())) return -1; - log_fn(LOG_NOTICE, "Choosing default nickname %s", options->Nickname); + log_fn(LOG_NOTICE, "Choosing default nickname '%s'", options->Nickname); } } else { if (!is_legal_nickname(options->Nickname)) { @@ -1986,7 +1986,7 @@ options_transition_allowed(or_options_t *old, or_options_t *new_val) } if (strcmp(old->DataDirectory,new_val->DataDirectory)!=0) { - log_fn(LOG_WARN,"While Tor is running, changing DataDirectory (%s->%s) is not allowed. Failing.", old->DataDirectory, new_val->DataDirectory); + log_fn(LOG_WARN,"While Tor is running, changing DataDirectory (\"%s\"->\"%s\") is not allowed. Failing.", old->DataDirectory, new_val->DataDirectory); return -1; } @@ -2089,7 +2089,7 @@ get_windows_conf_root(void) &idl))) { GetCurrentDirectory(MAX_PATH, path); is_set = 1; - log_fn(LOG_WARN, "I couldn't find your application data folder: are you running an ancient version of Windows 95? Defaulting to '%s'", path); + log_fn(LOG_WARN, "I couldn't find your application data folder: are you running an ancient version of Windows 95? Defaulting to \"%s\"", path); return path; } /* Convert the path from an "ID List" (whatever that is!) to a path. */ @@ -2234,16 +2234,16 @@ options_init_from_torrc(int argc, char **argv) } } tor_assert(fname); - log(LOG_DEBUG, "Opening config file '%s'", fname); + log(LOG_DEBUG, "Opening config file \"%s\"", fname); if (file_status(fname) != FN_FILE || !(cf = read_file_to_str(fname,0))) { if (using_default_torrc == 1) { - log(LOG_NOTICE, "Configuration file '%s' not present, " + log(LOG_NOTICE, "Configuration file \"%s\" not present, " "using reasonable defaults.", fname); tor_free(fname); /* sets fname to NULL */ } else { - log(LOG_WARN, "Unable to open configuration file '%s'.", fname); + log(LOG_WARN, "Unable to open configuration file \"%s\".", fname); tor_free(fname); goto err; } @@ -2406,7 +2406,7 @@ convert_log_option(or_options_t *options, config_line_t *level_opt, if (file_opt && !strcasecmp(file_opt->key, "LogFile")) { if (add_single_log_option(options, levelMin, levelMax, "file", file_opt->value) < 0) { - log_fn(LOG_WARN, "Cannot write to LogFile '%s': %s.", file_opt->value, + log_fn(LOG_WARN, "Cannot write to LogFile \"%s\": %s.", file_opt->value, strerror(errno)); return -1; } @@ -2796,13 +2796,13 @@ normalize_data_directory(or_options_t *options) if (strncmp(d,"~/",2) == 0) { char *fn = expand_filename(d); if (!fn) { - log_fn(LOG_ERR,"Failed to expand filename '%s'.", d); + log_fn(LOG_ERR,"Failed to expand filename \"%s\".", d); return -1; } if (!options->DataDirectory && !strcmp(fn,"/.tor")) { /* If our homedir is /, we probably don't want to use it. */ /* XXXX Default to /var/lib/tor? */ - log_fn(LOG_WARN, "Default DataDirectory is ~/.tor, which works out to %s, which is probably not what you want. Using %s/tor instead", fn, LOCALSTATEDIR); + log_fn(LOG_WARN, "Default DataDirectory is \"~/.tor\". This expands to \"%s\", which is probably not what you want. Using \"%s/tor\" instead", fn, LOCALSTATEDIR); tor_free(fn); fn = tor_strdup(LOCALSTATEDIR"/tor"); @@ -2854,7 +2854,7 @@ write_configuration_file(const char *fname, or_options_t *options) case FN_NOENT: break; default: - log_fn(LOG_WARN,"Config file %s is not a file? Failing.", fname); + log_fn(LOG_WARN,"Config file \"%s\" is not a file? Failing.", fname); return -1; } } @@ -2884,7 +2884,7 @@ write_configuration_file(const char *fname, or_options_t *options) break; ++i; } - log_fn(LOG_NOTICE, "Renaming old configuration file to %s", fn_tmp); + log_fn(LOG_NOTICE, "Renaming old configuration file to \"%s\"", fn_tmp); rename(fname, fn_tmp); tor_free(fn_tmp); } @@ -3168,14 +3168,14 @@ or_state_load(void) switch (file_status(fname)) { case FN_FILE: if (!(contents = read_file_to_str(fname, 0))) { - log_fn(LOG_WARN, "Unable to read state file %s", fname); + log_fn(LOG_WARN, "Unable to read state file \"%s\"", fname); goto done; } break; case FN_NOENT: break; default: - log_fn(LOG_WARN,"State file %s is not a file? Failing.", fname); + log_fn(LOG_WARN,"State file \"%s\" is not a file? Failing.", fname); goto done; } new_state = tor_malloc_zero(sizeof(or_state_t)); @@ -3196,7 +3196,7 @@ or_state_load(void) goto done; if (contents) - log_fn(LOG_INFO, "Loaded state from %s", fname); + log_fn(LOG_INFO, "Loaded state from \"%s\"", fname); else log_fn(LOG_INFO, "Initialized state"); or_state_set(new_state); @@ -3242,12 +3242,12 @@ or_state_save(void) tor_free(state); fname = get_or_state_fname(); if (write_str_to_file(fname, contents, 0)<0) { - log_fn(LOG_WARN, "Unable to write state to file %s", fname); + log_fn(LOG_WARN, "Unable to write state to file \"%s\"", fname); tor_free(fname); tor_free(contents); return -1; } - log_fn(LOG_INFO, "Saved state to %s", fname); + log_fn(LOG_INFO, "Saved state to \"%s\"", fname); tor_free(fname); tor_free(contents); diff --git a/src/or/main.c b/src/or/main.c index 6791ef377d..ed35987d2b 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -917,7 +917,7 @@ do_hup(void) if (authdir_mode(options)) { /* reload the approved-routers file */ tor_snprintf(keydir,sizeof(keydir),"%s/approved-routers", options->DataDirectory); - log_fn(LOG_INFO,"Reloading approved fingerprints from %s...",keydir); + log_fn(LOG_INFO,"Reloading approved fingerprints from \"%s\"...",keydir); if (dirserv_parse_fingerprint_file(keydir) < 0) { log_fn(LOG_NOTICE, "Error reloading fingerprints. Continuing with old list."); } @@ -939,7 +939,7 @@ do_hup(void) } tor_snprintf(keydir,sizeof(keydir),"%s/router.desc", options->DataDirectory); - log_fn(LOG_INFO,"Saving descriptor to %s...",keydir); + log_fn(LOG_INFO,"Saving descriptor to \"%s\"...",keydir); if (write_str_to_file(keydir, descriptor, 0)) { return 0; } diff --git a/src/or/rendservice.c b/src/or/rendservice.c index 5511f46ab8..3bb86c2c09 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -122,7 +122,7 @@ add_service(rend_service_t *service) } else { smartlist_set_capacity(service->ports, -1); smartlist_add(rend_service_list, service); - log_fn(LOG_DEBUG,"Configuring service with directory %s",service->directory); + log_fn(LOG_DEBUG,"Configuring service with directory \"%s\"",service->directory); for (i = 0; i < smartlist_len(service->ports); ++i) { char addrbuf[INET_NTOA_BUF_LEN]; p = smartlist_get(service->ports, i); @@ -322,7 +322,7 @@ rend_service_load_keys(void) s = smartlist_get(rend_service_list,i); if (s->private_key) continue; - log_fn(LOG_INFO, "Loading hidden-service keys from '%s'", s->directory); + log_fn(LOG_INFO, "Loading hidden-service keys from \"%s\"", s->directory); /* Check/create directory */ if (check_private_dir(s->directory, CPD_CREATE) < 0) @@ -331,7 +331,7 @@ rend_service_load_keys(void) /* Load key */ if (strlcpy(fname,s->directory,sizeof(fname)) >= sizeof(fname) || strlcat(fname,"/private_key",sizeof(fname)) >= sizeof(fname)) { - log_fn(LOG_WARN, "Directory name too long: '%s'", s->directory); + log_fn(LOG_WARN, "Directory name too long: \"%s\"", s->directory); return -1; } s->private_key = init_key_from_file(fname); @@ -349,7 +349,7 @@ rend_service_load_keys(void) } if (strlcpy(fname,s->directory,sizeof(fname)) >= sizeof(fname) || strlcat(fname,"/hostname",sizeof(fname)) >= sizeof(fname)) { - log_fn(LOG_WARN, "Directory name too long: '%s'", s->directory); + log_fn(LOG_WARN, "Directory name too long: \"%s\"", s->directory); return -1; } tor_snprintf(buf, sizeof(buf),"%s.onion\n", s->service_id); @@ -1046,7 +1046,7 @@ rend_service_dump_stats(int severity) for (i=0; i < smartlist_len(rend_service_list); ++i) { service = smartlist_get(rend_service_list, i); - log(severity, "Service configured in %s:", service->directory); + log(severity, "Service configured in \"%s\":", service->directory); for (j=0; j < smartlist_len(service->intro_nodes); ++j) { nickname = smartlist_get(service->intro_nodes, j); router = router_get_by_nickname(smartlist_get(service->intro_nodes,j)); diff --git a/src/or/router.c b/src/or/router.c index 693f32bc8e..0d43500277 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -145,7 +145,7 @@ rotate_onion_key(void) goto error; } if (crypto_pk_write_private_key_to_filename(prkey, fname)) { - log(LOG_ERR, "Couldn't write generated key to %s.", fname); + log(LOG_ERR, "Couldn't write generated key to \"%s\".", fname); goto error; } log_fn(LOG_INFO, "Rotating onion key"); @@ -175,7 +175,7 @@ init_key_from_file_name_changed(const char *fname_old, /* The old filename exists, and the new one doesn't. Rename and load. */ if (rename(fname_old, fname_new) < 0) { - log_fn(LOG_ERR, "Couldn't rename %s to %s: %s", fname_old, fname_new, + log_fn(LOG_ERR, "Couldn't rename \"%s\" to \"%s\": %s", fname_old, fname_new, strerror(errno)); return NULL; } @@ -200,10 +200,10 @@ init_key_from_file(const char *fname) switch (file_status(fname)) { case FN_DIR: case FN_ERROR: - log(LOG_ERR, "Can't read key from %s", fname); + log(LOG_ERR, "Can't read key from \"%s\"", fname); goto error; case FN_NOENT: - log(LOG_INFO, "No key found in %s; generating fresh key.", fname); + log(LOG_INFO, "No key found in \"%s\"; generating fresh key.", fname); if (crypto_pk_generate_key(prkey)) { log(LOG_ERR, "Error generating onion key"); goto error; @@ -214,7 +214,7 @@ init_key_from_file(const char *fname) } log(LOG_INFO, "Generated key seems valid"); if (crypto_pk_write_private_key_to_filename(prkey, fname)) { - log(LOG_ERR, "Couldn't write generated key to %s.", fname); + log(LOG_ERR, "Couldn't write generated key to \"%s\".", fname); goto error; } return prkey; @@ -291,14 +291,14 @@ init_keys(void) /* 1. Read identity key. Make it if none is found. */ tor_snprintf(keydir,sizeof(keydir),"%s/keys/identity.key",datadir); tor_snprintf(keydir2,sizeof(keydir2),"%s/keys/secret_id_key",datadir); - log_fn(LOG_INFO,"Reading/making identity key %s...",keydir2); + log_fn(LOG_INFO,"Reading/making identity key \"%s\"...",keydir2); prkey = init_key_from_file_name_changed(keydir,keydir2); if (!prkey) return -1; set_identity_key(prkey); /* 2. Read onion key. Make it if none is found. */ tor_snprintf(keydir,sizeof(keydir),"%s/keys/onion.key",datadir); tor_snprintf(keydir2,sizeof(keydir2),"%s/keys/secret_onion_key",datadir); - log_fn(LOG_INFO,"Reading/making onion key %s...",keydir2); + log_fn(LOG_INFO,"Reading/making onion key \"%s\"...",keydir2); prkey = init_key_from_file_name_changed(keydir,keydir2); if (!prkey) return -1; set_onion_key(prkey); @@ -337,13 +337,13 @@ init_keys(void) } tor_snprintf(keydir,sizeof(keydir),"%s/router.desc", datadir); - log_fn(LOG_INFO,"Dumping descriptor to %s...",keydir); + log_fn(LOG_INFO,"Dumping descriptor to \"%s\"...",keydir); if (write_str_to_file(keydir, mydesc,0)) { return -1; } /* 5. Dump fingerprint to 'fingerprint' */ tor_snprintf(keydir,sizeof(keydir),"%s/fingerprint", datadir); - log_fn(LOG_INFO,"Dumping fingerprint to %s...",keydir); + log_fn(LOG_INFO,"Dumping fingerprint to \"%s\"...",keydir); if (crypto_pk_get_fingerprint(get_identity_key(), fingerprint, 1)<0) { log_fn(LOG_ERR, "Error computing fingerprint"); return -1; @@ -360,7 +360,7 @@ init_keys(void) return 0; /* 6. [authdirserver only] load approved-routers file */ tor_snprintf(keydir,sizeof(keydir),"%s/approved-routers", datadir); - log_fn(LOG_INFO,"Loading approved fingerprints from %s...",keydir); + log_fn(LOG_INFO,"Loading approved fingerprints from \"%s\"...",keydir); if (dirserv_parse_fingerprint_file(keydir) < 0) { log_fn(LOG_ERR, "Error loading fingerprints"); return -1; @@ -372,13 +372,13 @@ init_keys(void) } /* 7. [authdirserver only] load old directory, if it's there */ tor_snprintf(keydir,sizeof(keydir),"%s/cached-directory", datadir); - log_fn(LOG_INFO,"Loading cached directory from %s...",keydir); + log_fn(LOG_INFO,"Loading cached directory from \"%s\"...",keydir); cp = read_file_to_str(keydir,0); if (!cp) { - log_fn(LOG_INFO,"Cached directory %s not present. Ok.",keydir); + log_fn(LOG_INFO,"Cached directory \"%s\" not present. Ok.",keydir); } else { if (dirserv_load_from_directory_string(cp) < 0) { - log_fn(LOG_WARN, "Cached directory %s is corrupt, only loaded part of it.", keydir); + log_fn(LOG_WARN, "Cached directory \"%s\" is corrupt, only loaded part of it.", keydir); tor_free(cp); return 0; } |