Commit 3ef79308 authored by Filip Siroky's avatar Filip Siroky Committed by Daniel Salzman

Remove inconsistent and unnecessary quoting in log files

parent 9041e138
...@@ -152,17 +152,17 @@ int proc_update_privileges(int uid, int gid) ...@@ -152,17 +152,17 @@ int proc_update_privileges(int uid, int gid)
if ((uid_t)uid != getuid() || (gid_t)gid != getgid()) { if ((uid_t)uid != getuid() || (gid_t)gid != getgid()) {
if (setgroups(0, NULL) < 0) { if (setgroups(0, NULL) < 0) {
log_warning("failed to drop supplementary groups for " log_warning("failed to drop supplementary groups for "
"UID '%d' (%s)", getuid(), strerror(errno)); "UID %d (%s)", getuid(), strerror(errno));
} }
# ifdef HAVE_INITGROUPS # ifdef HAVE_INITGROUPS
struct passwd *pw; struct passwd *pw;
if ((pw = getpwuid(uid)) == NULL) { 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)); uid, strerror(errno));
} else { } else {
if (initgroups(pw->pw_name, gid) < 0) { if (initgroups(pw->pw_name, gid) < 0) {
log_warning("failed to set supplementary groups " log_warning("failed to set supplementary groups "
"for UID '%d' (%s)", uid, strerror(errno)); "for UID %d (%s)", uid, strerror(errno));
} }
} }
# endif /* HAVE_INITGROUPS */ # endif /* HAVE_INITGROUPS */
...@@ -171,16 +171,16 @@ int proc_update_privileges(int uid, int gid) ...@@ -171,16 +171,16 @@ int proc_update_privileges(int uid, int gid)
/* Watch uid/gid. */ /* Watch uid/gid. */
if ((gid_t)gid != getgid()) { if ((gid_t)gid != getgid()) {
log_info("changing GID to '%d'", gid); log_info("changing GID to %d", gid);
if (setregid(gid, gid) < 0) { 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; return KNOT_ERROR;
} }
} }
if ((uid_t)uid != getuid()) { if ((uid_t)uid != getuid()) {
log_info("changing UID to '%d'", uid); log_info("changing UID to %d", uid);
if (setreuid(uid, uid) < 0) { 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; return KNOT_ERROR;
} }
} }
......
...@@ -289,7 +289,7 @@ static int prepare_and_check_keys(const knot_dname_t *zone_name, bool nsec3_enab ...@@ -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]; algorithm_usage_t *u = &usage[algorithm];
if (nsec3_enabled && !is_nsec3_allowed(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", "cannot be used with NSEC3",
dnssec_key_get_keytag(key->key)); dnssec_key_get_keytag(key->key));
key->is_public = false; key->is_public = false;
...@@ -311,7 +311,7 @@ static int prepare_and_check_keys(const knot_dname_t *zone_name, bool nsec3_enab ...@@ -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)) { if ((u->ksk_count == 0) != (u->zsk_count == 0)) {
u->is_stss = true; u->is_stss = true;
log_zone_info(zone_name, "DNSSEC, Single-Type Signing " 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, ...@@ -289,7 +289,7 @@ static void rrl_log_state(knotd_mod_t *mod, const struct sockaddr_storage *ss,
what = "enters"; 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); addr_str, rrl_clsstr(cls), what);
} }
......
...@@ -586,7 +586,7 @@ bool process_query_acl_check(conf_t *conf, const knot_dname_t *zone_name, ...@@ -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); char *key_name = knot_dname_to_str_alloc(tsig.name);
log_zone_debug(zone_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", (act != NULL) ? act->name : "query",
addr_str, addr_str,
(key_name != NULL) ? "'" : "", (key_name != NULL) ? "'" : "",
......
...@@ -203,13 +203,13 @@ static int server_init_iface(iface_t *new_if, struct sockaddr_storage *addr, int ...@@ -203,13 +203,13 @@ static int server_init_iface(iface_t *new_if, struct sockaddr_storage *addr, int
udp_bind_flags |= NET_BIND_NONLOCAL; udp_bind_flags |= NET_BIND_NONLOCAL;
sock = net_bound_socket(SOCK_DGRAM, (struct sockaddr *)addr, udp_bind_flags); sock = net_bound_socket(SOCK_DGRAM, (struct sockaddr *)addr, udp_bind_flags);
if (sock >= 0 && !warn_bind) { 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; warn_bind = true;
} }
} }
if (sock < 0) { if (sock < 0) {
log_error("cannot bind address '%s' (%s)", addr_str, log_error("cannot bind address %s (%s)", addr_str,
knot_strerror(sock)); knot_strerror(sock));
server_deinit_iface(new_if); server_deinit_iface(new_if);
return sock; return sock;
...@@ -236,12 +236,12 @@ static int server_init_iface(iface_t *new_if, struct sockaddr_storage *addr, int ...@@ -236,12 +236,12 @@ static int server_init_iface(iface_t *new_if, struct sockaddr_storage *addr, int
tcp_bind_flags |= NET_BIND_NONLOCAL; tcp_bind_flags |= NET_BIND_NONLOCAL;
sock = net_bound_socket(SOCK_STREAM, (struct sockaddr *)addr, tcp_bind_flags); sock = net_bound_socket(SOCK_STREAM, (struct sockaddr *)addr, tcp_bind_flags);
if (sock >= 0) { 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) { if (sock < 0) {
log_error("cannot bind address '%s' (%s)", addr_str, log_error("cannot bind address %s (%s)", addr_str,
knot_strerror(sock)); knot_strerror(sock));
server_deinit_iface(new_if); server_deinit_iface(new_if);
return sock; return sock;
...@@ -256,7 +256,7 @@ static int server_init_iface(iface_t *new_if, struct sockaddr_storage *addr, int ...@@ -256,7 +256,7 @@ static int server_init_iface(iface_t *new_if, struct sockaddr_storage *addr, int
/* Listen for incoming connections. */ /* Listen for incoming connections. */
ret = listen(sock, TCP_BACKLOG_SIZE); ret = listen(sock, TCP_BACKLOG_SIZE);
if (ret < 0) { 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); server_deinit_iface(new_if);
return KNOT_ERROR; return KNOT_ERROR;
} }
...@@ -264,7 +264,7 @@ static int server_init_iface(iface_t *new_if, struct sockaddr_storage *addr, int ...@@ -264,7 +264,7 @@ static int server_init_iface(iface_t *new_if, struct sockaddr_storage *addr, int
/* TCP Fast Open. */ /* TCP Fast Open. */
ret = enable_fastopen(sock, TCP_BACKLOG_SIZE); ret = enable_fastopen(sock, TCP_BACKLOG_SIZE);
if (ret < 0) { 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)); addr_str, knot_strerror(ret));
} }
...@@ -280,7 +280,7 @@ static void remove_ifacelist(struct ref *p) ...@@ -280,7 +280,7 @@ static void remove_ifacelist(struct ref *p)
iface_t *n = NULL, *m = NULL; iface_t *n = NULL, *m = NULL;
WALK_LIST_DELSAFE(n, m, ifaces->u) { WALK_LIST_DELSAFE(n, m, ifaces->u) {
sockaddr_tostr(addr_str, sizeof(addr_str), (struct sockaddr *)&n->addr); 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); server_remove_iface(n);
} }
WALK_LIST_DELSAFE(n, m, ifaces->l) { WALK_LIST_DELSAFE(n, m, ifaces->l) {
...@@ -340,7 +340,7 @@ static int reconfigure_sockets(conf_t *conf, server_t *s) ...@@ -340,7 +340,7 @@ static int reconfigure_sockets(conf_t *conf, server_t *s)
} else { } else {
char addr_str[SOCKADDR_STRLEN] = { 0 }; char addr_str[SOCKADDR_STRLEN] = { 0 };
sockaddr_tostr(addr_str, sizeof(addr_str), (struct sockaddr *)&addr); 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. */ /* Create new interface. */
m = malloc(sizeof(iface_t)); m = malloc(sizeof(iface_t));
......
...@@ -82,7 +82,7 @@ static enum fdset_sweep_state tcp_sweep(fdset_t *set, int i, void *data) ...@@ -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) { if (getpeername(fd, (struct sockaddr*)&ss, &len) == 0) {
char addr_str[SOCKADDR_STRLEN] = {0}; char addr_str[SOCKADDR_STRLEN] = {0};
sockaddr_tostr(addr_str, sizeof(addr_str), (struct sockaddr *)&ss); 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); close(fd);
...@@ -135,7 +135,7 @@ static int tcp_handle(tcp_context_t *tcp, int fd, ...@@ -135,7 +135,7 @@ static int tcp_handle(tcp_context_t *tcp, int fd,
if (ret == KNOT_EAGAIN) { if (ret == KNOT_EAGAIN) {
char addr_str[SOCKADDR_STRLEN] = {0}; char addr_str[SOCKADDR_STRLEN] = {0};
sockaddr_tostr(addr_str, sizeof(addr_str), (struct sockaddr *)&ss); 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); addr_str);
} }
return KNOT_ECONNREFUSED; return KNOT_ECONNREFUSED;
......
...@@ -534,7 +534,7 @@ int zone_master_try(conf_t *conf, zone_t *zone, zone_master_cb callback, ...@@ -534,7 +534,7 @@ int zone_master_try(conf_t *conf, zone_t *zone, zone_master_cb callback,
} }
if (!success) { 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)); err_str, conf_str(&masters));
} }
......
...@@ -98,7 +98,7 @@ void khost_clean(kdig_params_t *params) ...@@ -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) static int parse_server(const char *value, list_t *servers, const char *def_port)
{ {
if (params_parse_server(value, servers, def_port) != KNOT_EOK) { 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; return KNOT_EINVAL;
} }
...@@ -133,7 +133,7 @@ static int parse_name(const char *value, list_t *queries, const query_t *conf) ...@@ -133,7 +133,7 @@ static int parse_name(const char *value, list_t *queries, const query_t *conf)
// Check for correct address. // Check for correct address.
if (reverse == NULL) { if (reverse == NULL) {
ERR("invalid IPv4/IPv6 address '%s'\n", value); ERR("invalid IPv4/IPv6 address %s\n", value);
return KNOT_EINVAL; 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