Make more safe_str usage happen for new logs in command.c

This commit is contained in:
Nick Mathewson 2011-09-28 13:19:55 -04:00
parent 23664fb3b8
commit ce102f7a59

View file

@ -859,7 +859,7 @@ command_process_cert_cell(var_cell_t *cell, or_connection_t *conn)
do { \ do { \
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, \ log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, \
"Received a bad CERT cell from %s:%d: %s", \ "Received a bad CERT cell from %s:%d: %s", \
conn->_base.address, conn->_base.port, (s)); \ safe_str(conn->_base.address), conn->_base.port, (s)); \
connection_mark_for_close(TO_CONN(conn)); \ connection_mark_for_close(TO_CONN(conn)); \
goto err; \ goto err; \
} while (0) } while (0)
@ -906,7 +906,7 @@ command_process_cert_cell(var_cell_t *cell, or_connection_t *conn)
if (!cert) { if (!cert) {
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL,
"Received undecodable certificate in CERT cell from %s:%d", "Received undecodable certificate in CERT cell from %s:%d",
conn->_base.address, conn->_base.port); safe_str(conn->_base.address), conn->_base.port);
} else { } else {
if (cert_type == OR_CERT_TYPE_TLS_LINK && !link_cert) if (cert_type == OR_CERT_TYPE_TLS_LINK && !link_cert)
link_cert = cert; link_cert = cert;
@ -952,7 +952,7 @@ command_process_cert_cell(var_cell_t *cell, or_connection_t *conn)
ERR("Problem setting or checking peer id"); ERR("Problem setting or checking peer id");
log_info(LD_OR, "Got some good certifcates from %s:%d: Authenticated it.", log_info(LD_OR, "Got some good certifcates from %s:%d: Authenticated it.",
conn->_base.address, conn->_base.port); safe_str(conn->_base.address), conn->_base.port);
conn->handshake_state->id_cert = id_cert; conn->handshake_state->id_cert = id_cert;
id_cert = NULL; id_cert = NULL;
@ -971,7 +971,7 @@ command_process_cert_cell(var_cell_t *cell, or_connection_t *conn)
log_info(LD_OR, "Got some good certifcates from %s:%d: " log_info(LD_OR, "Got some good certifcates from %s:%d: "
"Waiting for AUTHENTICATE.", "Waiting for AUTHENTICATE.",
conn->_base.address, conn->_base.port); safe_str(conn->_base.address), conn->_base.port);
/* XXXX check more stuff? */ /* XXXX check more stuff? */
id_cert = auth_cert = NULL; id_cert = auth_cert = NULL;
@ -1002,7 +1002,7 @@ command_process_auth_challenge_cell(var_cell_t *cell, or_connection_t *conn)
do { \ do { \
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, \ log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, \
"Received a bad AUTH_CHALLENGE cell from %s:%d: %s", \ "Received a bad AUTH_CHALLENGE cell from %s:%d: %s", \
conn->_base.address, conn->_base.port, (s)); \ safe_str(conn->_base.address), conn->_base.port, (s)); \
connection_mark_for_close(TO_CONN(conn)); \ connection_mark_for_close(TO_CONN(conn)); \
return; \ return; \
} while (0) } while (0)
@ -1042,7 +1042,7 @@ command_process_auth_challenge_cell(var_cell_t *cell, or_connection_t *conn)
if (use_type && public_server_mode(get_options())) { if (use_type && public_server_mode(get_options())) {
log_info(LD_OR, "Got an AUTH_CHALLENGE cell from %s:%d: Sending " log_info(LD_OR, "Got an AUTH_CHALLENGE cell from %s:%d: Sending "
"authentication", "authentication",
conn->_base.address, conn->_base.port); safe_str(conn->_base.address), conn->_base.port);
if (connection_or_send_authenticate_cell(conn, use_type) < 0) { if (connection_or_send_authenticate_cell(conn, use_type) < 0) {
log_warn(LD_OR, "Couldn't send authenticate cell"); log_warn(LD_OR, "Couldn't send authenticate cell");
@ -1056,7 +1056,7 @@ command_process_auth_challenge_cell(var_cell_t *cell, or_connection_t *conn)
} }
} else { } else {
log_info(LD_OR, "Got an AUTH_CHALLENGE cell from %s:%d: Not authenticating", log_info(LD_OR, "Got an AUTH_CHALLENGE cell from %s:%d: Not authenticating",
conn->_base.address, conn->_base.port); safe_str(conn->_base.address), conn->_base.port);
} }
#undef ERR #undef ERR
} }
@ -1080,7 +1080,7 @@ command_process_authenticate_cell(var_cell_t *cell, or_connection_t *conn)
do { \ do { \
log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, \ log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, \
"Received a bad AUTHETNICATE cell from %s:%d: %s", \ "Received a bad AUTHETNICATE cell from %s:%d: %s", \
conn->_base.address, conn->_base.port, (s)); \ safe_str(conn->_base.address), conn->_base.port, (s)); \
connection_mark_for_close(TO_CONN(conn)); \ connection_mark_for_close(TO_CONN(conn)); \
return; \ return; \
} while (0) } while (0)
@ -1185,7 +1185,7 @@ command_process_authenticate_cell(var_cell_t *cell, or_connection_t *conn)
0); 0);
log_info(LD_OR, "Got an AUTHENTICATE cell from %s:%d: Looks good.", log_info(LD_OR, "Got an AUTHENTICATE cell from %s:%d: Looks good.",
conn->_base.address, conn->_base.port); safe_str(conn->_base.address), conn->_base.port);
} }
#undef ERR #undef ERR