MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ACLLogMatchEntry

Function ACLLogMatchEntry

app/redis-6.2.6/src/acl.c:1771–1780  ·  view source on GitHub ↗

This function will check if ACL entries 'a' and 'b' are similar enough * that we should actually update the existing entry in our ACL log instead * of creating a new one. */

Source from the content-addressed store, hash-verified

1769 * that we should actually update the existing entry in our ACL log instead
1770 * of creating a new one. */
1771int ACLLogMatchEntry(ACLLogEntry *a, ACLLogEntry *b) {
1772 if (a->reason != b->reason) return 0;
1773 if (a->context != b->context) return 0;
1774 mstime_t delta = a->ctime - b->ctime;
1775 if (delta < 0) delta = -delta;
1776 if (delta > ACL_LOG_GROUPING_MAX_TIME_DELTA) return 0;
1777 if (sdscmp(a->object,b->object) != 0) return 0;
1778 if (sdscmp(a->username,b->username) != 0) return 0;
1779 return 1;
1780}
1781
1782/* Release an ACL log entry. */
1783void ACLFreeLogEntry(void *leptr) {

Callers 1

addACLLogEntryFunction · 0.85

Calls 1

sdscmpFunction · 0.85

Tested by

no test coverage detected