LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   IPC fails between user process and root process (https://www.linuxquestions.org/questions/linux-newbie-8/ipc-fails-between-user-process-and-root-process-671494/)

zaryab 09-22-2008 12:07 AM

IPC fails between user process and root process
 
I am using a CGI process to spawn a new process using execl system call. Both the CGI and the spawned processes are owned by user "www". The spawned process need to communicate with a system process owned by "root". The user "www" has lower privileges than the "root".

I have tried pipes and msg queues for IPC between the root process and the www process, but unfortunately both fail.

Am I doing something wrong? Generally speaking can a process with lower privilege send messages to a higher privilege process or to root process in Linux? If yes, is there a method that I am unaware of.

Thanks,
Zaryab

pinniped 09-22-2008 01:25 AM

Pipes have permissions, so it is a matter of setting the permissions correctly. Be extremely careful passing data like this to a root-owned process; it opens up the system like WinDuhs.

An alternative is to use UNIX sockets (but you still need to assume that data coming into the root side cannot be trusted).

Are you sure there's no other way to get data without a root process?


All times are GMT -5. The time now is 06:29 PM.