LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-31-2012, 12:36 PM   #1
player107
LQ Newbie
 
Registered: Jan 2012
Posts: 3

Rep: Reputation: Disabled
UserID process C PHP and signals


Hello all
I want to create a process in C that has to answer php requests.
I choose to communicate with named pipes between php and my process. Php is UID 33 and GID 33. When I launch my process I can launch it either with my UID (1000) or root. I must say that I added myself in the GID 33 group of php/apache. (groups command tells its done)
To communicate between PHP and the process I want to use SIGUSR1 to tell the process that there is a request from php so the process won't wait for php request
I noticed that in php when I call posix_kill with SIGUSR1 it says that I don't have permissions. So I added posix_setuid(1000) in php but it doesn't help : no permission.
Then I had the idea to posix_setuid(33) in the process when launched as root but it doesn't help neither : no permission.
Would some one explain me what's wrong ?
Thanks !
 
Old 02-02-2012, 09:30 AM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Welcome to Linux Questions. From reading your post, I don't think that this is a security issue, but one of programming. Specifically, what are the suitable methods for IPC (Inter Process Communication). Off hand, my initial guess is that you are running into the permissions limitations of setuid, in which executable functions are normally prohibited from script (non compiled) applications. Consequently this may not be the best approach.

I have used the report function and given the recommendation that this thread be moved to the programming forum to give it the attention it deserves.
 
Old 02-02-2012, 10:41 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Moved: This thread is more suitable in the Programming forum and has been moved accordingly to help your thread/question get the exposure it deserves.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
process hangs up upon receiving more than 8 or 10 signals in centos-5 vdx Programming 3 07-25-2011 08:31 AM
Rexec and sending signals to the remote process. oyhaare Programming 0 03-15-2011 08:06 AM
(process:280): GLib-WARNING **:getpwuid_r():failed due to unknown userid(0) cre84j Linux - Security 7 11-05-2010 06:42 PM
signals in Linux process aayu09 Linux - Software 1 04-07-2010 12:45 AM
Sending SIGKILL/signals to process and all children? thecake Linux - Newbie 1 12-22-2008 04:50 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration