Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nix wipes top-level $TEMPDIR, disallowing other processes to create temporary files #11929

Open
iggy-da opened this issue Nov 21, 2024 · 0 comments
Labels

Comments

@iggy-da
Copy link

iggy-da commented Nov 21, 2024

The hook _nix_shell_clean_tmpdir may execute rm -rf $TEMPDIR. Observed on Ubuntu 24.04 and MacOS when using nix with direnv.

This happens when this tmpDir variable is assigned the $TEMPDIR path itself, rather than a temp subdirectory.

The $TEMPDIR is then rm -rfed here

(R"(_nix_shell_clean_tmpdir() { command rm -rf %1%; };)"s

This means processes trying to create temporary files inside $TEMPDIR (such as, for example, docker), will fail.

Fix: This tmpDir variable should never be allowed to be the top-level $TEMPDIR.

@iggy-da iggy-da added the bug label Nov 21, 2024
@iggy-da iggy-da changed the title Nix wipes $TEMPDIR Nix wipes top-level $TEMPDIR, disallowing other processes to create temporary files Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant