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

Socket activation logic lacks error checking #405

Open
jsonn opened this issue Aug 8, 2022 · 0 comments
Open

Socket activation logic lacks error checking #405

jsonn opened this issue Aug 8, 2022 · 0 comments

Comments

@jsonn
Copy link

jsonn commented Aug 8, 2022

In

files = append(files, os.NewFile(uintptr(fd), name))
the return value of os.NewFile should be checked before files is changed. It can fail if the environment variables don't match the file descriptor table, e.g. LISTEN_FDS is much larger than the number of open files. The current logic would force consumers of the interface to check for this condition or run into mysterious panics in a completely unrelated code. If os.NewFile fails, just returning nil might be reasonable, even if it means close-on-exec is set on some file descriptors.

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

No branches or pull requests

1 participant