> When I run "stack ghci", an attempt is made to create a temporary
> directory named:
> in which various temporary artefacts are stored. The parent
> directory is created with permissions (0777 & ~umask).
> Security issues aside, this can't work reliably on a multi-user
> system. Does anyone know whether this is something peculiar
> to my FreeBSD setup, or a systemic issue with "stack ghci"?
> I don't see the same behaviour with "stack script", though
> if I create a script to run in "/tmp", then ghc is, somewhat
> unexpectely, executed with "-i/tmp/", which also has security
On Sun, Oct 06, 2019 at 11:06:26AM -0600, Michael Sloan wrote:
> You can override the temporary directory by setting the TMPDIR environment
> To have this apply to all of your stack invocations, consider putting an
> alias in your .bashrc, something like:
> $ alias stack="TMPDIR=~/.local/tmp ~/.local/bin/stack"
 Note mktemp(1) is not covered by the Single Unix Specification,
so portability is not assured, the below should work on at least
BSD Systems and Linux.
> > I don't see the same behaviour with "stack script", though
> > if I create a script to run in "/tmp", then ghc is, somewhat
> > unexpectely, executed with "-i/tmp/", which also has security
> > implications...
But I probably still need to take care to avoid building single-use
throw-away scripts for "stack script" in /tmp: