p11_kit, bump to 0.25.5 (#12523)

This commit is contained in:
Schrijvers Luc
2025-06-28 16:55:13 +02:00
committed by GitHub
parent 2f75251efa
commit 8b8b51ae62
3 changed files with 84 additions and 286 deletions

View File

@@ -5,11 +5,20 @@ in such a way that they're discoverable."
HOMEPAGE="https://p11-glue.freedesktop.org/p11-kit.html"
COPYRIGHT="2017 Red Hat, Inc."
LICENSE="BSD (3-clause)"
REVISION="2"
SOURCE_URI="https://github.com/p11-glue/p11-kit/releases/download/$portVersion/p11-kit-$portVersion.tar.gz"
CHECKSUM_SHA256="34c3bd8c0050dd7c4e6228aecf0f168de0a1b34562ddbf74a1c70904c2523c6f"
REVISION="1"
SOURCE_URI="https://github.com/p11-glue/p11-kit/archive/refs/tags/$portVersion.tar.gz"
CHECKSUM_SHA256="69a54cf01b1603f4721f3c576c5a6bf1ac14477ea0da0cf41e1b7cb5c3884065"
SOURCE_FILENAME="p11-kit.$portVersion.tar.gz"
SOURCE_DIR="p11-kit-$portVersion"
PATCHES="p11_kit-$portVersion.patchset"
srcGitRev_2="f973d0f6acebbe7ab2f4ab027b5adb32b97a758a"
SOURCE_URI_2="https://github.com/p11-glue/pkcs11-json/archive/$srcGitRev_2.tar.gz"
CHECKSUM_SHA256_2="76a19e37d48401fafae0d049311382a896007a4bf769eae3adbec7764a77bbef"
SOURCE_FILENAME_2="p11-glue.$portVersion.tar.gz"
SOURCE_DIR_2="pkcs11-json-$srcGitRev_2"
if [ "$targetArchitecture" = x86_gcc2 ]
then
PATCHES="p11_kit_x86-$portVersion.patchset"
fi
ARCHITECTURES="all !x86_gcc2 ?x86"
SECONDARY_ARCHITECTURES="x86"
@@ -22,7 +31,7 @@ then
commandSuffix=
fi
libVersion="0.3.0"
libVersion="0.4.1"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
@@ -54,16 +63,18 @@ BUILD_REQUIRES="
devel:libtasn1$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:autoconf
cmd:aclocal
cmd:autoconf
cmd:autopoint$secondaryArchSuffix
cmd:awk
cmd:find
cmd:gcc$secondaryArchSuffix
cmd:grep
cmd:ld$secondaryArchSuffix
cmd:libtool$secondaryArchSuffix
cmd:make
cmd:makeinfo
cmd:pkg_config$secondaryArchSuffix
cmd:python3.10
cmd:sed
"
@@ -86,6 +97,10 @@ defineDebugInfoPackage p11_kit$secondaryArchSuffix \
BUILD()
{
cp -R $sourceDir2/* subprojects/pkcs11-json
NOCONFIGURE=1 ./autogen.sh
certsInstallDir="$portPackageLinksDir/ca_root_certificates"
certsDir="$certsInstallDir/$relativeDataRootDir/ssl"
runConfigure --omit-dirs binDir ./configure --bindir $commandBinDir \
@@ -127,5 +142,6 @@ INSTALL()
TEST()
{
# 35 failed out of 1015, 4 skipped (unmounting fails due to still running processes)
make check
}

View File

@@ -1,279 +0,0 @@
From 9b14c97533a276e797732ad11dd0b653a9015bcd Mon Sep 17 00:00:00 2001
From: sfanxiang <sfanxiang@gmail.com>
Date: Tue, 2 Jan 2018 12:51:02 +0000
Subject: port to Haiku
diff --git a/common/unix-peer.c b/common/unix-peer.c
index 7fe2eea..f4c6789 100644
--- a/common/unix-peer.c
+++ b/common/unix-peer.c
@@ -41,7 +41,6 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/uio.h>
-#include <sys/errno.h>
#ifdef HAVE_UCRED_H
# include <ucred.h>
diff --git a/p11-kit/server.c b/p11-kit/server.c
index 75b93d6..0e0d806 100644
--- a/p11-kit/server.c
+++ b/p11-kit/server.c
@@ -56,6 +56,7 @@
#include <grp.h>
#include <pwd.h>
#include <signal.h>
+#include <sys/select.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/un.h>
@@ -279,7 +280,7 @@ create_socket (const char *address,
}
umask (066);
- rc = bind (sd, (struct sockaddr *)&sa, SUN_LEN (&sa));
+ rc = bind (sd, (struct sockaddr *)&sa, sizeof(sa));
if (rc == -1) {
close (sd);
p11_message_err (errno, "could not bind socket %s", socket_file);
--
2.24.0
From 8ac008f97dc467957b5a10f62a8f0465df355fcd Mon Sep 17 00:00:00 2001
From: sfanxiang <sfanxiang@gmail.com>
Date: Tue, 2 Jan 2018 14:38:35 +0000
Subject: fix frob_setuid dependency
diff --git a/Makefile.in b/Makefile.in
index d70782f..ca9f404 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -621,7 +621,7 @@ am_p11_kit_frob_setuid_OBJECTS = p11-kit/frob-setuid.$(OBJEXT)
p11_kit_frob_setuid_OBJECTS = $(am_p11_kit_frob_setuid_OBJECTS)
am__DEPENDENCIES_6 = libp11-kit-testable.la libp11-test.la \
libp11-common.la $(am__DEPENDENCIES_1)
-p11_kit_frob_setuid_DEPENDENCIES = $(am__DEPENDENCIES_6)
+p11_kit_frob_setuid_DEPENDENCIES = $(am__DEPENDENCIES_6) libp11-library.la
am_p11_kit_p11_kit_OBJECTS = p11-kit/lists.$(OBJEXT) \
p11-kit/p11-kit.$(OBJEXT) $(am__objects_1)
p11_kit_p11_kit_OBJECTS = $(am_p11_kit_p11_kit_OBJECTS)
--
2.24.0
From c47bcefb32515b71b151b3c354d17ebe7aa5c85f Mon Sep 17 00:00:00 2001
From: sfanxiang <sfanxiang@gmail.com>
Date: Wed, 3 Jan 2018 13:57:49 +0000
Subject: avoid segfault caused by ffi closures
diff --git a/p11-kit/virtual.c b/p11-kit/virtual.c
index a7bca48..c4e92f9 100644
--- a/p11-kit/virtual.c
+++ b/p11-kit/virtual.c
@@ -65,6 +65,10 @@
#include "ffi.h"
#endif
+#ifdef FFI_CLOSURES
+#undef FFI_CLOSURES /* ffi closures segfault in Haiku */
+#endif
+
/* There are 66 functions in PKCS#11, with a maximum of 8 args */
#define MAX_FUNCTIONS 66
#define MAX_ARGS 10
--
2.24.0
From 8b646b6c3ca9b07d685b4874459b8c876a19bbe2 Mon Sep 17 00:00:00 2001
From: sfanxiang <sfanxiang@gmail.com>
Date: Thu, 4 Jan 2018 12:42:37 +0000
Subject: use __thread instead of pthread_getspecific()
Using pthread_getspecific() and pthread_setspecific() leads to segfault
in this program, but doing the same with __thread doesn't.
This is just a workaround.
diff --git a/common/library.c b/common/library.c
index c1275f3..5b69965 100644
--- a/common/library.c
+++ b/common/library.c
@@ -58,8 +58,6 @@ typedef struct {
char message[P11_MESSAGE_MAX];
} p11_local;
-static p11_local * _p11_library_get_thread_local (void);
-
#ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
p11_mutex_t p11_library_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
@@ -85,9 +83,8 @@ extern locale_t p11_message_locale;
static char *
thread_local_message (void)
{
- p11_local *local;
- local = _p11_library_get_thread_local ();
- return local ? local->message : NULL;
+ static __thread p11_local local = {};
+ return local.message;
}
static char *
@@ -119,23 +116,7 @@ _p11_library_get_thread_local (void)
return &local;
}
#else
-static pthread_key_t thread_local = 0;
-static p11_local *
-_p11_library_get_thread_local (void)
-{
- p11_local *local;
-
- p11_library_init_once ();
-
- local = pthread_getspecific (thread_local);
- if (local == NULL) {
- local = calloc (1, sizeof (p11_local));
- pthread_setspecific (thread_local, local);
- }
-
- return local;
-}
#endif
static void
@@ -153,7 +134,6 @@ p11_library_init_impl (void)
P11_RECURSIVE_MUTEX_INIT (p11_library_mutex);
P11_RECURSIVE_MUTEX_INIT (p11_virtual_mutex);
#ifndef P11_TLS_KEYWORD
- pthread_key_create (&thread_local, free);
#endif
p11_message_storage = thread_local_message;
#ifdef HAVE_STRERROR_L
@@ -175,9 +155,6 @@ p11_library_uninit (void)
uninit_common ();
#ifndef P11_TLS_KEYWORD
- /* Some cleanup to pacify valgrind */
- free (pthread_getspecific (thread_local));
- pthread_setspecific (thread_local, NULL);
#endif
#ifdef HAVE_STRERROR_L
@@ -185,7 +162,6 @@ p11_library_uninit (void)
#endif
p11_message_storage = dont_store_message;
#ifndef P11_TLS_KEYWORD
- pthread_key_delete (thread_local);
#endif
p11_mutex_uninit (&p11_virtual_mutex);
p11_mutex_uninit (&p11_library_mutex);
--
2.24.0
From 2b19ec4b17ced537506f7f417149949aac72259c Mon Sep 17 00:00:00 2001
From: sfanxiang <sfanxiang@gmail.com>
Date: Thu, 4 Jan 2018 13:40:33 +0000
Subject: trust/save: don't use hard links on Haiku
diff --git a/trust/save.c b/trust/save.c
index bb77348..2946a42 100644
--- a/trust/save.c
+++ b/trust/save.c
@@ -184,7 +184,7 @@ dir_free (p11_save_dir *dir) {
free (dir);
}
-#ifdef OS_UNIX
+#if defined(OS_UNIX) && !defined(__HAIKU__)
static int
on_unique_try_link (void *data,
@@ -202,7 +202,7 @@ on_unique_try_link (void *data,
return 1; /* All done */
}
-#else /* OS_WIN32 */
+#else /* defined(OS_UNIX) && !defined(__HAIKU__) */
static int
on_unique_try_rename (void *data,
@@ -222,7 +222,7 @@ on_unique_try_rename (void *data,
return 1; /* All done */
}
-#endif /* OS_WIN32 */
+#endif /* defined(OS_UNIX) && !defined(__HAIKU__) */
bool
p11_save_finish_file (p11_save_file *file,
@@ -249,7 +249,7 @@ p11_save_finish_file (p11_save_file *file,
p11_message_err (errno, "couldn't write file: %s", file->temp);
ret = false;
-#ifdef OS_UNIX
+#if defined(OS_UNIX) && !defined(__HAIKU__)
/* Set the mode of the file, readable by everyone, but not writable */
} else if (chmod (file->temp, S_IRUSR | S_IRGRP | S_IROTH) < 0) {
p11_message_err (errno, "couldn't set file permissions: %s", file->temp);
@@ -281,7 +281,7 @@ p11_save_finish_file (p11_save_file *file,
}
unlink (file->temp);
-#else /* OS_WIN32 */
+#else /* defined(OS_UNIX) && !defined(__HAIKU__) */
/* Windows does not do atomic renames, so delete original file first */
} else {
@@ -308,7 +308,7 @@ p11_save_finish_file (p11_save_file *file,
unlink (file->temp);
}
-#endif /* OS_WIN32 */
+#endif /* defined(OS_UNIX) && !defined(__HAIKU__) */
}
if (ret && path_out) {
--
2.24.0
From f8463ea9d066263cb4ef08e3598c1ad899124415 Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Tue, 29 May 2018 16:08:23 +0000
Subject: fix incorrect printf format for pid_t.
diff --git a/common/debug.c b/common/debug.c
index bcf6e21..cf18090 100644
--- a/common/debug.c
+++ b/common/debug.c
@@ -140,7 +140,7 @@ p11_debug_message (int flag,
va_list args;
if (flag & p11_debug_current_flags) {
- fprintf (stderr, "(p11-kit:%d) ", getpid());
+ fprintf (stderr, "(p11-kit:%ld) ", getpid());
va_start (args, format);
vfprintf (stderr, format, args);
va_end (args);
@@ -157,7 +157,7 @@ p11_debug_message_err (int flag,
char strerr[P11_DEBUG_MESSAGE_MAX];
if (flag & p11_debug_current_flags) {
- fprintf (stderr, "(p11-kit:%d) ", getpid());
+ fprintf (stderr, "(p11-kit:%ld) ", getpid());
va_start (args, format);
vfprintf (stderr, format, args);
va_end (args);
--
2.24.0

View File

@@ -0,0 +1,61 @@
From 4761722751567b65956b3de6d9e9a093bf2492fd Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Tue, 29 May 2018 16:08:23 +0000
Subject: fix incorrect printf format for pid_t.
diff --git a/common/debug.c b/common/debug.c
index 9d12c8c..f22cd61 100644
--- a/common/debug.c
+++ b/common/debug.c
@@ -138,7 +138,7 @@ p11_debug_message (int flag,
va_list args;
if (flag & p11_debug_current_flags) {
- fprintf (stderr, "(p11-kit:%d) ", getpid());
+ fprintf (stderr, "(p11-kit:%ld) ", getpid());
va_start (args, format);
vfprintf (stderr, format, args);
va_end (args);
@@ -155,7 +155,7 @@ p11_debug_message_err (int flag,
char strerr[P11_DEBUG_MESSAGE_MAX];
if (flag & p11_debug_current_flags) {
- fprintf (stderr, "(p11-kit:%d) ", getpid());
+ fprintf (stderr, "(p11-kit:%ld) ", getpid());
va_start (args, format);
vfprintf (stderr, format, args);
va_end (args);
diff --git a/p11-kit/server.c b/p11-kit/server.c
index 05302d7..7dc3b44 100644
--- a/p11-kit/server.c
+++ b/p11-kit/server.c
@@ -449,14 +449,14 @@ print_environment (pid_t pid, Server *server, bool csh)
printf ("setenv %s %s;\n",
P11_KIT_SERVER_ADDRESS_ENV,
address);
- printf ("setenv %s %d;\n",
+ printf ("setenv %s %ld;\n",
P11_KIT_SERVER_PID_ENV,
pid);
} else {
printf ("%s=%s; export %s;\n",
P11_KIT_SERVER_ADDRESS_ENV, address,
P11_KIT_SERVER_ADDRESS_ENV);
- printf ("%s=%d; export %s;\n",
+ printf ("%s=%ld; export %s;\n",
P11_KIT_SERVER_PID_ENV, pid,
P11_KIT_SERVER_PID_ENV);
}
@@ -854,7 +854,7 @@ main (int argc,
if (name == NULL) {
const char *runtime_dir;
- if (asprintf (&name, "pkcs11-%d", getpid ()) < 0) {
+ if (asprintf (&name, "pkcs11-%ld", getpid ()) < 0) {
ret = 1;
goto out;
}
--
2.48.1