From 78f039f04347bf1fe4fa7b8f5ca56b444fc2d539 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 18 Apr 2003 14:56:29 +0000 Subject: fix byte ordering when using CIDR notation in hosts allow/deny; spotted by Eloy Paris (This used to be commit c2580e15d6e7ad7c8dde81753e35670fa52636ff) --- 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