]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
privsep: RLIMIT_FSIZE works fine on pledge and capsicum
authorRoy Marples <roy@marples.name>
Wed, 10 Jun 2020 07:30:28 +0000 (08:30 +0100)
committerRoy Marples <roy@marples.name>
Wed, 10 Jun 2020 07:30:28 +0000 (08:30 +0100)
If you don't use the dhcpcd logfile option.
Duh.

src/privsep.c

index ec8e4cc1ac9ddeb6ba8facbce2deb0c347fd287e..b2f3b3096c55e368feaba1d3e4e9d255576425dd 100644 (file)
@@ -163,19 +163,14 @@ ps_dropprivs(struct dhcpcd_ctx *ctx)
 #endif
        }
 
-#if !defined(HAVE_CAPSICUM) && !defined(HAVE_PLEDGE)
-       /*
-        * Prohibit large files
-        * Cannot offload this to the privilged actioneer because
-        * only the master process has access to it.
-        */
+       /* Prohibit writing to files.
+        * Obviously this won't work if we are using a logfile. */
        if (ctx->logfile == NULL) {
                if (setrlimit(RLIMIT_FSIZE, &rzero) == -1) {
                        logerr("setrlimit RLIMIT_FSIZE");
                        return -1;
                }
        }
-#endif
 
 #ifdef RLIMIT_NPROC
        /* Prohibit forks */