Loading doc/TODO +2 −0 Original line number Diff line number Diff line Loading @@ -298,6 +298,8 @@ Deferred from 0.1.2.x: - Implement Minor items for 0.1.2.x as time permits: - even if your torrc lists yourself in your myfamily line, don't list it in the descriptor. - Flesh out options_description array in src/or/config.c - Don't let 'newnym' be triggered more often than every n seconds. - change log_fn() to log() on notice/warn/err logs where we can. Loading src/common/compat.c +3 −2 Original line number Diff line number Diff line Loading @@ -652,12 +652,13 @@ switch_id(char *user, char *group) } if (setgid(gr->gr_gid) != 0) { log_warn(LD_GENERAL,"Error setting GID: %s", strerror(errno)); log_warn(LD_GENERAL,"Error setting to configured GID: %s", strerror(errno)); return -1; } } else if (user) { if (setgid(pw->pw_gid) != 0) { log_warn(LD_GENERAL,"Error setting GID: %s", strerror(errno)); log_warn(LD_GENERAL,"Error setting to user GID: %s", strerror(errno)); return -1; } } Loading src/common/crypto.c +1 −1 Original line number Diff line number Diff line Loading @@ -734,7 +734,7 @@ crypto_pk_public_checksig_digest(crypto_pk_env_t *env, const char *data, tor_assert(sig); if (crypto_digest(digest,data,datalen)<0) { log_warn(LD_CRYPTO, "couldn't compute digest"); log_warn(LD_BUG, "couldn't compute digest"); return -1; } r = crypto_pk_public_checksig(env,buf,sig,siglen); Loading src/common/util.c +5 −5 Original line number Diff line number Diff line Loading @@ -907,7 +907,7 @@ parse_rfc1123_time(const char *buf, time_t *t) } if (m<0) { char *esc = esc_for_log(buf); log_warn(LD_GENERAL, "Got invalid RFC1123 time %s", esc); log_warn(LD_GENERAL, "Got invalid RFC1123 time %s: No such month", esc); tor_free(esc); return -1; } Loading Loading @@ -958,17 +958,17 @@ parse_iso_time(const char *cp, time_t *t) struct tm st_tm; #ifdef HAVE_STRPTIME if (!strptime(cp, "%Y-%m-%d %H:%M:%S", &st_tm)) { log_warn(LD_GENERAL, "Published time was unparseable"); return -1; log_warn(LD_GENERAL, "ISO time was unparseable by strptime"); return -1; } #else unsigned int year=0, month=0, day=0, hour=100, minute=100, second=100; if (sscanf(cp, "%u-%u-%u %u:%u:%u", &year, &month, &day, &hour, &minute, &second) < 6) { log_warn(LD_GENERAL, "Published time was unparseable"); return -1; log_warn(LD_GENERAL, "ISO time time was unparseable"); return -1; } if (year < 1970 || month < 1 || month > 12 || day < 1 || day > 31 || hour > 23 || minute > 59 || second > 61) { log_warn(LD_GENERAL, "Published time was nonsensical"); return -1; log_warn(LD_GENERAL, "ISO time was nonsensical"); return -1; } st_tm.tm_year = year-1900; st_tm.tm_mon = month-1; Loading Loading @@ -1876,7 +1876,7 @@ get_interface_address(int severity, uint32_t *addr) /* XXXX Can this be right on IPv6 clients? */ if (getsockname(sock, (struct sockaddr*)&my_addr, &my_addr_len)) { int e = tor_socket_errno(sock); log_fn(severity, LD_NET, "getsockname() failed: %s", log_fn(severity, LD_NET, "getsockname() to determine interface failed: %s", tor_socket_strerror(e)); goto err; } Loading src/or/config.c +3 −3 Original line number Diff line number Diff line Loading @@ -663,7 +663,7 @@ options_act_reversible(or_options_t *old_options, char **msg) SMARTLIST_FOREACH(new_listeners, connection_t *, conn, { log_notice(LD_NET, "Closing %s on %s:%d", log_notice(LD_NET, "Closing partially-constructed listener %s on %s:%d", conn_type_to_string(conn->type), conn->address, conn->port); connection_close_immediate(conn); connection_mark_for_close(conn); Loading Loading @@ -800,7 +800,7 @@ options_act(or_options_t *old_options) "Worker-related options changed. Rotating workers."); if (server_mode(options) && !server_mode(old_options)) { if (init_keys() < 0) { log_err(LD_GENERAL,"Error initializing keys; exiting"); log_err(LD_BUG,"Error initializing keys; exiting"); return -1; } server_has_changed_ip(); Loading Loading @@ -3473,7 +3473,7 @@ write_configuration_file(const char *fname, or_options_t *options) } log_notice(LD_CONFIG, "Renaming old configuration file to \"%s\"", fn_tmp); if (rename(fname, fn_tmp) < 0) { log_warn(LD_FS, "Couldn't rename \"%s\" to \"%s\": %s", log_warn(LD_FS, "Couldn't rename configuration file \"%s\" to \"%s\": %s", fname, fn_tmp, strerror(errno)); tor_free(fn_tmp); goto err; Loading Loading
doc/TODO +2 −0 Original line number Diff line number Diff line Loading @@ -298,6 +298,8 @@ Deferred from 0.1.2.x: - Implement Minor items for 0.1.2.x as time permits: - even if your torrc lists yourself in your myfamily line, don't list it in the descriptor. - Flesh out options_description array in src/or/config.c - Don't let 'newnym' be triggered more often than every n seconds. - change log_fn() to log() on notice/warn/err logs where we can. Loading
src/common/compat.c +3 −2 Original line number Diff line number Diff line Loading @@ -652,12 +652,13 @@ switch_id(char *user, char *group) } if (setgid(gr->gr_gid) != 0) { log_warn(LD_GENERAL,"Error setting GID: %s", strerror(errno)); log_warn(LD_GENERAL,"Error setting to configured GID: %s", strerror(errno)); return -1; } } else if (user) { if (setgid(pw->pw_gid) != 0) { log_warn(LD_GENERAL,"Error setting GID: %s", strerror(errno)); log_warn(LD_GENERAL,"Error setting to user GID: %s", strerror(errno)); return -1; } } Loading
src/common/crypto.c +1 −1 Original line number Diff line number Diff line Loading @@ -734,7 +734,7 @@ crypto_pk_public_checksig_digest(crypto_pk_env_t *env, const char *data, tor_assert(sig); if (crypto_digest(digest,data,datalen)<0) { log_warn(LD_CRYPTO, "couldn't compute digest"); log_warn(LD_BUG, "couldn't compute digest"); return -1; } r = crypto_pk_public_checksig(env,buf,sig,siglen); Loading
src/common/util.c +5 −5 Original line number Diff line number Diff line Loading @@ -907,7 +907,7 @@ parse_rfc1123_time(const char *buf, time_t *t) } if (m<0) { char *esc = esc_for_log(buf); log_warn(LD_GENERAL, "Got invalid RFC1123 time %s", esc); log_warn(LD_GENERAL, "Got invalid RFC1123 time %s: No such month", esc); tor_free(esc); return -1; } Loading Loading @@ -958,17 +958,17 @@ parse_iso_time(const char *cp, time_t *t) struct tm st_tm; #ifdef HAVE_STRPTIME if (!strptime(cp, "%Y-%m-%d %H:%M:%S", &st_tm)) { log_warn(LD_GENERAL, "Published time was unparseable"); return -1; log_warn(LD_GENERAL, "ISO time was unparseable by strptime"); return -1; } #else unsigned int year=0, month=0, day=0, hour=100, minute=100, second=100; if (sscanf(cp, "%u-%u-%u %u:%u:%u", &year, &month, &day, &hour, &minute, &second) < 6) { log_warn(LD_GENERAL, "Published time was unparseable"); return -1; log_warn(LD_GENERAL, "ISO time time was unparseable"); return -1; } if (year < 1970 || month < 1 || month > 12 || day < 1 || day > 31 || hour > 23 || minute > 59 || second > 61) { log_warn(LD_GENERAL, "Published time was nonsensical"); return -1; log_warn(LD_GENERAL, "ISO time was nonsensical"); return -1; } st_tm.tm_year = year-1900; st_tm.tm_mon = month-1; Loading Loading @@ -1876,7 +1876,7 @@ get_interface_address(int severity, uint32_t *addr) /* XXXX Can this be right on IPv6 clients? */ if (getsockname(sock, (struct sockaddr*)&my_addr, &my_addr_len)) { int e = tor_socket_errno(sock); log_fn(severity, LD_NET, "getsockname() failed: %s", log_fn(severity, LD_NET, "getsockname() to determine interface failed: %s", tor_socket_strerror(e)); goto err; } Loading
src/or/config.c +3 −3 Original line number Diff line number Diff line Loading @@ -663,7 +663,7 @@ options_act_reversible(or_options_t *old_options, char **msg) SMARTLIST_FOREACH(new_listeners, connection_t *, conn, { log_notice(LD_NET, "Closing %s on %s:%d", log_notice(LD_NET, "Closing partially-constructed listener %s on %s:%d", conn_type_to_string(conn->type), conn->address, conn->port); connection_close_immediate(conn); connection_mark_for_close(conn); Loading Loading @@ -800,7 +800,7 @@ options_act(or_options_t *old_options) "Worker-related options changed. Rotating workers."); if (server_mode(options) && !server_mode(old_options)) { if (init_keys() < 0) { log_err(LD_GENERAL,"Error initializing keys; exiting"); log_err(LD_BUG,"Error initializing keys; exiting"); return -1; } server_has_changed_ip(); Loading Loading @@ -3473,7 +3473,7 @@ write_configuration_file(const char *fname, or_options_t *options) } log_notice(LD_CONFIG, "Renaming old configuration file to \"%s\"", fn_tmp); if (rename(fname, fn_tmp) < 0) { log_warn(LD_FS, "Couldn't rename \"%s\" to \"%s\": %s", log_warn(LD_FS, "Couldn't rename configuration file \"%s\" to \"%s\": %s", fname, fn_tmp, strerror(errno)); tor_free(fn_tmp); goto err; Loading