diff --git a/system/globalid/lnuid.cpp b/system/globalid/lnuid.cpp index 105bd4efac5..c11d8be9732 100644 --- a/system/globalid/lnuid.cpp +++ b/system/globalid/lnuid.cpp @@ -94,8 +94,9 @@ namespace ln_uid { fp = fopen("/dev/urandom", "r"); if (!fp || fread(&randomdata, 1, random_byte_count, fp) != random_byte_count) { - // Should never happen, but if it does log it and ignore + // Should never happen, but if it does log it and fallback OERRLOG("Could not read data from /dev/urandom"); + std::generate_n(randomdata, random_byte_count, [](){ return char(rand()); }); } if (fp) fclose(fp);