Bug #2798

Remote access: no valid netmask for single IP

Added by Alessio Fattorini over 5 years ago. Updated about 5 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-httpd-admin
Target version:v6.5
Security class: Resolution:
Affected version:v6.5-final NEEDINFO:No

Description

I need to fill an Authorize network with a single IP but no valid netmask is accepted, I try:
255.255.255.255 or leaving the field empty
The error is 2IPv4 valid mask" (see attachment)

Help says correctly "To allow access to only one host, use as a subnet mask of 255.255.255.255" but it doesn't work

bug_remote_mask.png (14.4 KB) Alessio Fattorini, 07/04/2014 04:04 AM


Related issues

Related to NethServer 6 - Enhancement #2820: Embed Nethgui 1.6.0 into httpd-admin RPM CLOSED

Associated revisions

Revision 839d474e
Added by Giacomo Sanchietti over 5 years ago

Validator: fix netmask validator. Refs #2798

History

#1 Updated by Giacomo Sanchietti over 5 years ago

  • NEEDINFO changed from No to Yes

No attachment found.

Can you post an extract from /var/log/messages?

#2 Updated by Giacomo Sanchietti over 5 years ago

  • Status changed from NEW to TRIAGED
  • % Done changed from 0 to 20
  • Affected version set to v6.5-final

I've been able to reproduce the problem, no error is found in /var/log/messages.
The error is on web interface validator.

A possible fix:

--- /usr/share/nethesis/Nethgui/System/Validator.php.ori    2014-07-03 16:05:57.804802115 +0200
+++ /usr/share/nethesis/Nethgui/System/Validator.php    2014-07-03 16:06:06.456819473 +0200
@@ -675,7 +675,7 @@

     private function evalIpV4Netmask($value)
     {
-        $pattern = '/^(((0|128|192|224|240|248|252|254)\.0\.0\.0)|(255\.(0|128|192|224|240|248|252|254)\.0\.0)|(255\.255\.(0|128|192|224|240|248|252|254)\.0)|(255\.255\.255\.(0|128|192|224|240|248|252|254)))$/i';
+        $pattern = '/^(((0|128|192|224|240|248|252|254)\.0\.0\.0)|(255\.(0|128|192|224|240|248|252|254)\.0\.0)|(255\.255\.(0|128|192|224|240|248|252|254)\.0)|(255\.255\.255\.(0|128|192|224|240|248|252|254|255)))$/i';
         return preg_match($pattern, $value);
     }

@@ -916,4 +916,4 @@
         return ($m1 && $m2);
     }

-}
\ No newline at end of file
+}

#3 Updated by Giacomo Sanchietti over 5 years ago

  • NEEDINFO changed from Yes to No

#4 Updated by Alessio Fattorini over 5 years ago

Sorry for attachamente, now it's here.
The fix proposed could be correct.

#5 Updated by Giacomo Sanchietti over 5 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Giacomo Sanchietti
  • % Done changed from 20 to 30

#6 Updated by Giacomo Sanchietti over 5 years ago

  • Status changed from ON_DEV to MODIFIED
  • % Done changed from 30 to 60

#7 Updated by Giacomo Sanchietti over 5 years ago

  • Status changed from MODIFIED to ON_QA
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 60 to 70
Package in nethserver-testing:
  • nethserver-nethgui-1.5.0-27.0git839d474e.ns6.noarch.rpm
Test case
  • The bug should not be reproducible

#8 Updated by Davide Principi about 5 years ago

  • Assignee set to Davide Principi

#9 Updated by Davide Principi about 5 years ago

VERIFIED

Added 192.168.5.252/255.255.255.255, result in /etc/httpd/admin-conf/httpd.conf:

  Allow from 127.0.0.1 [...] 192.168.5.252

Packager note
Release with #2820

#10 Updated by Davide Principi about 5 years ago

#11 Updated by Davide Principi about 5 years ago

  • Status changed from ON_QA to VERIFIED
  • % Done changed from 70 to 90

#12 Updated by Davide Principi about 5 years ago

  • Assignee deleted (Davide Principi)

#13 Updated by Davide Principi about 5 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100

In nethserver-updates:
nethserver-base-2.3.0-1.ns6.noarch.rpm
nethserver-firewall-base-2.0.0-1.ns6.noarch.rpm
nethserver-httpd-admin-1.3.0-1.ns6.noarch.rpm
nethserver-lib-2.1.0-1.ns6.noarch.rpm
nethserver-yum-1.3.2-1.ns6.noarch.rpm

Also available in: Atom PDF