Conversation
Can't use sizof(d->d_name) Use NAME_MAX or MAXNAMLEN
Contributor
Author
|
This is a prerequisite for using System.Net.Security on illumos. |
Contributor
|
Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates native X509 store enumeration to avoid relying on sizeof(dirent.d_name) (which is not usable on illumos) when allocating buffers and handling certificate file names.
Changes:
- Compute the temporary path buffer size using
NAME_MAX/MAXNAMLEN(with a fallback) instead ofsizeof(d_name). - Add a guard to skip
.pfxentries whose names won’t fit in the remaining buffer space. - Switch filename length computation from
strnlen(..., sizeof(d_name))tostrlen(...).
bartonjs
requested changes
Feb 25, 2026
gwr
commented
Feb 25, 2026
Member
|
/azp run runtime-libraries-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or 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
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.
Can't use sizof(d->d_name)
Use NAME_MAX or MAXNAMLEN
Without this, the code running on illumos reads only 1 character of the file names in the certificates store and cannot find any certificates.