Skip to content

Commit f838462

Browse files
miss-islingtonserhiy-storchakaclaude
authored
[3.14] gh-154389: Do not use uuid_create() on OpenBSD (GH-154390) (GH-154392)
Like NetBSD, OpenBSD generates version 4 UUIDs in uuid_create(), so it cannot be used for uuid.uuid1(). (cherry picked from commit c76fb91) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent ec95872 commit f838462

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix :func:`uuid.uuid1` on OpenBSD:
2+
it returned a version 4 UUID,
3+
because ``uuid_create()`` generates random UUIDs on this platform.

configure

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3894,9 +3894,10 @@ AS_VAR_IF([ac_cv_have_uuid_generate_time_safe], [yes], [
38943894
AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [1])
38953895
])
38963896

3897-
# gh-124228: While the libuuid library is available on NetBSD, it supports only UUID version 4.
3897+
# gh-124228: While the libuuid library is available on NetBSD and OpenBSD,
3898+
# it supports only UUID version 4.
38983899
# This restriction inhibits the proper generation of time-based UUIDs.
3899-
if test "$ac_sys_system" = "NetBSD"; then
3900+
if test "$ac_sys_system" = "NetBSD" || test "$ac_sys_system" = "OpenBSD"; then
39003901
have_uuid=missing
39013902
AC_DEFINE([HAVE_UUID_H], [0])
39023903
fi

0 commit comments

Comments
 (0)