Skip to content

Commit fe66754

Browse files
miss-islingtonserhiy-storchakaclaude
authored
[3.15] gh-154389: Do not use uuid_create() on OpenBSD (GH-154390) (GH-154391)
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 098eb36 commit fe66754

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
@@ -4003,9 +4003,10 @@ AS_VAR_IF([ac_cv_have_uuid_generate_time_safe], [yes], [
40034003
AC_DEFINE([HAVE_UUID_GENERATE_TIME_SAFE], [1])
40044004
])
40054005

4006-
# gh-124228: While the libuuid library is available on NetBSD, it supports only UUID version 4.
4006+
# gh-124228: While the libuuid library is available on NetBSD and OpenBSD,
4007+
# it supports only UUID version 4.
40074008
# This restriction inhibits the proper generation of time-based UUIDs.
4008-
if test "$ac_sys_system" = "NetBSD"; then
4009+
if test "$ac_sys_system" = "NetBSD" || test "$ac_sys_system" = "OpenBSD"; then
40094010
have_uuid=missing
40104011
AC_DEFINE([HAVE_UUID_H], [0])
40114012
fi

0 commit comments

Comments
 (0)