Connecting Tech Pros Worldwide Help | Site Map

Php initializes extensions as root

Jose da Silva
Guest
 
Posts: n/a
#1: Sep 7 '06
Hi there people,

I'm having a problem, i've designed an php extension, that uses shared
memory iteraction.

Altought, Php is initializing the extension as root, leaving the shared
memory with wrong permissions, as is created as root process.

Is there any way to initialize extensions, not as root?

Thanks
Jose Silva

Chung Leong
Guest
 
Posts: n/a
#2: Sep 7 '06

re: Php initializes extensions as root


Jose da Silva wrote:
Quote:
Hi there people,
>
I'm having a problem, i've designed an php extension, that uses shared
memory iteraction.
>
Altought, Php is initializing the extension as root, leaving the shared
memory with wrong permissions, as is created as root process.
>
Is there any way to initialize extensions, not as root?
>
Thanks
Jose Silva
A simple solution would be to do the allocation in PHP_RINIT().

Colin McKinnon
Guest
 
Posts: n/a
#3: Sep 7 '06

re: Php initializes extensions as root


Jose da Silva wrote:
Quote:
Hi there people,
>
I'm having a problem, i've designed an php extension, that uses shared
memory iteraction.
>
Altought, Php is initializing the extension as root, leaving the shared
memory with wrong permissions, as is created as root process.
>
Is there any way to initialize extensions, not as root?
>
probably not if you want to listen on reserved ports.

Maybe I'm being dim here, but why not set the permissions with the mode
parameter when you create the shm (I assume you're using shm_open) ?

C.
Closed Thread