diff options
author | ehaupt <ehaupt@FreeBSD.org> | 2015-07-09 13:47:32 +0800 |
---|---|---|
committer | ehaupt <ehaupt@FreeBSD.org> | 2015-07-09 13:47:32 +0800 |
commit | c23aa0cf33de4abf38fe8492aa2fdf714f482f06 (patch) | |
tree | 6107aef88d00870440839ac4e0635f3ebe9859c8 /shells/bash | |
parent | 28cb05e16bca60410f95c4b408205b5439ad078d (diff) | |
download | freebsd-ports-gnome-c23aa0cf33de4abf38fe8492aa2fdf714f482f06.tar.gz freebsd-ports-gnome-c23aa0cf33de4abf38fe8492aa2fdf714f482f06.tar.zst freebsd-ports-gnome-c23aa0cf33de4abf38fe8492aa2fdf714f482f06.zip |
Scripts like https://github.com/henricj/scripts/blob/master/stir.sh often
generate a bunch of,
cannot make pipe for process substitution: File exists
errors.
The problem lies with colliding pipe names.
The code in sh_mktmpname() in lib/sh/tmpfile.c uses a combination of things like
the current time, the PID, and an incrementing counter. Since the child PIDs
tend to be sequential (barring kern.randompid=1), there are collisions.
Fix this problem without rewriting upstream code by defining USE_MKTEMP=1 to
use the mktemp(3) code of bash.
FreeBSD's mktemp() is not nearly as bad as the bash default and isn't
brain-damaged like some platforms (which is likely why the bash code tries to
do it's own thing). In FreeBSD, "mktemp(3)" it uses arc4random to pick one of
62 symbols for each "X".
Submitted by: Henric Jungheim <software@henric.org>
Diffstat (limited to 'shells/bash')
-rw-r--r-- | shells/bash/Makefile | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/shells/bash/Makefile b/shells/bash/Makefile index d7f093b5d92b..c1cee5f376bc 100644 --- a/shells/bash/Makefile +++ b/shells/bash/Makefile @@ -4,7 +4,7 @@ PORTNAME= bash PATCHLEVEL= 39 PORTVERSION= 4.3.${PATCHLEVEL:S/^0//g} -PORTREVISION?= 0 +PORTREVISION?= 1 CATEGORIES= shells MASTER_SITES= GNU/${PORTNAME} DISTNAME= ${PORTNAME}-${PORTVERSION:R} @@ -54,6 +54,8 @@ CONFIGURE_ARGS+= --without-bash-malloc \ --disable-rpath \ --enable-disabled-builtins +CFLAGS+= -DUSE_MKTEMP=1 + .if empty(PKGNAMESUFFIX) CONFLICTS+= bash-static-[0-9]* .else |