1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Fix process substitutions printing PIDs in profile scripts (#395)

- sh/args.c: A process substitution run in a profile script may print
  its PID as if it was a command spawned with '&'. Reproducer:
     $ cat /tmp/env
     true >(false)
     $ ENV=/tmp/env ksh
     [1]	730227
     $
  This bug is fixed by turning off the SH_PROFILE state while running
  a process substitution.

- sh/subshell.c: The SH_INTERACTIVE fix in 3525535e renders the extra
  check for SH_PROFILE redundant, so it has been removed.

- tests/io.sh: Update the procsub PIDs test to also check the result
  after using process substitution in a profile script.
This commit is contained in:
Johnothan King 2021-12-22 05:25:26 -08:00 committed by Martijn Dekker
parent 740a24a456
commit 3785a0685c
5 changed files with 13 additions and 6 deletions

View file

@ -666,7 +666,7 @@ Sfio_t *sh_subshell(Shell_t *shp,Shnode_t *t, volatile int flags, int comsub)
{
if(comsub)
sigblock(SIGTSTP);
else if(!sh_isstate(SH_PROFILE))
else
sh_subfork();
}
#endif