[PATCH] Keep existing file extension for edit command

Thomas Spurden thomas at spurden.name
Thu Sep 6 20:58:35 CEST 2018


Excerpts from Jason A. Donenfeld's message of September 5, 2018 11:31 pm:
> You know one thing that's occurred to me is what if you have a file
> called "Yahoo/donenfeld.jason", as, say, a username. Now .jason will
> appear as the extension. So maybe you only allow for 3-letter
> extensions? But what about "shmoe.joe"? So I'm not sure this approach
> is the right one to take...
> 

That is a little concerning, yes. As Amir says the behaviour would seem
unpredictable unless the implementation is understood.

Would someone do something like setting EDITOR to "cmd /c start" or similar on
Windows? That would cause exciting behaviour for a password called "example.com"!

I'm sure there is a similar way to get xdg-open to accidentally do exciting things
too. Maybe if pass had never added .txt it would be OK, but changing it now does
sound more worrying than I had initially thought.

Maybe a command line option to edit (e.g. --keep-extension/-k) would be better?
Although that would mean either I would have to remember to use it every time on
my document store or making my wrapper script more complicated...

Also not all file extensions are 3 letters long anyway, e.g. I have some xlsx
files in my store (modern MS office excel).


More information about the Password-Store mailing list