This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Add [e]dit command#20
Open
krathalan wants to merge 1 commit intodylanaraps:masterfrom
krathalan:master
Open
Conversation
Contributor
Author
|
If you don't like the usage of |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This pull request adds an [e]dit command to
pash, allowing easy editing of password files.I understand your reluctance to use temporary files (leak in
/proc?); however, I can't really think of a better way to do this apart from using thesread pass "Enter password"code frompw_add, but then editing multi-line password files becomes problematic/cumbersome/impossible.A good solution would be to open a shell variable as a file in an editor, which works, but then saving the edited text back to the shell variable is what I can't figure out how to do.
Without this patch, I would assume the current solution to editing password files is to decrypt, edit, and re-encrypt manually, which is, at best, worst than this solution due to also having to manually delete the unencrypted password file. Additionally,
/tmpis atmpfsmount on many Linux distributions, which makes recovery of the unencrypted password file more difficult than editing it on a regular file system.