Project

General

Profile

Bug #7034

NTP Orphan Mode stratum setting is not displayed in input field

Added by Thomas Rieschl 4 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
NTPD
Target version:
Start date:
12/23/2016
Due date:
% Done:

100%

Affected version:
All
Affected Architecture:
All

Description

The "Orphan Mode" setting in the NTP config is not displayed in the input form field.

It is used, though. I checked the config file (/var/etc/ntpd.conf), the correct value is used there. When submitting the form with the empty field, 12, the default value is used in the config file.

I could reproduce it in the current stable release (2.3.2-RELEASE-p1 (amd64)), on a firewall used in production and the current nightly snapshot (2.4.0-BETA (amd64), built on Thu Dec 22 16:08:06 CST 2016), freshly installed in a VM. I don't know if non-amd64 architectures are also affected.

Associated revisions

Revision d0db0f9b
Added by Jim Pingle 4 months ago

Fix variable name used to pre-fill the NTP orphan mode field, add placeholder with the default while I'm here. Fixes #7034

Revision 1a5982d9
Added by Jim Pingle 4 months ago

Fix variable name used to pre-fill the NTP orphan mode field, add placeholder with the default while I'm here. Fixes #7034

Revision 708dd35c
Added by Jim Pingle 4 months ago

Fix variable name used to pre-fill the NTP orphan mode field, add placeholder with the default while I'm here. Fixes #7034

Revision 531c3486
Added by Jim Pingle 4 months ago

Correct the method used for input validation of NTP Orphan mode. Fixes #7034

History

#1 Updated by Jim Pingle 4 months ago

  • Status changed from New to Confirmed
  • Assignee set to Jim Pingle
  • Target version set to 2.4.0
  • Affected Architecture set to All

#2 Updated by Jim Pingle 4 months ago

  • Status changed from Confirmed to Feedback
  • % Done changed from 0 to 100

#3 Updated by Thomas Rieschl 4 months ago

Wow, that was fast :)
Thanks, and happy holidays!

#4 Updated by Thomas Rieschl 4 months ago

I just tested it with the current nightly (2.4.0-BETA (amd64) built on Wed Jan 04 13:38:53 CST 2017; FreeBSD 11.0-RELEASE-p5). In general it works as expected, although, due to a typo, I noticed that the input is not being validated or filtered.
I could enter a non-numeric value which was accepted, but after restarting the ntpd the following error was logged:

syntax error in /var/etc/ntpd.conf line 7, column 7
line 7 column 7 syntax error, unexpected T_String, expecting T_Integer

Also, whitespace before and after the number is not removed, but that is just cosmetic and doesn't trigger an error.

Thanks!

#5 Updated by Jim Pingle 4 months ago

  • Status changed from Feedback to Confirmed

Yep, something isn't quite right with how it's doing validation.

#6 Updated by Jim Pingle 4 months ago

  • Status changed from Confirmed to Feedback

#7 Updated by Thomas Rieschl 4 months ago

Just tested again with 2.4.0-BETA (amd64) built on Fri Jan 06 01:41:07 CST 2017, FreeBSD 11.0-RELEASE-p5 and it's working now as expected. Also, the weird behavior when entering "12" is gone :)

Although, your trim in line 98 (https://github.com/pfsense/pfsense/commit/531c348639adb8b7e7d190e8fdab709fea61f61a#diff-e65382559f6744c6c0a4ab8ac8be6a3fR98) is moot, because " 13" won't validate as numeric anyway.

Thanks!

#8 Updated by Jim Pingle 4 months ago

  • Status changed from Feedback to Resolved

#9 Updated by Jim Pingle 3 months ago

  • Target version changed from 2.4.0 to 2.3.3

Also available in: Atom PDF