Enhancement #3044

MultiWAN: restrict validator for weight field

Added by Giacomo Sanchietti over 6 years ago. Updated over 6 years ago.

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

100%

Category:nethserver-firewall-base
Target version:v6.6
Resolution: NEEDINFO:No

Description

When the user wants to create a new provider inside the MultiWAN page, he must enter a weight as an integer.
Current validator allows any non-negative integer number, but underlying implementation (ip command) doesn't allow a value greater than 255.

The new validator must allow any integer number between 1 and 255.

provider.png - MultiWAN menu screenshot (26.7 KB) Nicola Rauso, 02/18/2015 10:53 AM


Related issues

Related to NethServer 6 - Bug #3049: Integer validator accepts strings containing number and b... CLOSED
Related to Nethgui - Bug #3067: Numeric validators accept strings with spaces CLOSED

Associated revisions

Revision 8ff869e1
Added by Giacomo Sanchietti over 6 years ago

Web UI: restrict validator for weight field. Refs #3044

Revision 913ca270
Added by Davide Principi over 6 years ago

Added special test case. Refs #3044

History

#1 Updated by Giacomo Sanchietti over 6 years ago

Reported error is:

Shorewall is not running
Error: argument "1001" is wrong: "weight" is invalid 

ERROR: Command "ip -4 route replace default scope global table 250 nexthop via 10.0.3.2 dev eth1 weight 1001" 
Failed /usr/share/shorewall/lib.common: line 113: 3695 Terminated $SHOREWALL_SHELL $script $options $@

#2 Updated by Giacomo Sanchietti over 6 years ago

  • Category set to nethserver-firewall-base
  • Status changed from NEW to TRIAGED
  • Target version set to v6.6
  • % Done changed from 0 to 20

#3 Updated by Giacomo Sanchietti over 6 years ago

  • Assignee set to Giacomo Sanchietti

#4 Updated by Giacomo Sanchietti over 6 years ago

  • Status changed from TRIAGED to ON_DEV
  • % Done changed from 20 to 30

#5 Updated by Giacomo Sanchietti over 6 years ago

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

#6 Updated by Giacomo Sanchietti over 6 years ago

  • Status changed from MODIFIED to ON_QA
  • Assignee deleted (Giacomo Sanchietti)
  • % Done changed from 60 to 70
Package in nethserver-testing:
  • nethserver-firewall-base-2.2.3-1.7.g98ddcc2.ns6.noarch.rpm
Test case
  • Check the user can enter only values between 1 and 255

#7 Updated by Nicola Rauso over 6 years ago

  • Assignee set to Nicola Rauso

#8 Updated by Nicola Rauso over 6 years ago

  • File provider.png added
  • Status changed from ON_QA to TRIAGED
  • Assignee deleted (Nicola Rauso)
  • % Done changed from 70 to 20

The validator allows the presence of a blank before weight value but in that case shorewall configuration is not valid and the service could not restart.

Web inteface generates an error (see attachment) and into "messages" log you find:

Feb 18 16:42:45 mynsrv logger: ERROR:Shorewall restart failed
Feb 18 16:42:45 mynsrv esmith::event[27940]: [ERROR] Shorewall restart:    ERROR: Invalid providers file entry (too many columns) /etc/shorewall/providers (line 24)
Feb 18 16:42:45 mynsrv esmith::event[27940]: Action: /etc/e-smith/events/nethserver-firewall-base-save/S89nethserver-shorewall-restart FAILED: 1 [0.771475]
Feb 18 16:42:45 mynsrv esmith::event[27940]: [INFO] service lsm restart
Feb 18 16:42:45 mynsrv init: lsm main process (27737) killed by TERM signal
Feb 18 16:42:46 mynsrv esmith::event[27940]: lsm start/running, process 28317
Feb 18 16:42:46 mynsrv esmith::event[27940]: [INFO] lsm restart
Feb 18 16:42:46 mynsrv esmith::event[27940]: Action: /etc/e-smith/events/actions/adjust-services SUCCESS [0.232769]
Feb 18 16:42:46 mynsrv esmith::event[27940]: Event: nethserver-firewall-base-save FAILED
Feb 18 16:42:46 mynsrv esmith::event[27939]: Action: /etc/e-smith/events/firewall-adjust/S20firewall-adjust FAILED: 1 [1.408746]
Feb 18 16:42:46 mynsrv esmith::event[27939]: Event: firewall-adjust FAILED
installed package:
  • nethserver-firewall-base-2.2.3-1.7.g98ddcc2.ns6.noarch

#9 Updated by Giacomo Sanchietti over 6 years ago

  • Status changed from TRIAGED to MODIFIED
  • % Done changed from 20 to 60

The bug is inside the framework code, re-test when #3049 is fixed.

#10 Updated by Giacomo Sanchietti over 6 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70

#11 Updated by Giacomo Sanchietti over 6 years ago

  • Related to Bug #3049: Integer validator accepts strings containing number and beginning with spaces added

#12 Updated by Nicola Rauso over 6 years ago

  • Assignee set to Nicola Rauso

#13 Updated by Nicola Rauso over 6 years ago

  • Status changed from ON_QA to VERIFIED
  • Assignee deleted (Nicola Rauso)
  • % Done changed from 70 to 90

Tested: OK

#14 Updated by Davide Principi over 6 years ago

  • Related to Bug #3067: Numeric validators accept strings with spaces added

#15 Updated by Giacomo Sanchietti over 6 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100
Released in nethserver-base:
  • nethserver-firewall-base-2.3.0-1.ns6.noarch.rpm
  • nethserver-httpd-admin-1.3.7-1.ns6.noarch

Also available in: Atom PDF