From 3f8b1832bf65379ee25c3d5c4f53438807c35e5f Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Sat, 3 Oct 2020 17:17:45 +0100 Subject: [PATCH] Don't log backticks. --- src/dhcp.c | 8 ++++---- src/dhcp6.c | 8 ++++---- src/dhcpcd.c | 8 ++++---- src/if-options.c | 22 +++++++++++----------- src/privsep.c | 6 +++--- src/script.c | 2 +- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/dhcp.c b/src/dhcp.c index 623b21bc..10671c6c 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -1164,7 +1164,7 @@ read_lease(struct interface *ifp, struct bootp **bootp) logdebugx("reading standard input"); sbytes = read(fileno(stdin), buf.buf, sizeof(buf.buf)); } else { - logdebugx("%s: reading lease `%s'", + logdebugx("%s: reading lease: %s", ifp->name, state->leasefile); sbytes = dhcp_readfile(ifp->ctx, state->leasefile, buf.buf, sizeof(buf.buf)); @@ -2314,7 +2314,7 @@ dhcp_bind(struct interface *ifp) state->state = DHS_BOUND; if (!state->lease.frominfo && !(ifo->options & (DHCPCD_INFORM | DHCPCD_STATIC))) { - logdebugx("%s: writing lease `%s'", + logdebugx("%s: writing lease: %s", ifp->name, state->leasefile); if (dhcp_writefile(ifp->ctx, state->leasefile, 0640, state->new, state->new_len) == -1) @@ -2865,10 +2865,10 @@ log_dhcp(int loglevel, const char *msg, print_string(sname, sizeof(sname), OT_STRING | OT_DOMAIN, bootp->sname, sizeof(bootp->sname)); if (a == NULL) - logmessage(loglevel, "%s: %s %s %s `%s'", + logmessage(loglevel, "%s: %s %s %s %s", ifp->name, msg, tfrom, inet_ntoa(addr), sname); else - logmessage(loglevel, "%s: %s %s %s %s `%s'", + logmessage(loglevel, "%s: %s %s %s %s %s", ifp->name, msg, a, tfrom, inet_ntoa(addr), sname); } else { if (r != 0) { diff --git a/src/dhcp6.c b/src/dhcp6.c index 49412782..0dbf8333 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -2588,7 +2588,7 @@ dhcp6_readlease(struct interface *ifp, int validate) logdebugx("reading standard input"); bytes = read(fileno(stdin), buf.buf, sizeof(buf.buf)); } else { - logdebugx("%s: reading lease `%s'", + logdebugx("%s: reading lease: %s", ifp->name, state->leasefile); bytes = dhcp_readfile(ifp->ctx, state->leasefile, buf.buf, sizeof(buf.buf)); @@ -3218,7 +3218,7 @@ dhcp6_bind(struct interface *ifp, const char *op, const char *sfrom) ifp->name, state->expire); rt_build(ifp->ctx, AF_INET6); if (!confirmed && !timedout) { - logdebugx("%s: writing lease `%s'", + logdebugx("%s: writing lease: %s", ifp->name, state->leasefile); if (dhcp_writefile(ifp->ctx, state->leasefile, 0640, state->new, state->new_len) == -1) @@ -3657,12 +3657,12 @@ dhcp6_recvmsg(struct dhcpcd_ctx *ctx, struct msghdr *msg, struct ipv6_addr *ia) "/tmp/dhcp6.reply%d.raw", replyn++); fd = open(fname, O_RDONLY, 0); if (fd == -1) { - logerr("%s: open `%s'", __func__, fname); + logerr("%s: open: %s", __func__, fname); return; } tlen = read(fd, tbuf, sizeof(tbuf)); if (tlen == -1) - logerr("%s: read `%s'", __func__, fname); + logerr("%s: read: %s", __func__, fname); close(fd); /* Copy across ServerID so we can work with our own server. */ diff --git a/src/dhcpcd.c b/src/dhcpcd.c index 55bbff0d..604a08ca 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -698,7 +698,7 @@ dhcpcd_reportssid(struct interface *ifp) return; } - loginfox("%s: connected to Access Point `%s'", ifp->name, pssid); + loginfox("%s: connected to Access Point: %s", ifp->name, pssid); } void @@ -2066,7 +2066,7 @@ printpidfile: } if (chdir("/") == -1) - logerr("%s: chdir `/'", __func__); + logerr("%s: chdir: /", __func__); /* Freeing allocated addresses from dumping leases can trigger * eloop removals as well, so init here. */ @@ -2223,9 +2223,9 @@ printpidfile: if (!(ctx.options & DHCPCD_TEST)) { /* Ensure we have the needed directories */ if (mkdir(DBDIR, 0750) == -1 && errno != EEXIST) - logerr("%s: mkdir `%s'", __func__, DBDIR); + logerr("%s: mkdir: %s", __func__, DBDIR); if (mkdir(RUNDIR, 0755) == -1 && errno != EEXIST) - logerr("%s: mkdir `%s'", __func__, RUNDIR); + logerr("%s: mkdir: %s", __func__, RUNDIR); if ((pid = pidfile_lock(ctx.pidfile)) != 0) { if (pid == -1) logerr("%s: pidfile_lock: %s", diff --git a/src/if-options.c b/src/if-options.c index f21ff4b8..9b2c74fb 100644 --- a/src/if-options.c +++ b/src/if-options.c @@ -460,13 +460,13 @@ parse_addr(struct in_addr *addr, struct in_addr *net, const char *arg) if (e != 0 || (net != NULL && inet_cidrtoaddr((int)i, net) != 0)) { - logerrx("`%s' is not a valid CIDR", p); + logerrx("invalid CIDR: %s", p); return -1; } } if (addr != NULL && inet_aton(arg, addr) == 0) { - logerrx("`%s' is not a valid IP address", arg); + logerrx("invalid IP address: %s", arg); return -1; } if (p != NULL) @@ -788,7 +788,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo, make_option_mask(d, dl, od, odl, no, arg, -1) != 0 || make_option_mask(d, dl, od, odl, reject, arg, -1) != 0) { - logerrx("unknown option `%s'", arg); + logerrx("unknown option: %s", arg); return -1; } break; @@ -800,7 +800,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo, make_option_mask(d, dl, od, odl, request, arg, -1) != 0 || make_option_mask(d, dl, od, odl, require, arg, -1) != 0) { - logerrx("unknown option `%s'", arg); + logerrx("unknown option: %s", arg); return -1; } break; @@ -1017,7 +1017,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo, else if (strcmp(arg, "disable") == 0) ifo->fqdn = FQDN_DISABLE; else { - logerrx("invalid value `%s' for FQDN", arg); + logerrx("invalid FQDN value: %s", arg); return -1; } break; @@ -1063,7 +1063,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo, make_option_mask(d, dl, od, odl, require, arg, -1) != 0 || make_option_mask(d, dl, od, odl, no, arg, 1) != 0) { - logerrx("unknown option `%s'", arg); + logerrx("unknown option: %s", arg); return -1; } break; @@ -1076,7 +1076,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo, make_option_mask(d, dl, od, odl, no, arg, -1) != 0 || make_option_mask(d, dl, od, odl, reject, arg, -1) != 0) { - logerrx("unknown option `%s'", arg); + logerrx("unknown option: %s", arg); return -1; } break; @@ -1313,10 +1313,10 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo, ifo->dstmask, arg, 2) != 0) { if (errno == EINVAL) - logerrx("option `%s' does not take" - " an IPv4 address", arg); + logerrx("option does not take" + " an IPv4 address: %s", arg); else - logerrx("unknown option `%s'", arg); + logerrx("unknown option: %s", arg); return -1; } break; @@ -1799,7 +1799,7 @@ err_sla: return -1; } if (l && !(t & (OT_STRING | OT_BINHEX))) { - logwarnx("ignoring length for type `%s'", arg); + logwarnx("ignoring length for type: %s", arg); l = 0; } if (t & OT_ARRAY && t & (OT_STRING | OT_BINHEX) && diff --git a/src/privsep.c b/src/privsep.c index b54b1b7a..d1c74f4a 100644 --- a/src/privsep.c +++ b/src/privsep.c @@ -117,12 +117,12 @@ ps_dropprivs(struct dhcpcd_ctx *ctx) struct passwd *pw = ctx->ps_user; if (!(ctx->options & DHCPCD_FORKED)) - logdebugx("chrooting to `%s' as %s", pw->pw_dir, pw->pw_name); + logdebugx("chrooting as %s to %s", pw->pw_name, pw->pw_dir); if (chroot(pw->pw_dir) == -1 && (errno != EPERM || ctx->options & DHCPCD_FORKED)) - logerr("%s: chroot `%s'", __func__, pw->pw_dir); + logerr("%s: chroot: %s", __func__, pw->pw_dir); if (chdir("/") == -1) - logerr("%s: chdir `/'", __func__); + logerr("%s: chdir: /", __func__); if ((setgroups(1, &pw->pw_gid) == -1 || setgid(pw->pw_gid) == -1 || diff --git a/src/script.c b/src/script.c index 059e9ab2..d611a644 100644 --- a/src/script.c +++ b/src/script.c @@ -736,7 +736,7 @@ script_runreason(const struct interface *ifp, const char *reason) argv[0] = ctx->script; argv[1] = NULL; - logdebugx("%s: executing `%s' %s", ifp->name, argv[0], reason); + logdebugx("%s: executing: %s %s", ifp->name, argv[0], reason); #ifdef PRIVSEP if (ctx->options & DHCPCD_PRIVSEP) {