Closed fredx181 closed 6 years ago
Why no reply ?
I simply haven't had time to try it or look into the issue. 0644 should give other users read access to the lock, but I guess what's happening is that it's able to see that the lock is free but not actually lock it. But as you say the file should probably be 0666. Could you create a PR for this with your fix?
Could you create a PR for this with your fix?
Hi PMunch, thanks for responding. However I'm certain about that it is required that /tmp/xlunch.lock should have permissions 0666 to be able to run from another user, I'm not really certain about the fix I found. It gives warning when running make: (but does compile well though)
gcc xlunch.c -o xlunch -lImlib2 -lX11 -O2 -s
xlunch.c: In function ‘main’:
xlunch.c:2310:16: warning: implicit declaration of function ‘umask’ [-Wimplicit-function-declaration]
old_mask = umask( 0 );
^~~~~
As I said earlier, C programming is not my thing, so I'll leave finding the correct fix up to you guys. When you have time of course :)
You were pretty close, just forgot to import the header for umask. Just pushed this fix now: https://github.com/Tomas-M/xlunch/commit/1c1fc28e1e65cf3bad373c0b3eb2d15b4d3ad5a0
Probably depends on how umask is set, for me it's:
When switching to another user, xlunch doesn't run (and doesn't show any error message)
I assume (looking at xlunch.c) it's intended that /tmp/xlunch.lock should have permissions 0666. But it has 0644 for me, resulting that it is not read/write for another user. From a web search I found solution by clearing the umask value first before creating /tmp/xlunch.lock.
(and bring it back to how it was after /tmp/xlunch.lock has been created) From line 2307 on, I changed to:
It works for me, xlunch.lock has permissions 0666 now, but I'm not sure if this the correct way to do it.
Fred