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. */
| 1778 | * that we should actually update the existing entry in our ACL log instead |
| 1779 | * of creating a new one. */ |
| 1780 | int ACLLogMatchEntry(ACLLogEntry *a, ACLLogEntry *b) { |
| 1781 | if (a->reason != b->reason) return 0; |
| 1782 | if (a->context != b->context) return 0; |
| 1783 | mstime_t delta = a->ctime - b->ctime; |
| 1784 | if (delta < 0) delta = -delta; |
| 1785 | if (delta > ACL_LOG_GROUPING_MAX_TIME_DELTA) return 0; |
| 1786 | if (sdscmp(a->object,b->object) != 0) return 0; |
| 1787 | if (sdscmp(a->username,b->username) != 0) return 0; |
| 1788 | return 1; |
| 1789 | } |
| 1790 | |
| 1791 | /* Release an ACL log entry. */ |
| 1792 | void ACLFreeLogEntry(const void *leptr) { |
no test coverage detected