Project

General

Profile

Bug #2309

Invalid mac address leads to host data being lost

Added by Brian Rak over 8 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Web Interface
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

I was preparing a machine that I didn't know the full mac address for, so I entered 'aa:bb:cc:dd:ee:ff:gg'. When I actually tried to create the host, I got this error:

invalid value for Integer: "0xgg" 

ArgumentError
invalid value for Integer: "0xgg" 
lib/net/validations.rb:43:in `normalize_mac'
lib/net/validations.rb:43:in `map'
lib/net/validations.rb:43:in `normalize_mac'
app/models/host.rb:933:in `normalize_addresses'
app/models/orchestration.rb:50:in `valid?'
app/controllers/hosts_controller.rb:89:in `create'
lib/foreman/thread_session.rb:31:in `clear_thread'

Seems like there's two issues here:
1) I was allowed to enter a MAC with too many octets
2) Validation failed when one of the octets contained invalid hex characters

History

#1 Updated by Anonymous about 4 years ago

  • Description updated (diff)
  • Status changed from New to Resolved

should be better validated now

Also available in: Atom PDF