Skip to content

Commit 45d5301

Browse files
miss-islingtonserhiy-storchakaclaude
authored
[3.13] gh-154389: Do not use uuid_create() on OpenBSD (GH-154390) (GH-154393)
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 1f822bd commit 45d5301

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
@@ -3836,9 +3836,10 @@ AS_VAR_IF([ac_cv_have_uuid_generate_time_safe], [yes], [
38363836
AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [1])
38373837
])
38383838

3839-
# gh-124228: While the libuuid library is available on NetBSD, it supports only UUID version 4.
3839+
# gh-124228: While the libuuid library is available on NetBSD and OpenBSD,
3840+
# it supports only UUID version 4.
38403841
# This restriction inhibits the proper generation of time-based UUIDs.
3841-
if test "$ac_sys_system" = "NetBSD"; then
3842+
if test "$ac_sys_system" = "NetBSD" || test "$ac_sys_system" = "OpenBSD"; then
38423843
have_uuid=missing
38433844
AC_DEFINE([HAVE_UUID_H], [0])
38443845
fi

0 commit comments

Comments
 (0)