FauxFaux / zrs

faster 'z': jump to frecently used directories
MIT License
25 stars 1 forks source link

data file can end up owned by root during `sudo -s` #1

Closed FauxFaux closed 5 years ago

FauxFaux commented 5 years ago

The data file is rewritten as the "effective user", it should probably be "maintained".

When you switch back to your real user, you can now no-longer access the data file, sometimes. I don't have exact reproduction steps from memory.

Alternatively, we could "derive" the user from the home directory? Or ignore umasks on purpose? Almost certainly just "maintain" is better. Or detect root / euid, and then do some magic? Maybe we should ignore umasks and go ultra-private instead (like ~/.ssh).