random-seed: write the machine ID into /dev/urandom as well
authorLennart Poettering <lennart@poettering.net>
Mon, 6 Aug 2018 13:58:16 +0000 (15:58 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 20 Aug 2018 10:42:28 +0000 (12:42 +0200)
commit8ba12aef045ba1a766a73f535a114781dbb763c2
treea236b669e65577d7b5ee1a413df4b20b1fdf7e02
parentac93390b032859dd49c94c96398ebdb497ba1a73
random-seed: write the machine ID into /dev/urandom as well

This is some extra protection for sloppy "golden master" systems, where
images are duplicated many times but the random seed is not
deleted (or reset for each copy). That golden master systems have to
reset /etc/machine-id is better known, and easier to notice (as having
the same ID will result in address conflicts and suchlike quite often).
Hence let's write the machine ID into /dev/urandom, in case it has been
initialized and unlikely the stored random seed has been provisioned
differently on each image.

Note that we don't credit the entropy either way, hence in the case
there's a cycle of a) generating the machine-id early at boot and b)
writing it back into /dev/urandom late at boot it shouldn't matter. It's
never going to make things worse, just in a few cases better.
src/random-seed/random-seed.c