Skip to content

[minor] rubash unconditionally creates $TMPDIR/var/tmp at startup (even for -c ':') — GNU creates nothing; pollutes ls/glob of cwd when TMPDIR=cwd #328

Closed

Description

@caomengxuan666

Found by ecosweep3 lane (pure-bash-bible corpus run; sections 028/081/082 showed a stray var line in rubash-side ls/glob output; carrier release build of 6106961).

Reproducer

rm -rf t && mkdir -p t
TMPDIR=$PWD/t rubash.exe -c ':'
find t
# rubash: t/var, t/var/tmp created
# GNU bash 5.3.0: creates nothing for -c ':'

GNU bash touches $TMPDIR only when it actually needs a scratch file (here-doc to command, etc.) and uses $TMPDIR directly, never a var/tmp subtree. The unconditional $TMPDIR/var/tmp creation at startup is visible to every script that lists its TMPDIR/cwd (our pbb harness sets TMPDIR=workdir, so for f in * and ls printed a phantom var).

Artifacts: target/issue-suites/results/ecosweep3/pbb/{gnu,rub}/028-*.d (GNU side has only home/, rubash side has home/ + var/).

Activity

  1. added
    bug
    on Sep 29, 2026
  2. added a commit that references this issue on Sep 29, 2026
  3. caomengxuan666 commented on Sep 29, 2026

    @caomengxuan666
    MemberAuthor

    Fixed by wt14/pbbfix (f71c2aa, master): startup unconditionally ran ensure_var_tmp_dir. GNU touches TMPDIR only when a temp file is actually needed. Now lazily materialized at the /var/tmp mapping site on first use. TMPDIR=x rubash -c : creates nothing; /var/tmp use materializes; procsub/heredoc with empty TMPDIR work; a clean cwd without TMPDIR creates nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions