/ Bug 2267 – Broken IP subnet matching
Bug 2267 - Broken IP subnet matching
: Broken IP subnet matching
Status: CLOSED FIXED
Product: ProFTPD
core
: CVS
: PC Linux
: P2 major
Assigned To: proftpd development group
:
:
:
:
  Show dependency treegraph
 
Reported: 2003-11-04 16:27 UTC by Jindrich Makovicka
Modified: 2004-09-07 13:32 UTC (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jindrich Makovicka 2003-11-04 16:27:39 UTC
Address restrictions in the form of Allow aaa.bbb.ccc.ddd/NN act like AllowAll,
because of the comparison commented out using #if 0. However, the following
"return 1" remained in the code so the comparison is left out and success is
returned. I have tried the following modification, which seems to make it work
again, at least for IPv4.

--- proftpd/src/dirtree.c	1 Nov 2003 07:11:07 -0000	1.125
+++ proftpd/src/dirtree.c	4 Nov 2003 21:18:25 -0000
@@ -1556,10 +1556,14 @@
 
   if (cidr_mode) {
 /* NOTE: encapsulation breakage note/IPv6 change needed here. */
-#if 0
-    if ((cli_addr->s_addr & htonl(cidr_mask)) == cidr_addr.s_addr)
-#endif
+
+      if (pr_netaddr_get_family(cli_addr) == AF_INET) {
+	  struct in_addr *cli_in_addr = pr_netaddr_get_inaddr(cli_addr);
+	  if ((cli_in_addr->s_addr & htonl(cidr_mask)) == cidr_addr.s_addr) {
       return 1;
+	  }
+      };
+
 
   } else {
     pr_netaddr_t *acl_addr = NULL;
Comment 1 TJ Saunders 2003-11-09 21:05:40 UTC
*** Bug 2275 has been marked as a duplicate of this bug. ***
Comment 2 TJ Saunders 2003-11-18 01:52:46 UTC
*** Bug 2285 has been marked as a duplicate of this bug. ***
Comment 3 TJ Saunders 2003-11-18 02:25:14 UTC
This should hopefully be fixed in the current CVS sources.
Comment 4 John Morrissey 2003-12-26 11:35:13 UTC
Resolved in 1.2.9(?).
Comment 5 Jindrich Makovicka 2004-01-02 07:50:21 UTC
No, it got _broken_ in 1.2.9. Currently it's fixed in the CVS only.
Comment 6 John Morrissey 2004-01-02 10:28:10 UTC
Ok, you're correct; I didn't see it in NEWS and was going based on comment
dates.
Comment 7 TJ Saunders 2004-01-05 12:31:58 UTC
*** Bug 2308 has been marked as a duplicate of this bug. ***
Comment 8 TJ Saunders 2004-02-08 15:15:41 UTC
*** Bug 2335 has been marked as a duplicate of this bug. ***
Comment 9 TJ Saunders 2004-02-12 12:16:07 UTC
*** Bug 2338 has been marked as a duplicate of this bug. ***
Comment 10 Irv Elshoff 2004-02-12 15:10:44 UTC
*** Bug 2338 has been marked as a duplicate of this bug. ***
Comment 11 TJ Saunders 2004-02-23 13:04:57 UTC
*** Bug 2347 has been marked as a duplicate of this bug. ***
Comment 12 Patrick Bihan-Faou 2004-03-04 12:03:52 UTC
*** Bug 2359 has been marked as a duplicate of this bug. ***
Comment 13 TJ Saunders 2004-04-01 15:20:47 UTC
*** Bug 2378 has been marked as a duplicate of this bug. ***
Comment 14 John Morrissey 2004-04-14 10:12:52 UTC
*** Bug 2388 has been marked as a duplicate of this bug. ***
Comment 15 TJ Saunders 2004-04-28 17:04:41 UTC
Resolved in 1.2.10rc1.
Comment 16 TJ Saunders 2004-09-07 13:32:38 UTC
*** Bug 2479 has been marked as a duplicate of this bug. ***