Get calling user ID in PHP setuid script
Posted
by Bart van Heukelom
on Stack Overflow
See other posts from Stack Overflow
or by Bart van Heukelom
Published on 2010-05-01T16:15:49Z
Indexed on
2010/05/01
16:17 UTC
Read the original article
Hit count: 378
I have a PHP script on Linux in which the sticky bit is set, so it gets executed as the file owner. How can I get the user id of the calling process, for authorization purposes?
Context: I have two applications on a server, and want one to request some info from the other. For this reason the other offers a script with setuid, but I want to make sure it can only be called by the one.
© Stack Overflow or respective owner