Skip to content
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

Warn the user when the path name is too long for the ipc endpoint on linux #18330

Merged
merged 2 commits into from
Jan 2, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions rpc/ipc_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,17 @@ import (
"net"
"os"
"path/filepath"

"github.com/ethereum/go-ethereum/log"
)

// ipcListen will create a Unix socket on the given endpoint.
func ipcListen(endpoint string) (net.Listener, error) {
if len(endpoint) > 107 {
log.Warn("The ipc endpoint is longer than 107 characters and is restricted to this size by linux. "+
"Shorten this path to less than 108 characters.", "endpoint", endpoint)
}

// Ensure the IPC path exists and remove any previous leftover
if err := os.MkdirAll(filepath.Dir(endpoint), 0751); err != nil {
return nil, err
Expand Down