solettaproject / soletta

Soletta Project is a framework for making IoT devices. With Soletta Project's libraries developers can easily write software for devices that control actuators/sensors and communicate using standard technologies. It enables adding smartness even on the smallest edge devices.
http://solettaproject.org
Apache License 2.0
225 stars 108 forks source link

Fix for sol_platform_get_machine_id() #2284

Closed bsmelo closed 8 years ago

bsmelo commented 8 years ago

In case SOL_PLATFORM_LINUX is defined, this function expects an UUID from the environment variable SOL_MACHINE_ID. It was only considering UUIDs formed by 32 chars, and not 36.

This patch fixes that, leaving the length to be check by sol_util_uuid_str_is_valid(), which already does that, and if the length is 36, we remove the hyphens, since the returned value is expected to contain only hex digits. Valid formats (32 chars and 36 chars + hyphens) for UUIDs were obtained from [1].

[1] https://en.wikipedia.org/wiki/Universally_unique_identifier

Signed-off-by: Bruno Melo bsilva.melo@gmail.com

cabelitos commented 8 years ago

+1

glima commented 8 years ago

Fair for me as well

bdilly commented 8 years ago

I've granted you write access to the repository since you have lots of contributions already. Just make sure to read https://github.com/solettaproject/soletta/wiki/Contributing#contributions-flow please. Thanks

cabelitos commented 8 years ago

Merged