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

Fixed ENAMETOOLONG error in setup_console_socket #2914

Closed

Conversation

morganllewellynjones
Copy link
Contributor

In reference to the error found here: #2910

sun_path has a max length of 108 bytes: https://man7.org/linux/man-pages/man7/unix.7.html

And including the absolute path name can make the resulting address of the socket path too long for sun_path.

Quick solution, move to the container_dir first, that way the sun_path is always just as long as the name "console-socket" itself, and doesn't break depending on the length of the runtime filepath.

I also wrapped this update in code that saves the previous directory and moves back to it afterwords. I personally doubt this is necessary and may simply be wasted clock cycles. Since we tend to use absolute path names in general, both to navigate and to access specific links. Nevertheless, I didn't want to make that call. If repositioning the directory afterwards is not necessary that could certainly be cleaned out. Cargo test passes in either case.

@morganllewellynjones
Copy link
Contributor Author

Closing as duplicate of #2915

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.

1 participant