biox / pa

a simple password manager. encryption via age, written in portable posix shell
https://passwordass.org
Other
505 stars 21 forks source link

setting PA_DIR can create recursive password dirs #47

Open biox opened 5 hours ago

biox commented 5 hours ago

example & reproduction:

$ export PA_DIR=hewo
$ pa add hi
Generate a password? [y/N]: y
Saved 'hi' to the store.

$ cd hewo
$ pa add hi
Generate a password? [y/N]: y
Saved 'hi' to the store.

$ cd .. && tree hewo
hewo
├── hewo
│   └── hi.age
└── hi.age

this is... not intended. haha

arcxio commented 4 hours ago

if a user sets up a relative path as PA_DIR I don't think there's anything we can do about it

edit: I suppose we can check if it's relative and whine about it with some warning every time, but it would be a bit obnoxious for my taste because I'd assume the user knows what they're doing

biox commented 4 hours ago

yea idk, maybe a test for / and hint at an absolute path if there isn't a slash.