Project

General

Profile

Actions

Bug #2309

closed

Invalid mac address leads to host data being lost

Added by Brian Rak about 11 years ago. Updated almost 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Web Interface
Target version:
-
Difficulty:
Triaged:
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

Actions #1

Updated by Anonymous almost 7 years ago

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

should be better validated now

Actions

Also available in: Atom PDF