PDA

View Full Version : Communicating between processes owned by system and user



sperry
9th January 2010, 00:32
Background, this is for a Mac and eventually Linux and Windows project. I have QT 4.6 and can control the version of QT used on the endpoints.

Working on a design where I will have some data that will be managed by a program running with elevated privileges, potentially root (or its equivalent, sorry coming from a Unix background). I would like to have some processes talk to this data manager, things like a UI to update data. Ideally these run with no real privileges, so anyone on the box can use them. My first thought was to use QLocalServer but this does not seem to work due to permission issues.

So imagine something my my_manager running as root (or a user account generated for this purpose like httpd for Apache) along with a UI program run by some user account and potentially a little binary or two kicked off by cron or its equivalent.

Do I need to switch to a TCP (or UDP) solution even though all of the components will only ever run on the same machine?

It looks like Trolltech (Nokia, whichever) is working on improving the IPC support in the framework, but it is not ready for real use. Is there something I have missed?

Tanuki-no Torigava
9th January 2010, 08:25
Have a look at QtDBus module. This is good IPC but *NIX/Max specific. I don't know if it already works on MS Windows. Anyway IPC is highly dependent from the OS but you can try something universal like sockets or pipes.

wysota
12th January 2010, 01:13
My first thought was to use QLocalServer but this does not seem to work due to permission issues.
What permission issues exactly? This should be working. You may need to chmod the resulting pipe to allow non-owning users to write to the pipe.


Is there something I have missed?
You can use QSharedMemory as well but a local socket is a good approach as well.