Package: frox
Version: 0.7.18-2
Severity: normal
Tags: patch

In ACL's, Frox mistakes domain names starting from digit for IP-addresses.

Attached patch is, rather, for reference and was not tested.

-- System Information:
Debian Release: 3.1
  APT prefers stable
  APT policy: (990, 'stable'), (50, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.16-2-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages frox depends on:
ii libc6 2.3.2.ds1-22sarge4 GNU C Library: Shared libraries an

-- no debconf information


diff -r -u a/src/configs.c.in b/src/configs.c.in
--- a/src/configs.c.in	2005-02-04 13:24:55.000000000 +0300
+++ b/src/configs.c.in	2006-11-22 20:01:46.000000000 +0300
@@ -393,9 +393,11 @@
 int addrange_match(struct in_addr addr, char *range)
 {
 	char *s;
-	if(*range=='*') return TRUE;
+	struct in_addr a, m;
+
+	if(*range=='*')
+		return TRUE;
 	else if((s=strchr(range, '/'))) {
-		struct in_addr a, m;
 		s = strchr(range, '/');
 		*s++='\0';
 		if(inet_aton(range, &a) == 0) {
@@ -415,14 +417,8 @@
 		if((addr.s_addr & m.s_addr) == (a.s_addr & m.s_addr))
 			return TRUE;
 		else return FALSE;
-	} else if(*range >= '0' && *range<='9') {
-		struct in_addr a;
-		if(inet_aton(range, &a) == 0) {
-			write_log(ERROR, "Unable to parse ACL. Ignoring.");
-			return FALSE;
-		}
-		if(a.s_addr == addr.s_addr) return TRUE;
-		else return FALSE;
+	} else if(inet_aton(range, &a) != 0) {
+		return (a.s_addr == addr.s_addr);
 	} else {
 		struct hostent *hostinfo;
 		struct in_addr *ap;

Reply via email to