check_acl(): remove the fd argument - it is not used.
Host name and IP address are provided instead. Michael
This commit is contained in:
parent
64ff313260
commit
14a3e187ee
@ -331,13 +331,12 @@ check_numeric_acl (const struct acl_s *acl, const char *ip)
|
|||||||
* 0 if denied
|
* 0 if denied
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
check_acl (int fd, const char *ip, const char *host)
|
check_acl (const char *ip, const char *host)
|
||||||
{
|
{
|
||||||
struct acl_s *acl;
|
struct acl_s *acl;
|
||||||
int perm;
|
int perm;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
assert (fd >= 0);
|
|
||||||
assert (ip != NULL);
|
assert (ip != NULL);
|
||||||
assert (host != NULL);
|
assert (host != NULL);
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@ typedef enum
|
|||||||
{ ACL_ALLOW, ACL_DENY } acl_access_t;
|
{ ACL_ALLOW, ACL_DENY } acl_access_t;
|
||||||
|
|
||||||
extern int insert_acl (char *location, acl_access_t access_type);
|
extern int insert_acl (char *location, acl_access_t access_type);
|
||||||
extern int check_acl (int fd, const char *ip_address,
|
extern int check_acl (const char *ip_address, const char *string_address);
|
||||||
const char *string_address);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1623,7 +1623,7 @@ handle_connection (int fd)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (check_acl (fd, peer_ipaddr, peer_string) <= 0)
|
if (check_acl (peer_ipaddr, peer_string) <= 0)
|
||||||
{
|
{
|
||||||
update_stats (STAT_DENIED);
|
update_stats (STAT_DENIED);
|
||||||
indicate_http_error (connptr, 403, "Access denied",
|
indicate_http_error (connptr, 403, "Access denied",
|
||||||
|
Loading…
Reference in New Issue
Block a user