Repository navigation
fix(acl): skip a dirent with no Authority kind instead of hiding the page - #30
Merged
Merged
Conversation
…page `filter_chunk()` aborted the whole 512-entry batch when a child was neither a regular file nor a directory, and `cf_acl_filter_dirents()` turns one aborted chunk into a NULL listing: a single native symlink emptied its entire directory page. `server/pack-dir.c` already carries S_IFLNK, so that dirent is reachable in the data model. - names that are empty, '/'-bearing, '.' or '..' still abort the chunk: that is corrupt input, not a per-child decision - an entry without a kind is skipped; it gets no permission below and stays hidden, exactly like a denied sibling - `included` keeps the checks[] order, so permissions[i] still maps to the child that produced it, and an all-skipped chunk returns an empty page successfully instead of a fail-closed NULL Cheap contracts updated: skip-vs-abort separation, index alignment and the empty-chunk path. `python3 -m unittest discover -s tests -p 'test_cf_*.py'` passes (12 tests). Native MariaDB/Hub integration is unchanged and still needs the manual environment.
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.
Problem
Follow-up to #29, which started sending the real dirent
modeaskindto Hub Authority. The guard it added treated an unknown kind as fatal:filter_chunk()returning-1makescf_acl_filter_dirents()returnNULL, which hides every child. So one dirent whose mode is neither regular nor directory empties its entire directory page. That mode is reachable:server/pack-dir.cdefines and handlesS_IFLNK.Change
/,.,..) still abort the chunk — that is corrupt input, not a per-child decision, and the existing contract keeps itcontinued: it gets no permission below and stays hidden, exactly like a denied siblingincludedrecords the children that produced achecks[]entry, sopermissions[i]still maps to the right dirent and thevisiblelist stays aligned0(empty page) instead of a fail-closedNULLVerification
python3 -m unittest discover -s tests -p 'test_cf_*.py'→ 12 tests OK, including 4 new contracts: skip-vs-abort separation, index alignment (p=included, neverp=begin), empty chunk, invalid-name abortpython3 tests/test_v2_no_managed_library.py→ OKseafile-object.h); native MariaDB/Hub integration still requires the manual environment, unchanged by this PR.