Php initializes extensions as root

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jose da Silva

    Php initializes extensions as root

    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

    #2
    Re: Php initializes extensions as root

    Jose da Silva wrote:
    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().

    Comment

    • Colin McKinnon

      #3
      Re: Php initializes extensions as root

      Jose da Silva wrote:
      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.

      Comment

      Working...