-
-
Notifications
You must be signed in to change notification settings - Fork 231
bootstrap: set UNIX socket permissions to 770 #833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -215,6 +215,12 @@ func (app *BootstrapApp) Setup() error { | |
| } | ||
|
|
||
| tlog.App.Info().Msgf("Starting server on unix socket %s", app.config.Server.SocketPath) | ||
| go func() { | ||
| // Ensure processes running as a different user can access the socket. | ||
| if err := os.Chmod(app.config.Server.SocketPath, 0770); err != nil { | ||
| tlog.App.Fatal().Err(err).Msg("Failed to update UNIX socket permissions") | ||
| } | ||
| }() | ||
|
Comment on lines
+218
to
+223
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apply the chmod after the socket is bound, not in a fire-and-forget goroutine.
Please move the permission update into the unix-socket startup path so it runs once the socket exists and before connections are accepted. 🤖 Prompt for AI Agents |
||
| if err := router.RunUnix(app.config.Server.SocketPath); err != nil { | ||
| tlog.App.Fatal().Err(err).Msg("Failed to start server") | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think umask would be the more correct approach here, rather than chmod.