[pass] [PATCH 0/3] Bugfix for Mac's diskutil

Caleb Marble cm at marblenix.com
Mon Jun 2 02:47:14 CEST 2014

There is an annoying bug on Mac. When you edit a file with `pass edit`, upon
saving the pass command will not release the mounted ramdisk, leaving an extra
mounted disk in `diskutil list`. This can be quite distressing when editing
multiple files in `pass` and suddenly you have 10 entries in `diskutil list`.

The fix is simple. Move cleanup_tmp to it's own function in
src/platform/darwin.sh and make ramdisk a global variable so cleanup_tmp can
reference it. Then in src/password-store.sh add a reference to cleanup_tmp to
the cmd_edit function. The problem is that cleanup_tmp does not exist in other
platforms, so an additional check is needed that the user is running on a Mac.
What follows is the patch I came up with. It passes all tests on my Mac but I am
unsure how this change will affect other users. Please test and reply.

I've also included a new test: tests/t0600-darwin-test-diskutil.sh, though
writing tests is not my forte, criticism is appreciated.

Caleb Marble (3):
  Move cleanup_tmp to it's own function
  Call cleanup_tmp for Mac users
  Added test for mounting and unmounting ramdisks on Mac

 src/password-store.sh               |    3 +++
 src/platform/darwin.sh              |   17 +++++++------
 tests/t0600-darwin-test-diskutil.sh |   48 +++++++++++++++++++++++++++++++++++
 3 files changed, 60 insertions(+), 8 deletions(-)
 create mode 100755 tests/t0600-darwin-test-diskutil.sh


More information about the Password-Store mailing list