Skip to content

socket_bind creates file in /tmp, but www-data has no permissions to it #28

@fearr1

Description

@fearr1

Server.php -> openIPCSocket() -> socket_bind -> creates a file in /tmp but www-data has no permissions to use it. This happened when i tried to send IPC data from an action of a website to the WebSocket server. This change did the trick:

FROM
if (socket_bind($this->icpSocket, $ipcSocketPath) === false) {
throw new \RuntimeException('Could not bind to ipc socket.');
}

TO
if (socket_bind($this->icpSocket, $ipcSocketPath) === false) {
throw new \RuntimeException('Could not bind to ipc socket.');
} else {
chown($ipcSocketPath, 'www-data');
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions