Skip to content

[#726] Reject Unix socket paths that don't fit in sun_path - #727

Open
Pranav-error wants to merge 1 commit into
pgexporter:mainfrom
Pranav-error:unix-socket-path-length
Open

Pranav-error wants to merge 1 commit into
pgexporter:mainfrom
Pranav-error:unix-socket-path-length

Conversation

@Pranav-error

Copy link
Copy Markdown
Collaborator

Fixes #726.

Refuse a Unix socket path that doesn't fit in sun_path instead of binding and chmod'ing truncated paths.

Adds test_connection_bind_unix_socket_path_too_long: on main the bind succeeds or leaves a stray socket and the directory mode changes; with this change it fails cleanly and the directory is untouched. Checked on macOS (Debug, ASan).

Copilot AI balanced review requested due to automatic review settings December 1, 2026 20:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@Pranav-error
Pranav-error force-pushed the unix-socket-path-length branch from 4c2f9e5 to 242967e Compare December 1, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A long unix_socket_dir makes pgexporter chmod the wrong path

2 participants