Add compatibility for busybox mktemp

Busybox's mktemp requires at least six X's in the template, causing
the current sed --in-place check to fail because the file does not
exist. This change adds additional X's to mktemp templates that do
not already have at least six X's in them.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Quentin Zdanis <zdanisq@gmail.com>
Closes #11269
This commit is contained in:
qzdanis 2020-12-03 13:01:16 -05:00 committed by GitHub
parent 0aacde2e9a
commit 9109b89cd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -4,7 +4,7 @@ dnl #
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_SED], [ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_SED], [
AC_REQUIRE([AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_SED])dnl
AC_CACHE_CHECK([for sed --in-place], [ac_cv_inplace], [ AC_CACHE_CHECK([for sed --in-place], [ac_cv_inplace], [
tmpfile=$(mktemp conftest.XXX) tmpfile=$(mktemp conftest.XXXXXX)
echo foo >$tmpfile echo foo >$tmpfile
AS_IF([$SED --in-place 's#foo#bar#' $tmpfile 2>/dev/null], AS_IF([$SED --in-place 's#foo#bar#' $tmpfile 2>/dev/null],
[ac_cv_inplace="--in-place"], [ac_cv_inplace="--in-place"],

View File

@ -53,7 +53,7 @@ deb-utils: deb-local rpm-utils-initramfs
## Arguments need to be passed to dh_shlibdeps. Alien provides no mechanism ## Arguments need to be passed to dh_shlibdeps. Alien provides no mechanism
## to do this, so we install a shim onto the path which calls the real ## to do this, so we install a shim onto the path which calls the real
## dh_shlibdeps with the required arguments. ## dh_shlibdeps with the required arguments.
path_prepend=`mktemp -d /tmp/intercept.XXX`; \ path_prepend=`mktemp -d /tmp/intercept.XXXXXX`; \
echo "#$(SHELL)" > $${path_prepend}/dh_shlibdeps; \ echo "#$(SHELL)" > $${path_prepend}/dh_shlibdeps; \
echo "`which dh_shlibdeps` -- \ echo "`which dh_shlibdeps` -- \
-xlibuutil3linux -xlibnvpair3linux -xlibzfs4linux -xlibzpool4linux" \ -xlibuutil3linux -xlibnvpair3linux -xlibzfs4linux -xlibzpool4linux" \

View File

@ -265,7 +265,7 @@ constrain_path() {
create_links "$DIRS" "$ZFSTEST_FILES" create_links "$DIRS" "$ZFSTEST_FILES"
else else
# Constrained path set to /var/tmp/constrained_path.* # Constrained path set to /var/tmp/constrained_path.*
SYSTEMDIR=${SYSTEMDIR:-/var/tmp/constrained_path.XXXX} SYSTEMDIR=${SYSTEMDIR:-/var/tmp/constrained_path.XXXXXX}
STF_PATH=$(mktemp -d "$SYSTEMDIR") STF_PATH=$(mktemp -d "$SYSTEMDIR")
STF_PATH_REMOVE="yes" STF_PATH_REMOVE="yes"
STF_MISSING_BIN="" STF_MISSING_BIN=""
@ -663,11 +663,11 @@ export PATH=$STF_PATH
if [ "$UNAME" = "FreeBSD" ] ; then if [ "$UNAME" = "FreeBSD" ] ; then
mkdir -p "$FILEDIR" || true mkdir -p "$FILEDIR" || true
RESULTS_FILE=$(mktemp -u "${FILEDIR}/zts-results.XXXX") RESULTS_FILE=$(mktemp -u "${FILEDIR}/zts-results.XXXXXX")
REPORT_FILE=$(mktemp -u "${FILEDIR}/zts-report.XXXX") REPORT_FILE=$(mktemp -u "${FILEDIR}/zts-report.XXXXXX")
else else
RESULTS_FILE=$(mktemp -u -t zts-results.XXXX -p "$FILEDIR") RESULTS_FILE=$(mktemp -u -t zts-results.XXXXXX -p "$FILEDIR")
REPORT_FILE=$(mktemp -u -t zts-report.XXXX -p "$FILEDIR") REPORT_FILE=$(mktemp -u -t zts-report.XXXXXX -p "$FILEDIR")
fi fi
# #