summaryrefslogtreecommitdiff
path: root/source3/lib/access.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-04-18 14:55:43 +0000
committerGerald Carter <jerry@samba.org>2003-04-18 14:55:43 +0000
commit6bbedbdb5a148e5e221d2601037392d5076e25f4 (patch)
tree13662e9a537b2b6dea964fc05b3558ad557b559d /source3/lib/access.c
parente54b9d59d6985df8fc66dce36968ce98df710742 (diff)
downloadsamba-6bbedbdb5a148e5e221d2601037392d5076e25f4.tar.gz
samba-6bbedbdb5a148e5e221d2601037392d5076e25f4.tar.bz2
samba-6bbedbdb5a148e5e221d2601037392d5076e25f4.zip
fix byte ordering when using CIDR notation in hosts allow/deny; spotted by Eloy Paris
(This used to be commit 6155144b9f6a8d41675ff8f0564f86420431c142)
Diffstat (limited to 'source3/lib/access.c')
-rw-r--r--source3/lib/access.c4
1 files changed, 4 insertions, 0 deletions
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);
}