]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Don't log backticks.
authorRoy Marples <roy@marples.name>
Sat, 3 Oct 2020 16:17:45 +0000 (17:17 +0100)
committerRoy Marples <roy@marples.name>
Sat, 3 Oct 2020 16:17:45 +0000 (17:17 +0100)
src/dhcp.c
src/dhcp6.c
src/dhcpcd.c
src/if-options.c
src/privsep.c
src/script.c

index 623b21bc0d01f881f2587a583c068c51cd35bfc7..10671c6c6a39812af9ed97268d23c47aa68a70e5 100644 (file)
@@ -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) {
index 49412782a17dd116a2a03fca82fc587309a5cc72..0dbf83332a428880bb73525be8431c2a82225d84 100644 (file)
@@ -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. */
index 55bbff0d38f1da579c19ae29a24e3a169c65f081..604a08ca7f188a3610b5837fe14a057f7a0a28c3 100644 (file)
@@ -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",
index f21ff4b8502390f2d8c5880337753f1cc64f64a9..9b2c74fb695d86db274c11b3063c037f7a27d691 100644 (file)
@@ -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) &&
index b54b1b7a787d3f549ee12e32746e146013b2a723..d1c74f4ae9d9581512c773a0b9cacecac201349b 100644 (file)
@@ -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 ||
index 059e9ab2262117def2063aa928fe741a08ff50d2..d611a644c65b7caa75b2db7ff83ce1a07d1481ec 100644 (file)
@@ -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) {