michael-lazar / rtv

Browse Reddit from your terminal
MIT License
4.65k stars 278 forks source link

soft-code application data path (it's hard-coded to ~/.local/share/rtv) #666

Closed ghost closed 5 years ago

ghost commented 5 years ago

Is your feature request related to a problem? Please describe. The application data path is hard-coded to ~/.local/share/rtv. When that path is a symbolic link to the user's preferred location, firejail breaks due to a bug in firejail (it cannot handle symbolic links). The secure workaround for that bug is to force the app to access the non-symbolic path. But ~/.local/share/rtv is hard-coded.

The insecure workaround is for firejail to allow access to all files, which comes at the cost of security. This workaround works with no changes to RTV.

Describe the solution you'd like Firejail's bug is not RTV's problem. But it's still wrong to hard-code paths. Users should always be in control of how their filesystem is organized.

michael-lazar commented 5 years ago

It's not hardcoded, that path is defined by your $XDG_DATA_HOME

https://github.com/michael-lazar/rtv/blob/master/rtv/config.py#L23

ghost commented 5 years ago

I suspected that, but then I did env | grep XDG and got nothing useful.

(edit) but indeed it works to set that variable. Sorry for the needless issue. I also see that it's documented in the man page so i'll close the ticket