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

Add missing ERROR_NO_DATA handling to NamedPipe #30

Merged
merged 1 commit into from May 20, 2020

Conversation

bbqsrc
Copy link
Contributor

@bbqsrc bbqsrc commented May 19, 2020

Hey @yoshuawuyts, found an interesting problem.

I needed to check that the ACLs on my named pipe were set correctly, so I used accesschk. Surprisingly, everything crashed. The error I was given: Error 232, "The pipe is being closed."

I search, find this is the define ERROR_NO_DATA. The documentation for ConnectNamedPipe says:

Otherwise, ConnectNamedPipe returns zero, and GetLastError returns ERROR_NO_DATA if the previous client has closed its handle or ERROR_PIPE_CONNECTED if it has not closed its handle.

With this patch, accesschk works, and without it, it doesn't. If you change the return value to Ok(false) it also will not work correctly.

Copy link
Owner

@yoshuawuyts yoshuawuyts left a comment

Choose a reason for hiding this comment

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

LGTM, thanks heaps!

@yoshuawuyts yoshuawuyts merged commit 4cc010b into yoshuawuyts:master May 20, 2020
@yoshuawuyts
Copy link
Owner

Published v0.3.4 🎉

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.

None yet

2 participants