From 6bbedbdb5a148e5e221d2601037392d5076e25f4 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 18 Apr 2003 14:55:43 +0000 Subject: fix byte ordering when using CIDR notation in hosts allow/deny; spotted by Eloy Paris (This used to be commit 6155144b9f6a8d41675ff8f0564f86420431c142) --- source3/lib/access.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/access.c b/source3/lib/access.c index 09676dbd58..9d07893c2f 100644 --- a/source3/lib/access.c +++ b/source3/lib/access.c @@ -40,6 +40,10 @@ static BOOL masked_match(const char *tok, const char *slash, const char *s) DEBUG(0,("access: bad net/mask access control: %s\n", tok)); return (False); } + + /* convert to network byte order */ + mask = htonl(mask); + return ((addr & mask) == net); } -- cgit