I'm writing a simple daemon that needs root privileges to work. I also want to write a client to control the daemon(only a few functions) - this client for regular users. But I have a problem with permissions. I took advantage of the shared memory (IPC) created by (permissions 660):
shmget(SHMKEY, SHMSIZE, IPC_CREAT | 0660)
I set "chown root:mydaemongroup", chmod +x for /usr/bin/daemonsrv and /usb/bin/daemonclient , added users to the mydaemongroup and relogin - but daemonclient run with normal user stil can't get SHM segment - "Error getting SHM segment.: Permission denied". I run daemonsrv ofcourse with root privileges. When run on the same user everything works fine. What methods are used to create such a client? Can I use shared memory or eg UNIX Domain Sockets? What am I doing wrong with shared memory? I would like it to be safe and follow the UNIX rules. Regards K. :)