Connecting Tech Pros Worldwide Help | Site Map

sending signals to processes as a different user than owner using php

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 09:19 AM
rs035
Guest
 
Posts: n/a
Default sending signals to processes as a different user than owner using php

good morning, everybody
i know, it seems more to be a problem according to unix but i got it while
developing software with php:
i have 2 different users on a hp-ux machine that execute php scripts. they
are both in the same group.
these php scripts start background processes, i can communicate with using
signals (sending with posix_kill, starting background processes via
pcntl_fork).
so i got severel background processes owned by my 2 users.
the problem is i want to send signals as one of my 2 users to all my php
background processes no matter who of my 2 users is the owner. is it
possible other than using external tools like sudo?
i'm using:
PHP 4.3.4 (cgi) (built: Aug 18 2004 15:37:46)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies

compiled with:
../configure' '--prefix=/usr/local/php-cgi-saprfc' '--enable-calendar'
'--enable-filepro' '--with-gd' '--with-jpeg-dir=/usr/local'
'--with-zlib-dir=/usr/local' '--without-mysql' '--enable-sysvsem'
'--enable-sysvshm' '--with-pgsql=/usr/local/pgsql' '--enable-trans-sid'
'--with-cpdflib=/usr/local' '--enable-sockets' '--with-ncurses=/usr/local'
'--disable-shared' '--with-tsrm-pthreads' '--with-saprfc=/usr/local/rfcsdk'
'--enable-pcntl

thanks
rolf



  #2  
Old July 17th, 2005, 09:19 AM
Colin McKinnon
Guest
 
Posts: n/a
Default Re: sending signals to processes as a different user than owner using php

rs035 wrote:
[color=blue]
> i have 2 different users on a hp-ux machine that execute php scripts. they
> are both in the same group.
> these php scripts start background processes, i can communicate with using
> signals (sending with posix_kill, starting background processes via
> pcntl_fork).
> so i got severel background processes owned by my 2 users.
> the problem is i want to send signals as one of my 2 users to all my php
> background processes no matter who of my 2 users is the owner. is it
> possible other than using external tools like sudo?[/color]

Sort of, but you really should understand the security model of Unix before
you start stretching the rules.

The only obvious solution I see within the constraints you've specified
would be to put the two users into their own group, then setup a program to
run setuid as the other user but only executable by the isolated group.
e.g.:
-rwsr-xr-- userA php_script_group signal_as_userA
-rwsr-xr-- userB php_script_group signal_as_userB

HTH

C.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.