diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-05-26 16:07:55 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-05-26 21:44:15 +0200 |
commit | 6f7530929538b28cb41c289ad9cbced51848fc02 (patch) | |
tree | c5c8dadaa66409750bce7be1a83fbfe7f085728f | |
parent | update TODO (diff) | |
download | systemd-6f7530929538b28cb41c289ad9cbced51848fc02.tar.xz systemd-6f7530929538b28cb41c289ad9cbced51848fc02.zip |
man: document that it is guaranteed that generated ID128 are never all-zero or all-one
This is the case because the ID128 we generate are all marked as v4 UUID
which requires that some bits are zero and others are one. Let's
document this so that people can rely on SD_ID128_NULL being a special
value for "uninitialized" that is always distinguishable from generated
UUIDs.
-rw-r--r-- | man/sd_id128_get_machine.xml | 16 | ||||
-rw-r--r-- | man/sd_id128_randomize.xml | 5 |
2 files changed, 13 insertions, 8 deletions
diff --git a/man/sd_id128_get_machine.xml b/man/sd_id128_get_machine.xml index 2df4496f19..7fa9860898 100644 --- a/man/sd_id128_get_machine.xml +++ b/man/sd_id128_get_machine.xml @@ -99,12 +99,16 @@ <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry> for details. The ID is cached internally. In future a different mechanism to determine the invocation ID may be added.</para> - <para>Note that <function>sd_id128_get_machine_app_specific()</function>, <function>sd_id128_get_boot()</function>, - <function>sd_id128_get_boot_app_specific()</function>, and <function>sd_id128_get_invocation()</function> always - return UUID v4 compatible IDs. <function>sd_id128_get_machine()</function> will also return a UUID v4-compatible - ID on new installations but might not on older. It is possible to convert the machine ID into a UUID v4-compatible - one. For more information, see - <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para> + <para>Note that <function>sd_id128_get_machine_app_specific()</function>, + <function>sd_id128_get_boot()</function>, <function>sd_id128_get_boot_app_specific()</function>, and + <function>sd_id128_get_invocation()</function> always return UUID v4 compatible IDs. + <function>sd_id128_get_machine()</function> will also return a UUID v4-compatible ID on new installations + but might not on older. It is possible to convert the machine ID into a UUID v4-compatible one. For more + information, see + <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>. It is + hence guaranteed that thes functions will never return the ID consisting of all zero or all one bits + (<constant>SD_ID128_NULL</constant>, <constant>SD_ID128_ALLF</constant>) — with the possible exception of + <function>sd_id128_get_machine()</function>, as mentioned.</para> <para>For more information about the <literal>sd_id128_t</literal> type see diff --git a/man/sd_id128_randomize.xml b/man/sd_id128_randomize.xml index cf6ca7726f..0bc1d0abd8 100644 --- a/man/sd_id128_randomize.xml +++ b/man/sd_id128_randomize.xml @@ -42,8 +42,9 @@ <filename>/dev/urandom</filename> kernel random number generator.</para> - <para>Note that <function>sd_id128_randomize()</function> always - returns a UUID v4-compatible ID.</para> + <para>Note that <function>sd_id128_randomize()</function> always returns a UUID v4-compatible ID. It is + hence guaranteed that this function will never return the ID consisting of all zero or all one bits + (<constant>SD_ID128_NULL</constant>, <constant>SD_ID128_ALLF</constant>).</para> <para>For more information about the <literal>sd_id128_t</literal> type, see |