Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.
This repository was archived by the owner on Nov 23, 2017. It is now read-only.

set unix socket permissions during binding of the UNIX-socket #426

Open
@socketpair

Description

@socketpair

Unfortunatelly this is not so easy.

  1. Safe, but (seems?) undocumented way in Linux -- is to call os.fchmod(socket.fileno()) BEFORE bind() + set umask to proper value. Since umask is not thread safe (affect all threads) that action should be done in fork()...
  2. Portable way -- is to call os.chmod(path) after binding. But this will leave socket with wrong permissions during small amount of time.

Socket write permissions are required in order unprivileged process to connect to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions