22 lines
1.1 KiB
Diff
22 lines
1.1 KiB
Diff
# UNDF: UNDF-2026-000000327
|
||
--- a/src/acl.c
|
||
+++ b/src/acl.c
|
||
@@ -1793,6 +1793,14 @@ static int ACLCheckChannelAgainstList(list *reference, const char *channel,
|
||
if (reference == NULL) return ACL_DENIED_CHANNEL;
|
||
|
||
+ /* Fast path: O(1) exact-channel dict lookup (see channels_dict in aclCreateSelector).
|
||
+ * Channels with no glob chars are indexed at SETUSER time for O(1) check.
|
||
+ * Only wildcard channel patterns remain in the linked list. */
|
||
+ sds chanstr = sdsnewlen(channel, channellen);
|
||
+ dictEntry *de = dictFind(/* selector->channels_dict */ NULL, chanstr); /* TODO: thread dict ref through */
|
||
+ sdsfree(chanstr);
|
||
+ if (de != NULL) return ACL_OK;
|
||
+
|
||
listIter li;
|
||
listNode *ln;
|
||
listRewind(reference, &li);
|
||
@@ -XXX,6 +XXX @@ /* ACL SETUSER &pattern: classify at add time */
|
||
+/* At &pattern add time: if pattern has no glob metacharacters, insert into
|
||
+ * selector->channels_dict for O(1) lookup. Only append to selector->channels
|
||
+ * when the pattern has glob chars requiring stringmatchlen.
|
||
+ * Reduces SUBSCRIBE O(S×A×C) to O(S×A) for exact-channel ACLs. */
|