Uh oh!
There was an error while loading. Please reload this page.
Fixing regression for AuthType.Anonymous which leads to a NullReferenceException be thrown. - #62807
Conversation
…ceException be thrown.
ghost
commented
Dec 14, 2021
Tagging subscribers to this area: @dotnet/area-system-directoryservices, @jay98014 Issue DetailsFixes #61683 regression. When we added support for LDAPS #52904 we accidentally regressed the scenario for AuthType.Anonymous since you would have passed in a null password, and we would later try to dereference it. This change fixes that by setting the value length of the struct to 0, and I have validated that this does work for the anonymous scenario.
|
ericstj
commented
Dec 14, 2021
Is it possible to add a regression test for this scenario? |
joperezr
commented
Dec 14, 2021
I can add one that will validate the NullRef is not thrown, but we can't really adda test that actually ensures that allowAnonymous succeeds to bind, which is kind of why this regression wasn't catched. The problem is that in order for AllowAnonymous to work, we would need to have our tests run against an ActiveDirectory Server for which we are domain joined, which we don't currently have the infrastructure for. |
ericstj
commented
Dec 14, 2021
I can see it being valuable to get coverage of these APIs up to the point that they hit the network. I know a lot of our other APIs (like IO for example) have tests that ensure a certain precedence of exceptions. If you think it's possible to do and adds value here that might be something to consider. |
joperezr
commented
Dec 15, 2021
/backport to release/6.0 |
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1580574117 |
Fixes#61683 regression.
When we added support for LDAPS #52904 we accidentally regressed the scenario for AuthType.Anonymous since you would have passed in a null password, and we would later try to dereference it. This change fixes that by setting the value length of the struct to 0, and I have validated that this does work for the anonymous scenario.