pub struct MachineIdFile { /* private fields */ }Expand description
/etc/machine-id — the systemd-managed primary host identifier on modern Linux.
§Known-duplicate filtering
A non-trivial fraction of Linux installs ship or end up with machine-id
values that are identical across many machines (Whonix’s deliberate
anti-fingerprinting constant; official container images that bake a
single hex value into the filesystem layer; synthetic all-same-nibble
values from broken image builds). Returning one of those would produce
a silently non-unique identity shared by every host that inherits it,
so this source additionally rejects, by returning Ok(None) with a
log::debug! entry:
- A curated list of public, citable shared values (
MACHINE_ID_DENYLIST). - Any 32-hex-digit value whose nibbles are all the same character
(
00…0,11…1,aa…a, etc.). The systemd spec forbids all-zero machine-ids outright; the rest are only ever seen on synthetic or corrupt images.
Anything not matching the filter passes through unchanged — the intent is to reject known garbage, not to gate on machine-id shape. A false positive here drops a legitimate host from identity resolution, so a missing entry is strictly preferable to an over-broad rule.
Implementations§
Trait Implementations§
Source§impl Clone for MachineIdFile
impl Clone for MachineIdFile
Source§fn clone(&self) -> MachineIdFile
fn clone(&self) -> MachineIdFile
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more