99designs / keyring

Go library providing a uniform interface across a range of secure credential stores
MIT License
576 stars 135 forks source link

Bug in expanding filenames including tildes `~` #108

Closed agargiulo closed 2 years ago

agargiulo commented 2 years ago

https://github.com/99designs/keyring/blob/master/file.go#L43

After finding the code linked above, I noticed that it doesn't account for ~accountName and will do bad things when you try

[~] $ aws-vault --backend=file --file-dir=~agargiulo/thisCanNotWorkCanIt  list
aws-vault: error: list: mkdir /Users/agargiuloagargiulo: permission denied

But I'm not sure how to go about fixing this. It's nice to support ~/ expansion but ~agargiulo is 100% not the same as /Users/agargiuloagargiulo