Commit 119af7b8 authored by Daniel Salzman's avatar Daniel Salzman

Merge branch 'inconsistent_log' into 'master'

Remove inconsistent and unnecessary quoting in log files

Closes #530

See merge request !790
parents 9041e138 3ef79308
......@@ -152,17 +152,17 @@ int proc_update_privileges(int uid, int gid)
if ((uid_t)uid != getuid() || (gid_t)gid != getgid()) {
if (setgroups(0, NULL) < 0) {
log_warning("failed to drop supplementary groups for "
"UID '%d' (%s)", getuid(), strerror(errno));
"UID %d (%s)", getuid(), strerror(errno));
}
# ifdef HAVE_INITGROUPS
struct passwd *pw;
if ((pw = getpwuid(uid)) == NULL) {
log_warning("failed to get passwd entry for UID '%d' (%s)",
log_warning("failed to get passwd entry for UID %d (%s)",
uid, strerror(errno));
} else {
if (initgroups(pw->pw_name, gid) < 0) {
log_warning("failed to set supplementary groups "
"for UID '%d' (%s)", uid, strerror(errno));
"for UID %d (%s)", uid, strerror(errno));
}
}
# endif /* HAVE_INITGROUPS */
......@@ -171,16 +171,16 @@ int proc_update_privileges(int uid, int gid)
/* Watch uid/gid. */
if ((gid_t)gid != getgid()) {
log_info("changing GID to '%d'", gid);
log_info("changing GID to %d", gid);
if (setregid(gid, gid) < 0) {
log_error("failed to change GID to '%d'", gid);
log_error("failed to change GID to %d", gid);
return KNOT_ERROR;
}
}
if ((uid_t)uid != getuid()) {
log_info("changing UID to '%d'", uid);
log_info("changing UID to %d", uid);
if (setreuid(uid, uid) < 0) {
log_error("failed to change UID to '%d'", uid);
log_error("failed to change UID to %d", uid);
return KNOT_ERROR;
}
}
......
......@@ -289,7 +289,7 @@ static int prepare_and_check_keys(const knot_dname_t *zone_name, bool nsec3_enab
algorithm_usage_t *u = &usage[algorithm];
if (nsec3_enabled && !is_nsec3_allowed(algorithm)) {
log_zone_warning(zone_name, "DNSSEC, key '%d' "
log_zone_warning(zone_name, "DNSSEC, key %d "
"cannot be used with NSEC3",
dnssec_key_get_keytag(key->key));
key->is_public = false;
......@@ -311,7 +311,7 @@ static int prepare_and_check_keys(const knot_dname_t *zone_name, bool nsec3_enab
if ((u->ksk_count == 0) != (u->zsk_count == 0)) {
u->is_stss = true;
log_zone_info(zone_name, "DNSSEC, Single-Type Signing "
"scheme enabled, algorithm '%d'", i);
"scheme enabled, algorithm %d", i);
}
}
......
......@@ -289,7 +289,7 @@ static void rrl_log_state(knotd_mod_t *mod, const struct sockaddr_storage *ss,
what = "enters";
}
knotd_mod_log(mod, LOG_NOTICE, "address '%s' class '%s' %s limiting",
knotd_mod_log(mod, LOG_NOTICE, "address %s, class %s, %s limiting",
addr_str, rrl_clsstr(cls), what);
}
......
......@@ -586,7 +586,7 @@ bool process_query_acl_check(conf_t *conf, const knot_dname_t *zone_name,
char *key_name = knot_dname_to_str_alloc(tsig.name);
log_zone_debug(zone_name,
"ACL, denied, action '%s', remote '%s', key %s%s%s",
"ACL, denied, action %s, remote %s, key %s%s%s",
(act != NULL) ? act->name : "query",
addr_str,
(key_name != NULL) ? "'" : "",
......
......@@ -203,13 +203,13 @@ static int server_init_iface(iface_t *new_if, struct sockaddr_storage *addr, int
udp_bind_flags |= NET_BIND_NONLOCAL;
sock = net_bound_socket(SOCK_DGRAM, (struct sockaddr *)addr, udp_bind_flags);
if (sock >= 0 && !warn_bind) {
log_warning("address '%s UDP' bound, but required nonlocal bind", addr_str);
log_warning("address %s UDP bound, but required nonlocal bind", addr_str);
warn_bind = true;
}
}
if (sock < 0) {
log_error("cannot bind address '%s' (%s)", addr_str,
log_error("cannot bind address %s (%s)", addr_str,
knot_strerror(sock));
server_deinit_iface(new_if);
return sock;
......@@ -236,12 +236,12 @@ static int server_init_iface(iface_t *new_if, struct sockaddr_storage *addr, int
tcp_bind_flags |= NET_BIND_NONLOCAL;
sock = net_bound_socket(SOCK_STREAM, (struct sockaddr *)addr, tcp_bind_flags);
if (sock >= 0) {
log_warning("address '%s TCP' bound, but required nonlocal bind", addr_str);
log_warning("address %s TCP bound, but required nonlocal bind", addr_str);
}
}
if (sock < 0) {
log_error("cannot bind address '%s' (%s)", addr_str,
log_error("cannot bind address %s (%s)", addr_str,
knot_strerror(sock));
server_deinit_iface(new_if);
return sock;
......@@ -256,7 +256,7 @@ static int server_init_iface(iface_t *new_if, struct sockaddr_storage *addr, int
/* Listen for incoming connections. */
ret = listen(sock, TCP_BACKLOG_SIZE);
if (ret < 0) {
log_error("failed to listen on TCP interface '%s'", addr_str);
log_error("failed to listen on TCP interface %s", addr_str);
server_deinit_iface(new_if);
return KNOT_ERROR;
}
......@@ -264,7 +264,7 @@ static int server_init_iface(iface_t *new_if, struct sockaddr_storage *addr, int
/* TCP Fast Open. */
ret = enable_fastopen(sock, TCP_BACKLOG_SIZE);
if (ret < 0) {
log_warning("failed to enable TCP Fast Open on '%s' (%s)",
log_warning("failed to enable TCP Fast Open on %s (%s)",
addr_str, knot_strerror(ret));
}
......@@ -280,7 +280,7 @@ static void remove_ifacelist(struct ref *p)
iface_t *n = NULL, *m = NULL;
WALK_LIST_DELSAFE(n, m, ifaces->u) {
sockaddr_tostr(addr_str, sizeof(addr_str), (struct sockaddr *)&n->addr);
log_info("removing interface '%s'", addr_str);
log_info("removing interface %s", addr_str);
server_remove_iface(n);
}
WALK_LIST_DELSAFE(n, m, ifaces->l) {
......@@ -340,7 +340,7 @@ static int reconfigure_sockets(conf_t *conf, server_t *s)
} else {
char addr_str[SOCKADDR_STRLEN] = { 0 };
sockaddr_tostr(addr_str, sizeof(addr_str), (struct sockaddr *)&addr);
log_info("binding to interface '%s'", addr_str);
log_info("binding to interface %s", addr_str);
/* Create new interface. */
m = malloc(sizeof(iface_t));
......
......@@ -82,7 +82,7 @@ static enum fdset_sweep_state tcp_sweep(fdset_t *set, int i, void *data)
if (getpeername(fd, (struct sockaddr*)&ss, &len) == 0) {
char addr_str[SOCKADDR_STRLEN] = {0};
sockaddr_tostr(addr_str, sizeof(addr_str), (struct sockaddr *)&ss);
log_notice("TCP, terminated inactive client, address '%s'", addr_str);
log_notice("TCP, terminated inactive client, address %s", addr_str);
}
close(fd);
......@@ -135,7 +135,7 @@ static int tcp_handle(tcp_context_t *tcp, int fd,
if (ret == KNOT_EAGAIN) {
char addr_str[SOCKADDR_STRLEN] = {0};
sockaddr_tostr(addr_str, sizeof(addr_str), (struct sockaddr *)&ss);
log_warning("TCP, connection timed out, address '%s'",
log_warning("TCP, connection timed out, address %s",
addr_str);
}
return KNOT_ECONNREFUSED;
......
......@@ -534,7 +534,7 @@ int zone_master_try(conf_t *conf, zone_t *zone, zone_master_cb callback,
}
if (!success) {
log_zone_warning(zone->name, "%s, remote '%s' not usable",
log_zone_warning(zone->name, "%s, remote %s not usable",
err_str, conf_str(&masters));
}
......
......@@ -98,7 +98,7 @@ void khost_clean(kdig_params_t *params)
static int parse_server(const char *value, list_t *servers, const char *def_port)
{
if (params_parse_server(value, servers, def_port) != KNOT_EOK) {
ERR("invalid server '%s'\n", value);
ERR("invalid server %s\n", value);
return KNOT_EINVAL;
}
......@@ -133,7 +133,7 @@ static int parse_name(const char *value, list_t *queries, const query_t *conf)
// Check for correct address.
if (reverse == NULL) {
ERR("invalid IPv4/IPv6 address '%s'\n", value);
ERR("invalid IPv4/IPv6 address %s\n", value);
return KNOT_EINVAL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment