Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add [e]dit command #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add [e]dit command #20

wants to merge 1 commit into from

Conversation

krathalan
Copy link
Contributor

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 the sread pass "Enter password" code from pw_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, /tmp is a tmpfs mount on many Linux distributions, which makes recovery of the unencrypted password file more difficult than editing it on a regular file system.

@krathalan
Copy link
Contributor Author

If you don't like the usage of mktemp, it would be possible to mimic its behavior by generating a random string using tr and dd, like in pw_add.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant