From: Roy Marples Date: Wed, 27 May 2020 15:52:01 +0000 (+0000) Subject: For systems without open_memstream(3) warn that /tmp needs to exit X-Git-Tag: v9.1.0~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e322db49157418dc360cbacad1b849152969062c;p=thirdparty%2Fdhcpcd.git For systems without open_memstream(3) warn that /tmp needs to exit Inside the privsep users home directory. --- diff --git a/configure b/configure index 73be11e6..e82be878 100755 --- 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 diff --git a/src/script.c b/src/script.c index 1e7e1291..e592f6f0 100644 --- a/src/script.c +++ b/src/script.c @@ -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) {