Am 30.03.2016 um 19:28 schrieb Christopher Arndt:
Am 30.03.2016 um 18:53 schrieb Hermann Meyer:
I've set the fifo-path now to /tmp instead
working dir, to ensure that
"all" instances use the same fifo and have access to it.
Not that
it's a very common usage scenario, but won't that preclude
jalv.select being used by different users on the same system at the same
time? Also any user can control another user's jalv.select process. And
if you make the fifo file permissions more restrictive, you'll get
problems with stale files etc.
I think it would be better to determine the fifo path with something
like this (pseudo code) and set its permissions to 0600:
mkfifo use umask to set the file permission (-0022), so the resulting
permission is 0644, eg. rw-r--r--
means, other users cant control (write) your jalv.select instance.
If jalv.select cant write to a existing fifo, the fifo just get ignored,
so in a multi-user environment, you could start your own jalv.select,
even if the fifo isn't usable for you.
fifo_path =
getenv('JALV_SELECT_FIFO_PATH')
fifo_path = fifo_path if fifo_path else getenv('HOME') +
'/.jalv_select_fifo'
I like to have it in /tmp, because, for the case that jalv.select ended
unexpected, the fifo get deleted at lest when you shut down the machine.
In home, it may exist for ever, at least.
It's issues like these why I think DBus is a
better way to do IPC for
any but the most simple program, which is intended to run in a desktop
environment anyway.
Chris
Well, maybe DBus is a better solution, but as I said, I've never dealt
with it, . .
regards
hermann