changeset 5271:8fb09d31d388 draft

For systems without open_memstream(3) warn that /tmp needs to exit Inside the privsep users home directory.
author Roy Marples <roy@marples.name>
date Wed, 27 May 2020 15:52:01 +0000
parents be03c967ee2a
children 97e87c65302e
files configure src/script.c
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Wed May 27 15:49:40 2020 +0000
+++ b/configure	Wed May 27 15:52:01 2020 +0000
@@ -903,6 +903,8 @@
 fi
 if [ "$OPEN_MEMSTREAM" = yes ]; then
 	echo "#define	HAVE_OPEN_MEMSTREAM" >>$CONFIG_H
+elif [ "$PRIVSEP" = yes ]; then
+	echo "WARNING: Ensure that /tmp exists in the privsep users chroot"
 fi
 
 if [ -z "$PIDFILE_LOCK" ]; then
--- a/src/script.c	Wed May 27 15:49:40 2020 +0000
+++ b/src/script.c	Wed May 27 15:52:01 2020 +0000
@@ -252,8 +252,10 @@
 
 	fp = NULL;
 	tmpfd = mkstemp(tmpfile);
-	if (tmpfd == -1)
-		goto eexit;
+	if (tmpfd == -1) {
+		logerr("%s: mkstemp", __func__);
+		return -1;
+	}
 	unlink(tmpfile);
 	fp = fdopen(tmpfd, "w+");
 	if (fp == NULL) {