/tmp folder conflicts in multi user setup
Hey, i wanted to use dash2dock animated in my gnome environment where i have a sub user. But one of the user always get "can't access /tmp directory: permission denied" or something like that.
So i think what is happening is that the two instances of the extension are trying to access a folder in /tmp/ (/tmp/dash2dock for example) but only the first instance is allowed to use it.
Maybe you could implement a new naming for that folder like "Dash2dock-$username" to avoid conflicts. I initially wanted to make a PR since it look like a quick fix, but i did'nt found how to do that. Better to let better hands do it.
Thanks for your time :)
full error is: Gio.IOErrorNum: Error opening "/tmp/trash-dash2dock-lite.desktop". Permission denied.
Translated from french, but here is the file making trouble
https://github.com/icedman/dash2dock-lite/blob/deec5e018fec4f92e983d904edc43526f631711a/dock.js#L838C9-L838C80
Look like this line is a good suspect, maybe you should use a subfolder like /tmp/dash2dock-username/, store it in a environment variable or something and use for every /tmp/ related functions.
Like:
const path = process.env.baseTmpPath + "/filename"
or
import config from "./config.js";
const path = config.baseTmpPath + "/filename"
just a suggestion
Thanks for the suggestion. I pushed a fix for this using uuid. To have the same solution as my other extension search-light which had the same problem. Please check. Thanks again.
Thanks for the quick answer, just checked your fix.
I didn't tested it yet, but look like there is some others reference to the /tmp folder that wasn't fixed like the line I shared in my last message.
So unless I'm missing something and everything is fixed with your commit (tell me), I could take a deeper look at your code tomorrow, now I know how you are fixing the issue, I'll try to find other /tmp paths and replace them with the UUID variation.
The other reference to tmp is the blurred background which shouldn't crash the dash app. Maybe there are others that I forget.