Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions cf-serverd/server_access.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "strlist.h"
#include "server.h"

#include <addr_lib.h> /* FuzzySetMatch */
#include <addr_lib.h> /* IPRangeMatch */
#include <string_lib.h> /* StringMatchFull TODO REMOVE */
#include <misc_lib.h>
#include <file_lib.h>
Expand Down Expand Up @@ -73,6 +73,8 @@ static bool access_CheckResource(const struct resource_acl *acl,
const char *ipaddr, const char *hostname,
const char *key, const char *username)
{
assert(acl != NULL);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this assert should go into a separate commit. Because the commit message only mentions a rename if a function


bool access = false; /* DENY by default */
bool have_match = false; /* No matching rule found yet */

Expand All @@ -90,7 +92,7 @@ static bool access_CheckResource(const struct resource_acl *acl,
const char *rule = NULL;
for (size_t i = 0; i < StrList_Len(acl->admit.ips); i++)
{
if (FuzzySetMatch(StrList_At(acl->admit.ips, i), ipaddr) == 0 ||
if (IPRangeMatch(StrList_At(acl->admit.ips, i), ipaddr) ||
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
/* Legacy regex matching, TODO DEPRECATE */
StringMatchFull(StrList_At(acl->admit.ips, i), ipaddr))
{
Expand Down Expand Up @@ -196,7 +198,7 @@ static bool access_CheckResource(const struct resource_acl *acl,
const char *rule = NULL;
for (size_t i = 0; i < StrList_Len(acl->deny.ips); i++)
{
if (FuzzySetMatch(StrList_At(acl->deny.ips, i), ipaddr) == 0 ||
if (IPRangeMatch(StrList_At(acl->deny.ips, i), ipaddr) ||
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
/* Legacy regex matching, TODO DEPRECATE */
StringMatchFull(StrList_At(acl->deny.ips, i), ipaddr))
{
Expand Down
Loading
Loading