Repository navigation
fix(iam): restore long-DN LDAP login while preserving revision errors - #250
Merged
Merged
Conversation
Since RELEASE.2026-09-16T00-00-00Z, LDAP users whose normalized DN is longer than 255 bytes cannot log in. NormDN hex-escapes every non-ASCII byte (go-ldap DN.String()), so one Cyrillic letter takes six characters. IAM looks up records named after the DN: the parent revision check added with cmd/iam-revision.go reads config/iam/users/<DN>/identity.json, and PolicyDBGet reads config/iam/policydb/sts-users/<DN>.json when the mapping is not cached. A drive rejects such an element in one of two ways. checkPathLength refuses more than 255 counted characters, but outside Windows it never counts a backslash, so an escaped DN usually passes it. The filesystem then fails with ENAMETOOLONG once the parent directory exists. toObjectErr reports both as ObjectNameInvalid, and the callers treat only errConfigNotFound as "no record". As a result, AssumeRoleWithLDAPIdentity, access-key creation and STS loading fail. Such a record cannot have been stored. When the object layer's own name validation (checkBucketAndObjectNames) accepts the path, ObjectNameInvalid can only mean a length rejection, so report it as errConfigNotFound. Invalid names and storage errors are returned unchanged, and saving such a record still fails. The etcd store has no such limit and is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: GL <[email protected]>
Only classify a valid IAM key as absent when a length error accompanies an ASCII path component longer than 255 bytes. Normalized LDAP DNs satisfy this condition, while total-path errors and Unicode names can refer to existing revocation records. Cover component boundaries, wrapped and storage errors, and real revocation records moved beneath a deep Darwin drive path. Signed-off-by: Feng Ruohang <[email protected]>
Signed-off-by: Feng Ruohang <[email protected]>
The PR CI found GO-2026-6809 in the remote main baseline using Go 1.27.2. Require the patched toolchain already used for local acceptance; keep module versions and the separate dependency refresh unchanged. Signed-off-by: Feng Ruohang <[email protected]>
Vonng
added a commit
that referenced
this pull request
Oct 24, 2026
Retain the merged upstream LDAP fix and original contributor history. Keep the existing Go/dependency refresh and published-release documentation; combine the changelog credit without repeating the Go 1.27.3 note. Signed-off-by: Feng Ruohang <[email protected]>
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.
Contribution Licensing (no CLA, inbound=outbound, DCO required)
This pull request contributes to PGSTY SILO (
pgsty/silo). Code contributionsare accepted under AGPL-3.0-or-later, the same license as the server.
This project does not use a CLA or require a separate Apache-2.0 license grant.
By submitting this pull request I represent that I have the right to contribute
the code changes under this repository's
GNU Affero General Public License v3.0 or later
and retain copyright in my original work. Existing copyright and license
notices remain intact; separately licensed material keeps its applicable terms.
Every commit must carry a DCO
Signed-off-bytrailer(
git commit -s) certifying theDeveloper Certificate of Origin — see
CONTRIBUTING.md.
Problem and resulting behavior
LDAP users whose normalized DN exceeds a filesystem component limit can fail to log in after the parent IAM revision check introduced in RELEASE.2026-09-16. DN normalization expands non-ASCII bytes into ASCII escapes. A 271-byte DN can pass the current path precheck but fail with
ENAMETOOLONGonceconfig/iam/users/exists; a 384-byte DN fails the precheck itself. Both reach the IAM reader as a length error.The reader now treats that error as an absent record only when all three conditions hold:
errFileNameTooLongorObjectNameInvalid..jsonsuffix.This restores group-authorized LDAP login, STS credentials and service-account access for the affected DNs. Short names, total-path limits and real storage errors continue to propagate.
The ASCII restriction is necessary: on macOS, a Unicode filename can exceed 255 UTF-8 bytes and still exist. A drive relocation can then cause a total-path read error. The added regression test writes a real parent revocation, moves the drive, proves that the record is still present through a relative read, and requires the parent check to retain the read error. Both ASCII and Unicode variants fail against the original broad classifier; the Unicode variant also fails with a byte-only guard.
Scope and compatibility
Production changes are confined to the shared object-IAM read entry point (25 added lines). There is no Go module-version, data-format, API, configuration or migration change. A separate one-line Go minimum bump to 1.27.3 is included because CI found the pre-existing crypto/x509 issue GO-2026-6809 in the remote baseline's Go 1.27.2. No other pending dependency updates are included. The etcd backend, successful reads and writes retain their behavior.
Long-DN direct policy mappings and parent revocation records remain unwritable on the object backend, and those writes still return errors. Grant access through a group with a short DN. This fix does not change global
checkPathLengthbehavior or implement a long-key storage format.Validation
Maintainer validation with Go 1.27.3 on macOS/arm64:
make verifiersandmake buildpass.typosis unavailable and skipped by the repository script.make test, race, production AD/XFS and distributed deployment acceptance are not claimed by these local results.Focused reproduction:
The etcd variant requires
SILO_TEST_IAM_REVOCATION_ETCD; LDAP integration uses_MINIO_LDAP_TEST_SERVERand_MINIO_ETCD_TEST_SERVER. CI results are reported by the checks attached to the final PR head.Contributor credit
Original report, reproduction and implementation: @910patin (GL). The original commit
9faeb7a1147435aa7ebc02bb997837ddfbdd2a81, author identity and DCO sign-off are retained. Maintainer follow-up narrows the classification and adds the stored-revocation counterexamples. The changelog also credits @910patin and links this PR.Checklist
make verifiersandmake buildpass with Go 1.27.3.