module Obsctl::IPC::SocketPath

Defined in:

obsctl/ipc/socket_path.cr

Constant Summary

DEFAULT_SOCKET_NAME = "obsctl.sock"
PARENT_MODE = 448

Class Method Summary

Class Method Detail

def self.ensure_parent(path : String) : Nil #

Creates the socket's parent directory and checks it is safe to use.

Directories this call creates are owner-only: the /tmp/obsctl-$UID/ fallback sits in a world-writable parent, and one left at the default umask would let any local user replace the socket file even though the socket itself is 0600.

A directory that already exists is left alone. It may be a deliberate choice — server.socket_path: /tmp/obsctl.sock puts the socket straight into /tmp — and silently chmod'ing a shared directory would be a worse surprise than the problem it solves.


[View source]
def self.resolve(configured_path : String | Nil = nil, env = ENV) : String #

[View source]
def self.uid : UInt32 #

[View source]