Implementing NegoState.Unix.cs#5773
Conversation
|
following up #5726 |
|
Adding reference to #2483 |
@shrutigarg, I'm confused by all of the PRs. I commented on #5772, but its three commits appear to be completely a part of this one. Then there are this PR (#5773) and the fallback logic PR (#5770) which have those three commits plus one more that appears to be the same, and then they each differ by one commit. What are we actually supposed to be reviewing? |
| Exception exception = null; | ||
| if (message != s_emptyMessage) | ||
| { | ||
| message = GetOutgoingBlob(message, ref exception); |
There was a problem hiding this comment.
@shrutigarg Does it mean that in Unix we will use the same NTAuthentication.cs as well to GetOutgoingBlob ?
This NTAuthentication.GetOutgoinBlob essentially what System.Data need to get SSPI message for Integrated feature. Is there any plan to make this available to public ?
Thanks
There was a problem hiding this comment.
Yes.. Unix will use same NTAuthentication.cs There is no plan to make GetOutgoingBlob public
|
@shrutigarg , till we resolve #5890 add a Debug.Write and GlobalLog.Print to the catch block in |
|
@vijaykota added log and marked with a todo statement to keep track on reverting. |
c4fd392 to
26b5f21
Compare
|
@vijaykota @stephentoub @bartonjs updated this PR after syncing with dev/negotiatestream branch and incorporating all the comments. |
|
@dotnet-bot test this please |
|
|
||
| namespace System.Net.Security | ||
| { | ||
| internal sealed class SafeFreeNegoCredentials : SafeFreeCredentials |
There was a problem hiding this comment.
What value is this type providing? It seems like it exists purely to wrap a SafeGssCredHandle... why not just have the caller use a SafeGssCredHandle?
There was a problem hiding this comment.
@bartonjs just told me that this exists purely to satisfy the PAL contract... is that true? If so, we can leave it as-is for now, but we should revisit that contract, which sounds flawed.
There was a problem hiding this comment.
I'm happy to be wrong about that, but I feel that when I've had similar confusion on other things that was the answer.
There was a problem hiding this comment.
Yes.. the platform-agnostic code requires a SafeFreeCredentials object since on Windows it is same for SslStream and NegotiateStream. On Unix this is different. For fallback to NTLM logic, you will actually see more logic inside SafeFreeNegoCredentials.
e285e18 to
1dd9c4c
Compare
|
rebase done. |
|
A few more comments, then LGTM. (Most importantly the DangerousRelease thing needs to be addressed.) |
05e7762 to
aec307e
Compare
|
@dotnet-bot test this please |
| } | ||
| Debug.Write("Exception Caught. - " + ex); | ||
| Debug.Assert((null != credential), "Null credential in SafeDeleteContext"); | ||
| Dispose(); |
There was a problem hiding this comment.
@shrutigarg we need to (implement) and call base.Dispose which should also set _credential to null to prevent double-free
There was a problem hiding this comment.
Calling Dispose here is right, but in Dispose implementation below you're calling _sslContext.Dispose, and if the ctor throws in the call to AllocateSslContext, _sslContext will be null, and the call to Dispose will dereference null. You need to check in Dispose that _sslContext is not null before disposing it. Then you should set it back to null.
There was a problem hiding this comment.
ok .. will add check .. like in other dispose.
|
This can be reviewed again in context as part of a later merge to master. For now, LGTM. |
05f0631 to
78ea444
Compare
|
These checks seem to have stuck ..seeing it since 5-6 hours.. ,, is some known issue? Should I wait for them to finish? |
|
@dotnet-bot test this please |
|
|
With the build break, that implies the latest version of the code wasn't run through tests. Since there aren't automated ones yet in CI, can you please make sure to do so locally before this is merged? |
|
@stephentoub seems unrelated failure now.. I have fixed the issue and tested. |
|
@mmitche, we're hitting these Azure VM disk full conditions fairly often. We can continue to delete them when they occur, but is there nothing more proactive we can do to prevent them in the first place and avoid the random leg failures? |
35edd02 to
78ea444
Compare
58b062c to
e8cf9aa
Compare
|
@stephentoub That actually wasn't a disk space issue, that was it not making the disk writeable. I am trying to find out why. Let me know if you see another instance. |
Implementing NegoState.Unix.cs
It includes the implementation on NegoState.Unix pal on top of the common refactoring changes( #5581)
Please refer to the Commit 4 of this PR for reviewing.
Includes:
Implementation of NegoState.Unix.cs Methods.
Implementaion of SafeHandles to be used.
Tested locally as Linux client with windows server.
cc: @stephentoub , @bartonjs @vijaykota