]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix installing the embedded config as a file.
authorRoy Marples <roy@marples.name>
Thu, 4 Jun 2020 20:49:37 +0000 (21:49 +0100)
committerRoy Marples <roy@marples.name>
Thu, 4 Jun 2020 20:49:37 +0000 (21:49 +0100)
src/if-options.c
src/privsep-root.c

index 212e71d8478b71dccdbd26933859291164e723c1..3dde04bf33c6c2a45b84bf437bb35dcd8f48cd1c 100644 (file)
@@ -2366,8 +2366,8 @@ read_config(struct dhcpcd_ctx *ctx,
                        return ifo;
                }
                if (buf[buflen - 1] != '\0') {
-                       if (buflen < sizeof(buf) - 1)
-                               bulen++;
+                       if ((size_t)buflen < sizeof(buf) - 1)
+                               buflen++;
                        buf[buflen - 1] = '\0';
                }
 #else
index fdf4385681f82684d618904ef92965dc2ac5f396..512dfcc03720d7c2e369157c0bee8cc5b3f6176f 100644 (file)
@@ -297,6 +297,10 @@ ps_root_validpath(const struct dhcpcd_ctx *ctx, uint16_t cmd, const char *path)
                return false;
 
        if (cmd == PS_READFILE) {
+#ifdef EMBEDDED_CONFIG
+               if (strcmp(ctx->cffile, EMBEDDED_CONFIG) == 0)
+                       return true;
+#endif
                if (strcmp(ctx->cffile, path) == 0)
                        return true;
        }