/[ports]
ViewVC logotype

Revision 391614


Jump to revision: Previous Next
Author: ehaupt
Date: Thu Jul 9 05:47:32 2015 UTC (8 years, 5 months ago)
Changed paths: 1
Log Message:
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>


Changed paths

Path Details
Directoryhead/shells/bash/Makefile modified , text changed

  ViewVC Help
Powered by ViewVC 1.1.27