Lease file corrupted by comma in hostname
name: Lease file corrupted by comma in hostname
about: KEA 1.4 Lease file
Describe the bug The KEA DHCP server that provides DHCP for our guest network couldn't be started (after being stopped) because the lease file was corrupted.
After some digging we found the issue: The lease file contained hostnames which had a comma in the hostname (please don't ask me why someone would do this). Since the leasefile contained over 100 records of hostnames with a comma, the KEA DHCP service wouldn't start because of a "corrupted lease file".
I've noticed that spaces in the hostname are converted inside the leasefile to "\032". However, comma's aren't converted, and break the leasefile, since its a CSV.
To Reproduce Steps to reproduce the behavior:
- lease an IP address to a host with a comma in the hostname
- stop the kea service
- start the kea service
- look at the logging:
2019-05-15 13:08:38.647 ERROR [kea-dhcp4.dhcpsrv/485] DHCPSRV_MEMFILE_LEASE_LOAD_ROW_ERROR discarding row 637, error: bad lexical cast: source type value could not be interpreted as target
- If more than 100 of these lines occur the KEA service won't start.
Expected behavior Expected behavior is that comma's within the hostname (even though that is a bad practice) will be converted as well (just like space characters).
Environment:
- Kea version: KEA 1.4
- OS: Ubuntu 16.04 x64
Additional Information Example hostname:
HOST, NAME01