-
Notifications
You must be signed in to change notification settings - Fork 23
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
Always buffer TCP data in __handle_recv() #44
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
frozencemetery
force-pushed
the
split-recv
branch
from
August 29, 2019 15:20
7baebad
to
d5d533e
Compare
Refactor __handle_recv() to always create a BytesIO() object for TCP data. Linearize control flow for ease of debugging. Always apply length checks so that we don't have to wait for EOF in the multiple-recv case. Fixes a bug where we wouldn't return any data because we never received the EOF, or didn't receive it fast enough. Signed-off-by: Robbie Harwood <[email protected]>
tiran
approved these changes
Aug 29, 2019
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.
Patch looks good to me.
@simo5 please take a look, too.
simo5
approved these changes
Aug 29, 2019
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.
LGTM
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
Apr 29, 2020
…ackets This is a regression test for the bug in python-kdcproxy mentioned in latchset/kdcproxy#44 When the reply from AD is split into several TCP packets the kdc proxy software cannot handle it and returns a false error message indicating it cannot contact the KDC server. This could be observed as login failures of AD user on IPA clients when: * IPA client was configured to use kdcproxy to communicate with AD * kdcproxy used TCP to communicate with AD * response from AD to kdcproxy was split into several packets This patch also refactors and improves existing tests: * switch to using pytest fixtures for test setup and cleanup steps to make them isolated and reusable * simulate a much more restricted network environment: instead of blocking single 88 port we now block all outgoing traffic except few essential ports * add basic tests for using kdcproxy to communicate between IPA client and AD DC.
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
Apr 29, 2020
The test fails with older versions of kdcproxy as the related bug was fixed in 0.4.2: latchset/kdcproxy#44
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
Apr 29, 2020
…ackets This is a regression test for the bug in python-kdcproxy mentioned in latchset/kdcproxy#44 When the reply from AD is split into several TCP packets the kdc proxy software cannot handle it and returns a false error message indicating it cannot contact the KDC server. This could be observed as login failures of AD user on IPA clients when: * IPA client was configured to use kdcproxy to communicate with AD * kdcproxy used TCP to communicate with AD * response from AD to kdcproxy was split into several packets This patch also refactors and improves existing tests: * switch to using pytest fixtures for test setup and cleanup steps to make them isolated and reusable * simulate a much more restricted network environment: instead of blocking single 88 port we now block all outgoing traffic except few essential ports * add basic tests for using kdcproxy to communicate between IPA client and AD DC.
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
Apr 29, 2020
The test fails with older versions of kdcproxy as the related bug was fixed in 0.4.2: latchset/kdcproxy#44
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
Apr 29, 2020
…ackets This is a regression test for the bug in python-kdcproxy mentioned in latchset/kdcproxy#44 When the reply from AD is split into several TCP packets the kdc proxy software cannot handle it and returns a false error message indicating it cannot contact the KDC server. This could be observed as login failures of AD user on IPA clients when: * IPA client was configured to use kdcproxy to communicate with AD * kdcproxy used TCP to communicate with AD * response from AD to kdcproxy was split into several packets This patch also refactors and improves existing tests: * switch to using pytest fixtures for test setup and cleanup steps to make them isolated and reusable * simulate a much more restricted network environment: instead of blocking single 88 port we now block all outgoing traffic except few essential ports * add basic tests for using kdcproxy to communicate between IPA client and AD DC.
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
Apr 29, 2020
The test fails with older versions of kdcproxy as the related bug was fixed in 0.4.2: latchset/kdcproxy#44
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
May 18, 2020
…ackets This is a regression test for the bug in python-kdcproxy mentioned in latchset/kdcproxy#44 When the reply from AD is split into several TCP packets the kdc proxy software cannot handle it and returns a false error message indicating it cannot contact the KDC server. This could be observed as login failures of AD user on IPA clients when: * IPA client was configured to use kdcproxy to communicate with AD * kdcproxy used TCP to communicate with AD * response from AD to kdcproxy was split into several packets This patch also refactors and improves existing tests: * switch to using pytest fixtures for test setup and cleanup steps to make them isolated and reusable * simulate a much more restricted network environment: instead of blocking single 88 port we now block all outgoing traffic except few essential ports * add basic tests for using kdcproxy to communicate between IPA client and AD DC.
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
May 18, 2020
The test fails with older versions of kdcproxy as the related bug was fixed in 0.4.2: latchset/kdcproxy#44
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
May 19, 2020
…ackets This is a regression test for the bug in python-kdcproxy mentioned in latchset/kdcproxy#44 When the reply from AD is split into several TCP packets the kdc proxy software cannot handle it and returns a false error message indicating it cannot contact the KDC server. This could be observed as login failures of AD user on IPA clients when: * IPA client was configured to use kdcproxy to communicate with AD * kdcproxy used TCP to communicate with AD * response from AD to kdcproxy was split into several packets This patch also refactors and improves existing tests: * switch to using pytest fixtures for test setup and cleanup steps to make them isolated and reusable * simulate a much more restricted network environment: instead of blocking single 88 port we now block all outgoing traffic except few essential ports * add basic tests for using kdcproxy to communicate between IPA client and AD DC.
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
May 19, 2020
The test fails with older versions of kdcproxy as the related bug was fixed in 0.4.2: latchset/kdcproxy#44
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
Jun 3, 2020
…ackets This is a regression test for the bug in python-kdcproxy mentioned in latchset/kdcproxy#44 When the reply from AD is split into several TCP packets the kdc proxy software cannot handle it and returns a false error message indicating it cannot contact the KDC server. This could be observed as login failures of AD user on IPA clients when: * IPA client was configured to use kdcproxy to communicate with AD * kdcproxy used TCP to communicate with AD * response from AD to kdcproxy was split into several packets This patch also refactors and improves existing tests: * switch to using pytest fixtures for test setup and cleanup steps to make them isolated and reusable * simulate a much more restricted network environment: instead of blocking single 88 port we now block all outgoing traffic except few essential ports * add basic tests for using kdcproxy to communicate between IPA client and AD DC.
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
Jun 3, 2020
The test fails with older versions of kdcproxy as the related bug was fixed in 0.4.2: latchset/kdcproxy#44
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
Mar 5, 2021
…ackets This is a regression test for the bug in python-kdcproxy mentioned in latchset/kdcproxy#44 When the reply from AD is split into several TCP packets the kdc proxy software cannot handle it and returns a false error message indicating it cannot contact the KDC server. This could be observed as login failures of AD user on IPA clients when: * IPA client was configured to use kdcproxy to communicate with AD * kdcproxy used TCP to communicate with AD * response from AD to kdcproxy was split into several packets This patch also refactors and improves existing tests: * switch to using pytest fixtures for test setup and cleanup steps to make them isolated and reusable * simulate a much more restricted network environment: instead of blocking single 88 port we now block all outgoing traffic except few essential ports * add basic tests for using kdcproxy to communicate between IPA client and AD DC.
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
Mar 5, 2021
…ackets This is a regression test for the bug in python-kdcproxy mentioned in latchset/kdcproxy#44 When the reply from AD is split into several TCP packets the kdc proxy software cannot handle it and returns a false error message indicating it cannot contact the KDC server. This could be observed as login failures of AD user on IPA clients when: * IPA client was configured to use kdcproxy to communicate with AD * kdcproxy used TCP to communicate with AD * response from AD to kdcproxy was split into several packets This patch also refactors and improves existing tests: * switch to using pytest fixtures for test setup and cleanup steps to make them isolated and reusable * simulate a much more restricted network environment: instead of blocking single 88 port we now block all outgoing traffic except few essential ports * add basic tests for using kdcproxy to communicate between IPA client and AD DC.
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
Mar 17, 2021
…ackets This is a regression test for the bug in python-kdcproxy mentioned in latchset/kdcproxy#44 When the reply from AD is split into several TCP packets the kdc proxy software cannot handle it and returns a false error message indicating it cannot contact the KDC server. This could be observed as login failures of AD user on IPA clients when: * IPA client was configured to use kdcproxy to communicate with AD * kdcproxy used TCP to communicate with AD * response from AD to kdcproxy was split into several packets This patch also refactors and improves existing tests: * switch to using pytest fixtures for test setup and cleanup steps to make them isolated and reusable * simulate a much more restricted network environment: instead of blocking single 88 port we now block all outgoing traffic except few essential ports * add basic tests for using kdcproxy to communicate between IPA client and AD DC.
abbra
pushed a commit
to freeipa/freeipa
that referenced
this pull request
Mar 18, 2021
…ackets This is a regression test for the bug in python-kdcproxy mentioned in latchset/kdcproxy#44 When the reply from AD is split into several TCP packets the kdc proxy software cannot handle it and returns a false error message indicating it cannot contact the KDC server. This could be observed as login failures of AD user on IPA clients when: * IPA client was configured to use kdcproxy to communicate with AD * kdcproxy used TCP to communicate with AD * response from AD to kdcproxy was split into several packets This patch also refactors and improves existing tests: * switch to using pytest fixtures for test setup and cleanup steps to make them isolated and reusable * simulate a much more restricted network environment: instead of blocking single 88 port we now block all outgoing traffic except few essential ports * add basic tests for using kdcproxy to communicate between IPA client and AD DC. Reviewed-By: Anuja More <[email protected]>
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
Mar 18, 2021
…ackets This is a regression test for the bug in python-kdcproxy mentioned in latchset/kdcproxy#44 When the reply from AD is split into several TCP packets the kdc proxy software cannot handle it and returns a false error message indicating it cannot contact the KDC server. This could be observed as login failures of AD user on IPA clients when: * IPA client was configured to use kdcproxy to communicate with AD * kdcproxy used TCP to communicate with AD * response from AD to kdcproxy was split into several packets This patch also refactors and improves existing tests: * switch to using pytest fixtures for test setup and cleanup steps to make them isolated and reusable * simulate a much more restricted network environment: instead of blocking single 88 port we now block all outgoing traffic except few essential ports * add basic tests for using kdcproxy to communicate between IPA client and AD DC.
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
Mar 18, 2021
…ackets This is a regression test for the bug in python-kdcproxy mentioned in latchset/kdcproxy#44 When the reply from AD is split into several TCP packets the kdc proxy software cannot handle it and returns a false error message indicating it cannot contact the KDC server. This could be observed as login failures of AD user on IPA clients when: * IPA client was configured to use kdcproxy to communicate with AD * kdcproxy used TCP to communicate with AD * response from AD to kdcproxy was split into several packets This patch also refactors and improves existing tests: * switch to using pytest fixtures for test setup and cleanup steps to make them isolated and reusable * simulate a much more restricted network environment: instead of blocking single 88 port we now block all outgoing traffic except few essential ports * add basic tests for using kdcproxy to communicate between IPA client and AD DC.
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
Mar 18, 2021
…ackets This is a regression test for the bug in python-kdcproxy mentioned in latchset/kdcproxy#44 When the reply from AD is split into several TCP packets the kdc proxy software cannot handle it and returns a false error message indicating it cannot contact the KDC server. This could be observed as login failures of AD user on IPA clients when: * IPA client was configured to use kdcproxy to communicate with AD * kdcproxy used TCP to communicate with AD * response from AD to kdcproxy was split into several packets This patch also refactors and improves existing tests: * switch to using pytest fixtures for test setup and cleanup steps to make them isolated and reusable * simulate a much more restricted network environment: instead of blocking single 88 port we now block all outgoing traffic except few essential ports * add basic tests for using kdcproxy to communicate between IPA client and AD DC.
abbra
pushed a commit
to freeipa/freeipa
that referenced
this pull request
Mar 18, 2021
…ackets This is a regression test for the bug in python-kdcproxy mentioned in latchset/kdcproxy#44 When the reply from AD is split into several TCP packets the kdc proxy software cannot handle it and returns a false error message indicating it cannot contact the KDC server. This could be observed as login failures of AD user on IPA clients when: * IPA client was configured to use kdcproxy to communicate with AD * kdcproxy used TCP to communicate with AD * response from AD to kdcproxy was split into several packets This patch also refactors and improves existing tests: * switch to using pytest fixtures for test setup and cleanup steps to make them isolated and reusable * simulate a much more restricted network environment: instead of blocking single 88 port we now block all outgoing traffic except few essential ports * add basic tests for using kdcproxy to communicate between IPA client and AD DC. Reviewed-By: Anuja More <[email protected]>
wladich
pushed a commit
to wladich/freeipa
that referenced
this pull request
Mar 29, 2021
…ackets This is a regression test for the bug in python-kdcproxy mentioned in latchset/kdcproxy#44 When the reply from AD is split into several TCP packets the kdc proxy software cannot handle it and returns a false error message indicating it cannot contact the KDC server. This could be observed as login failures of AD user on IPA clients when: * IPA client was configured to use kdcproxy to communicate with AD * kdcproxy used TCP to communicate with AD * response from AD to kdcproxy was split into several packets This patch also refactors and improves existing tests: * switch to using pytest fixtures for test setup and cleanup steps to make them isolated and reusable * simulate a much more restricted network environment: instead of blocking single 88 port we now block all outgoing traffic except few essential ports * add basic tests for using kdcproxy to communicate between IPA client and AD DC.
abbra
pushed a commit
to freeipa/freeipa
that referenced
this pull request
Mar 30, 2021
…ackets This is a regression test for the bug in python-kdcproxy mentioned in latchset/kdcproxy#44 When the reply from AD is split into several TCP packets the kdc proxy software cannot handle it and returns a false error message indicating it cannot contact the KDC server. This could be observed as login failures of AD user on IPA clients when: * IPA client was configured to use kdcproxy to communicate with AD * kdcproxy used TCP to communicate with AD * response from AD to kdcproxy was split into several packets This patch also refactors and improves existing tests: * switch to using pytest fixtures for test setup and cleanup steps to make them isolated and reusable * simulate a much more restricted network environment: instead of blocking single 88 port we now block all outgoing traffic except few essential ports * add basic tests for using kdcproxy to communicate between IPA client and AD DC. Reviewed-By: Anuja More <[email protected]> Reviewed-By: Alexander Bokovoy <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor __handle_recv() to always create a BytesIO() object for TCP
data. Linearize control flow for ease of debugging. Always apply
length checks so that we don't have to wait for EOF in the multiple-recv
case.
Fixes a bug where we wouldn't return any data because we never received
the EOF, or didn't receive it fast enough.
Signed-off-by: Robbie Harwood [email protected]