Open
Conversation
Otherwise it's a pain to debug.
I'm trying to run homu in a container where it's installed (as root) to `/usr`, but we run as non-root. This follows general best practice that apps shouldn't be able to mutate their code. However, we were trying to write the ssh key to `/usr`. Fix this by generating a tempfile. This is also more secure as it closes a prior race condition where we'd write the file, then chown it. Also rework things so that we only write the key once at startup. By using `NamedTemporaryFile`, it'll be `unlink()ed` once the object goes out of scope. To keep it alive long enough, pass it as an argument to the "main loop".
Author
|
@Manishearth would you mind reviewing this? |
Contributor
|
I'm a bit swamped, but I'll queue it up. |
| import subprocess | ||
| from .git_helper import SSH_KEY_FILE | ||
| import shlex | ||
| import tempfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.