changeset 5337:e1edd674d9ae draft

privsep: Disable RLIMIT_FSIZE when using the logfile option We cannot offload it to the root process either because not all sandboxes have access to that..... Really need to fix syslog so that it starts before dhcpcd.
author Roy Marples <roy@marples.name>
date Wed, 10 Jun 2020 07:04:29 +0100
parents 4e761ef5ee93
children c97954e1f986
files src/privsep.c
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/privsep.c	Wed Jun 10 06:35:54 2020 +0100
+++ b/src/privsep.c	Wed Jun 10 07:04:29 2020 +0100
@@ -164,10 +164,16 @@
 	}
 
 #if !defined(HAVE_CAPSICUM) && !defined(HAVE_PLEDGE)
-	/* Prohibit large files */
-	if (setrlimit(RLIMIT_FSIZE, &rzero) == -1) {
-		logerr("setrlimit RLIMIT_FSIZE");
-		return -1;
+	/*
+	 * Prohibit large files
+	 * Cannot offload this to the privilged actioneer because
+	 * only the master process has access to it.
+	 */
+	if (ctx->logfile == NULL) {
+		if (setrlimit(RLIMIT_FSIZE, &rzero) == -1) {
+			logerr("setrlimit RLIMIT_FSIZE");
+			return -1;
+		}
 	}
 #endif