dash2dock-lite icon indicating copy to clipboard operation
dash2dock-lite copied to clipboard

/tmp folder conflicts in multi user setup

Open iyarsius opened this issue 11 months ago • 5 comments

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 :)

iyarsius avatar Jan 31 '25 15:01 iyarsius

full error is: Gio.IOErrorNum: Error opening "/tmp/trash-dash2dock-lite.desktop". Permission denied.

Translated from french, but here is the file making trouble

iyarsius avatar Jan 31 '25 15:01 iyarsius

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

iyarsius avatar Jan 31 '25 16:01 iyarsius

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.

icedman avatar Feb 01 '25 01:02 icedman

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.

iyarsius avatar Feb 01 '25 12:02 iyarsius

The other reference to tmp is the blurred background which shouldn't crash the dash app. Maybe there are others that I forget.

icedman avatar Feb 02 '25 10:02 icedman