Project

General

Profile

Bug #28566

Do not allow underscores in hostname

Added by Dr K K over 1 year ago. Updated about 1 year ago.

Status:
Done
Priority:
Nice to have
Assignee:
Brandon Schneider
Category:
Middleware
Target version:
Seen in:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

https://forums.freenas.org/index.php?threads/bogus-host-name.61677/

User was allowed to enter the underscore character in the GUI setting for hostname; underscores are not permitted, causes error to be reported in log.

Solution: The input should be sanitized to allow only alnum, hyphen, and dot.

-DrKK

Associated revisions

Revision 05876a49 (diff)
Added by Brandon Schneider over 1 year ago

fix(gui): Do not allow underscores in hostname

Ticket: #28566

Revision 04bd01f9 (diff)
Added by Brandon Schneider over 1 year ago

fix(gui): Do not allow underscores in hostname (#893)

Ticket: #28566

Revision fe2e70a0 (diff)
Added by Dru Lavigne about 1 year ago

Doc hostname limitation.
Ticket: #28566

Revision 70b30460 (diff)
Added by Dru Lavigne about 1 year ago

Doc hostname limitation.
Ticket: #28566

History

#1 Updated by Dr K K over 1 year ago

  • Seen in changed from 11.0-U5 to 11.1-U2

#2 Updated by Timur Bakeyev over 1 year ago

The correct hostname regexp should look something like:

/^(([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])$/

#3 Updated by Dru Lavigne over 1 year ago

  • Category set to Middleware
  • Assignee changed from Release Council to William Grzybowski
  • Target version set to 11.2-RC2

William: if a middleware piece is not needed, please pass to Erin for the new UI.

#4 Updated by William Grzybowski over 1 year ago

  • Assignee changed from William Grzybowski to Brandon Schneider

#5 Avatar?id=14398&size=24x24 Updated by Kris Moore over 1 year ago

  • Due date set to 02/23/2018

#6 Updated by Brandon Schneider over 1 year ago

  • Status changed from Not Started to In Progress

#7 Updated by Dru Lavigne over 1 year ago

  • Subject changed from sanitization of hostname input box to Do not allow underscores in hostname
  • Status changed from In Progress to Done
  • Target version changed from 11.2-RC2 to 11.2-BETA1
  • Needs Merging changed from Yes to No

#8 Updated by Dru Lavigne about 1 year ago

  • Status changed from Done to Ready for Testing

#9 Updated by Timur Bakeyev about 1 year ago

  • Severity set to New

I wonder, why this REGEXP wasn't used. It's the correct, RFC-compliant one, so prevents hostnames like -hostname, -0, etc. Applied REGEXP is still too broad.

Timur Bakeyev wrote:

The correct hostname regexp should look something like:
/^(([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])$/

#10 Updated by Dru Lavigne about 1 year ago

  • Status changed from Ready for Testing to Unscreened

#11 Updated by William Grzybowski about 1 year ago

  • Status changed from Unscreened to Ready for Testing

It was not used because the change was simple enough, we have no intent in using mystical regexp.

We may revisit this in the future if another issue arises.

#13 Updated by Ethan Large about 1 year ago

  • Status changed from Ready for Testing to Passed Testing
  • Needs QA changed from Yes to No

Tested with FreeNAS-11.2-MASTER-201806060445-62522c5.iso.

Working as intended. Attempting to enter a hostname with an underscore or other invalid characters will result in an error message and an inability to save the name.

#14 Updated by Dru Lavigne about 1 year ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF