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

Cache the release tarball #185

Closed
wants to merge 2 commits into from
Closed

Conversation

chrismwendt
Copy link

Previously, the user would have to wait ~30s to re-download the release tarball if installation throws an error (e.g. because of relics from previous installations).

Now, the tarball is downloaded to a deterministic temp file and only re-downloaded if it doesn't exist yet or the checksum doesn't match.

Closes #184

@edolstra
Copy link
Member

Using a fixed-name directory in /tmp creates a potential security problem. Might be better to use $XDG_RUNTIME_DIR on Linux.

@chrismwendt
Copy link
Author

@edolstra What kind of security problem do you have in mind? It seems to me that the worst case would be where an attacker overwrites the install script in the unpacked release directory with an arbitrary executable.

$XDG_RUNTIME_DIR would avoid that threat, but is it present (and not set to something insecure like /tmp) on all platforms?

Using mkdir as stated in http://www.linuxsecurity.com/content/view/115462/151/ would work, but it seems rather difficult to make sure the release directory was created by the current user in the case where the release directory already exists.

How about copying the tarball to a secure directory (i.e. one created by mktemp -d) before computing the SHA and extracting? I made that change and pushed it as a commit to this PR.

@samueldr
Copy link
Member

samueldr commented Oct 10, 2018

[triage]

This is now part of the nix repository.

The PR would need to be re-done there.

And yes, as of today, the script still cleans up after itself.

@grahamc grahamc closed this Mar 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants