juliangruber / vipe

Pipe in and out of $EDITOR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow setting temporary directory path

grantwest opened this issue · comments

A potential use case for vipe is editing an encrypted file; decrypt | vipe | encrypt

Currently vipe always saves the temporary file to /tmp/ which on many systems is a tmpfs. However, tmpfs can be swapped thus resulting in sensitive data being written to disk. To solve this we can create a ramfs which cannot be swapped, but we would need to be able to configure vipe to use this directory. I imagine we could pass in a temporary directory something like this:

decrypt | vipe -t /myramdisk | encrypt

That sounds like a good addition for this use case. I think the patch should be relatively straight forward. Do you want to give it a stab?