]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
For systems without open_memstream(3) warn that /tmp needs to exit
authorRoy Marples <roy@marples.name>
Wed, 27 May 2020 15:52:01 +0000 (15:52 +0000)
committerRoy Marples <roy@marples.name>
Wed, 27 May 2020 15:52:01 +0000 (15:52 +0000)
Inside the privsep users home directory.

configure
src/script.c

index 73be11e6ea05a1e03287ff7f8cca7d674b817f2b..e82be8782e5ed8ae7c47359ed0cde1ecb6bce52e 100755 (executable)
--- a/configure
+++ b/configure
@@ -903,6 +903,8 @@ EOF
 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
index 1e7e1291029a2414c8a180a71b27ae6a124159ea..e592f6f094775906974bf0db14b7857a0be64948 100644 (file)
@@ -252,8 +252,10 @@ make_env(struct dhcpcd_ctx *ctx, const struct interface *ifp,
 
        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) {