Skip to content

test#469

Open
sundb wants to merge 2 commits into
unstablefrom
bcast_filtering_before_send_cache-test
Open

test#469
sundb wants to merge 2 commits into
unstablefrom
bcast_filtering_before_send_cache-test

Conversation

@sundb

@sundb sundb commented Jun 17, 2026

Copy link
Copy Markdown
Owner

No description provided.

BCAST tracking sent invalidations for every key matching a registered
prefix without an ACL check, letting a client learn names of keys it
cannot read. Filter each key via ACLUserCheckKeyPerm() against the
subscriber's user; cache replies per user to keep the check O(U*K).
Pending BCAST invalidations accumulate per-prefix and are flushed in
beforeSleep, filtered by each subscriber's current ACL key permissions.
If a client re-AUTHs or a user's ACL is rewritten in place between
accumulation and flush, beforeSleep re-filters already-accumulated keys
by the new (possibly stricter) permissions and silently drops
invalidations the client was entitled to under its old identity.

Deliver pending invalidations under the old identity before it changes:

- clientSetUser(): flushes the client's subscribed prefixes before
  c->user changes; wired into all auth paths and clientSetDefaultAuth.
- ACL SETUSER: flush prefixes with a subscriber of the modified user
  before overwriting it in place.
- ACL LOAD: whole-table flush before mutating users (DefaultUser is
  overwritten in place, and many users may change at once).
- deauthenticateAndCloseClient(): disable tracking before resetting the
  user so the dying client can't receive invalidations under DefaultUser.

trackingBroadcastInvalidationMessages() now takes a user filter (NULL
flushes all); the per-prefix send logic is extracted into a shared helper.
Adds tests for same-user filtering, re-AUTH, in-place SETUSER, and LOAD.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants