diff options
| -rw-r--r-- | recipes-tpm/trousers/files/0001-Check-that-getpwent_r-is-available-before-using-it.patch | 85 | ||||
| -rw-r--r-- | recipes-tpm/trousers/files/0001-tsp_tcsi_param.c-Include-limits.h-for-POSIX_MAX.patch | 36 | ||||
| -rw-r--r-- | recipes-tpm/trousers/files/07-read_data-not-inline.patch | 65 | ||||
| -rw-r--r-- | recipes-tpm/trousers/trousers_git.bb (renamed from recipes-tpm/trousers/trousers_0.3.13.bb) | 40 |
4 files changed, 20 insertions, 206 deletions
diff --git a/recipes-tpm/trousers/files/0001-Check-that-getpwent_r-is-available-before-using-it.patch b/recipes-tpm/trousers/files/0001-Check-that-getpwent_r-is-available-before-using-it.patch deleted file mode 100644 index e7ba2eb..0000000 --- a/recipes-tpm/trousers/files/0001-Check-that-getpwent_r-is-available-before-using-it.patch +++ /dev/null | |||
| @@ -1,85 +0,0 @@ | |||
| 1 | From bb721b0ae5882992037153e7257791101172556e Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?No=C3=A9=20Rubinstein?= <nrubinstein@aldebaran.com> | ||
| 3 | Date: Wed, 24 Aug 2016 18:55:25 +0200 | ||
| 4 | Subject: [PATCH] Check that getpwent_r is available before using it | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | This fixes building trousers with musl | ||
| 10 | |||
| 11 | Signed-off-by: Noé Rubinstein <nrubinstein@aldebaran.com> | ||
| 12 | --- | ||
| 13 | Upstream-Status: Inappropriate [not author https://git.busybox.net/buildroot/plain/package/trousers/0004-Check-that-getpwent_r-is-available-before-using-it.patch] | ||
| 14 | Signed-off-by: André Draszik <adraszik@tycoint.com> | ||
| 15 | configure.in | 4 ++++ | ||
| 16 | src/tspi/ps/tspps.c | 10 +++++----- | ||
| 17 | 2 files changed, 9 insertions(+), 5 deletions(-) | ||
| 18 | |||
| 19 | diff --git a/configure.in b/configure.in | ||
| 20 | index add23dc..cfdfcaa 100644 | ||
| 21 | --- a/configure.in | ||
| 22 | +++ b/configure.in | ||
| 23 | @@ -144,6 +144,10 @@ else | ||
| 24 | AC_MSG_ERROR(["gtk", "openssl" and "none" are the only supported gui options for trousers]) | ||
| 25 | fi | ||
| 26 | |||
| 27 | +# Look for getpwent_r. If it is not found, getpwent will be used instead, with | ||
| 28 | +# an additional mutex. | ||
| 29 | +AC_CHECK_FUNC(getpwent_r, [AC_DEFINE(HAVE_GETPWENT_R)]) | ||
| 30 | + | ||
| 31 | # | ||
| 32 | # The default port that the TCS daemon listens on | ||
| 33 | # | ||
| 34 | diff --git a/src/tspi/ps/tspps.c b/src/tspi/ps/tspps.c | ||
| 35 | index c6f9c3d..9d00d2a 100644 | ||
| 36 | --- a/src/tspi/ps/tspps.c | ||
| 37 | +++ b/src/tspi/ps/tspps.c | ||
| 38 | @@ -45,7 +45,7 @@ | ||
| 39 | |||
| 40 | static int user_ps_fd = -1; | ||
| 41 | static MUTEX_DECLARE_INIT(user_ps_lock); | ||
| 42 | -#if (defined (__FreeBSD__) || defined (__OpenBSD__)) | ||
| 43 | +#ifndef HAVE_GETPWENT_R | ||
| 44 | static MUTEX_DECLARE_INIT(user_ps_path); | ||
| 45 | #endif | ||
| 46 | static struct flock fl; | ||
| 47 | @@ -60,7 +60,7 @@ get_user_ps_path(char **file) | ||
| 48 | TSS_RESULT result; | ||
| 49 | char *file_name = NULL, *home_dir = NULL; | ||
| 50 | struct passwd *pwp; | ||
| 51 | -#if (defined (__linux) || defined (linux) || defined(__GLIBC__)) | ||
| 52 | +#ifdef HAVE_GETPWENT_R | ||
| 53 | struct passwd pw; | ||
| 54 | #endif | ||
| 55 | struct stat stat_buf; | ||
| 56 | @@ -72,7 +72,7 @@ get_user_ps_path(char **file) | ||
| 57 | *file = strdup(file_name); | ||
| 58 | return (*file) ? TSS_SUCCESS : TSPERR(TSS_E_OUTOFMEMORY); | ||
| 59 | } | ||
| 60 | -#if (defined (__FreeBSD__) || defined (__OpenBSD__)) | ||
| 61 | +#ifndef HAVE_GETPWENT_R | ||
| 62 | MUTEX_LOCK(user_ps_path); | ||
| 63 | #endif | ||
| 64 | |||
| 65 | @@ -90,7 +90,7 @@ get_user_ps_path(char **file) | ||
| 66 | #else | ||
| 67 | setpwent(); | ||
| 68 | while (1) { | ||
| 69 | -#if (defined (__linux) || defined (linux) || defined(__GLIBC__)) | ||
| 70 | +#ifdef HAVE_GETPWENT_R | ||
| 71 | rc = getpwent_r(&pw, buf, PASSWD_BUFSIZE, &pwp); | ||
| 72 | if (rc) { | ||
| 73 | LogDebugFn("USER PS: Error getting path to home directory: getpwent_r: %s", | ||
| 74 | @@ -99,7 +99,7 @@ get_user_ps_path(char **file) | ||
| 75 | return TSPERR(TSS_E_INTERNAL_ERROR); | ||
| 76 | } | ||
| 77 | |||
| 78 | -#elif (defined (__FreeBSD__) || defined (__OpenBSD__)) | ||
| 79 | +#else | ||
| 80 | if ((pwp = getpwent()) == NULL) { | ||
| 81 | LogDebugFn("USER PS: Error getting path to home directory: getpwent: %s", | ||
| 82 | strerror(rc)); | ||
| 83 | -- | ||
| 84 | 2.10.2 | ||
| 85 | |||
diff --git a/recipes-tpm/trousers/files/0001-tsp_tcsi_param.c-Include-limits.h-for-POSIX_MAX.patch b/recipes-tpm/trousers/files/0001-tsp_tcsi_param.c-Include-limits.h-for-POSIX_MAX.patch deleted file mode 100644 index c01040d..0000000 --- a/recipes-tpm/trousers/files/0001-tsp_tcsi_param.c-Include-limits.h-for-POSIX_MAX.patch +++ /dev/null | |||
| @@ -1,36 +0,0 @@ | |||
| 1 | From c1b5f33845c56dc7aef769c99758b4f77a041d43 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Felix Janda <felix.janda@posteo.de> | ||
| 3 | Date: Wed, 31 Aug 2016 22:52:58 -0400 | ||
| 4 | Subject: [PATCH] tsp_tcsi_param.c: Include <limits.h> for POSIX_MAX | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | Use POSIX instead of glibc-specific header. | ||
| 10 | Fixes compilation with musl libc. | ||
| 11 | |||
| 12 | Signed-off-by: Felix Janda <felix.janda@posteo.de> | ||
| 13 | Reviewed-by: Hon Ching(Vicky) Lo <honclo@linux.vnet.ibm.com> | ||
| 14 | |||
| 15 | --- | ||
| 16 | Upstream-Status: Backport [https://sourceforge.net/p/trousers/trousers/ci/59351a56cac1710e89d207dff07eb23bbc644c13/] | ||
| 17 | Signed-off-by: André Draszik <adraszik@tycoint.com> | ||
| 18 | src/tspi/tsp_tcsi_param.c | 2 +- | ||
| 19 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 20 | |||
| 21 | diff --git a/src/tspi/tsp_tcsi_param.c b/src/tspi/tsp_tcsi_param.c | ||
| 22 | index 670f86f..8f2b4e4 100644 | ||
| 23 | --- a/src/tspi/tsp_tcsi_param.c | ||
| 24 | +++ b/src/tspi/tsp_tcsi_param.c | ||
| 25 | @@ -11,7 +11,7 @@ | ||
| 26 | #include <stdlib.h> | ||
| 27 | #include <string.h> | ||
| 28 | #include <stdio.h> | ||
| 29 | -#include <bits/local_lim.h> | ||
| 30 | +#include <limits.h> | ||
| 31 | #include "trousers/tss.h" | ||
| 32 | #include "trousers/trousers.h" | ||
| 33 | #include "trousers_types.h" | ||
| 34 | -- | ||
| 35 | 2.10.2 | ||
| 36 | |||
diff --git a/recipes-tpm/trousers/files/07-read_data-not-inline.patch b/recipes-tpm/trousers/files/07-read_data-not-inline.patch deleted file mode 100644 index 76ba98a..0000000 --- a/recipes-tpm/trousers/files/07-read_data-not-inline.patch +++ /dev/null | |||
| @@ -1,65 +0,0 @@ | |||
| 1 | Title: Remove inline keyword for read_data and write_data | ||
| 2 | Date: 2015-06-28 | ||
| 3 | Origin: https://chromium.googlesource.com/chromiumos%2Fthird_party%2Ftrousers/+/c9c7cd50640c2d8882a04f59f1bcb383a88b19e9 | ||
| 4 | Bug-Debian: http://bugs.debian.org/778149 | ||
| 5 | Index: trousers/src/include/tcsps.h | ||
| 6 | =================================================================== | ||
| 7 | --- trousers.orig/src/include/tcsps.h | ||
| 8 | +++ trousers/src/include/tcsps.h | ||
| 9 | @@ -23,13 +23,6 @@ int get_file(); | ||
| 10 | int put_file(int); | ||
| 11 | void close_file(int); | ||
| 12 | void ps_destroy(); | ||
| 13 | -#ifdef SOLARIS | ||
| 14 | -TSS_RESULT read_data(int, void *, UINT32); | ||
| 15 | -TSS_RESULT write_data(int, void *, UINT32); | ||
| 16 | -#else | ||
| 17 | -inline TSS_RESULT read_data(int, void *, UINT32); | ||
| 18 | -inline TSS_RESULT write_data(int, void *, UINT32); | ||
| 19 | -#endif | ||
| 20 | int write_key_init(int, UINT32, UINT32, UINT32); | ||
| 21 | TSS_RESULT cache_key(UINT32, UINT16, TSS_UUID *, TSS_UUID *, UINT16, UINT32, UINT32); | ||
| 22 | TSS_RESULT UnloadBlob_KEY_PS(UINT16 *, BYTE *, TSS_KEY *); | ||
| 23 | Index: trousers/src/include/tspps.h | ||
| 24 | =================================================================== | ||
| 25 | --- trousers.orig/src/include/tspps.h | ||
| 26 | +++ trousers/src/include/tspps.h | ||
| 27 | @@ -18,8 +18,8 @@ | ||
| 28 | |||
| 29 | TSS_RESULT get_file(int *); | ||
| 30 | int put_file(int); | ||
| 31 | -inline TSS_RESULT read_data(int, void *, UINT32); | ||
| 32 | -inline TSS_RESULT write_data(int, void *, UINT32); | ||
| 33 | +TSS_RESULT read_data(int, void *, UINT32); | ||
| 34 | +TSS_RESULT write_data(int, void *, UINT32); | ||
| 35 | UINT32 psfile_get_num_keys(int); | ||
| 36 | TSS_RESULT psfile_get_parent_uuid_by_uuid(int, TSS_UUID *, TSS_UUID *); | ||
| 37 | TSS_RESULT psfile_remove_key_by_uuid(int, TSS_UUID *); | ||
| 38 | Index: trousers/src/tcs/ps/ps_utils.c | ||
| 39 | =================================================================== | ||
| 40 | --- trousers.orig/src/tcs/ps/ps_utils.c | ||
| 41 | +++ trousers/src/tcs/ps/ps_utils.c | ||
| 42 | @@ -42,11 +42,7 @@ | ||
| 43 | struct key_disk_cache *key_disk_cache_head = NULL; | ||
| 44 | |||
| 45 | |||
| 46 | -#ifdef SOLARIS | ||
| 47 | TSS_RESULT | ||
| 48 | -#else | ||
| 49 | -inline TSS_RESULT | ||
| 50 | -#endif | ||
| 51 | read_data(int fd, void *data, UINT32 size) | ||
| 52 | { | ||
| 53 | int rc; | ||
| 54 | @@ -64,11 +60,7 @@ read_data(int fd, void *data, UINT32 siz | ||
| 55 | } | ||
| 56 | |||
| 57 | |||
| 58 | -#ifdef SOLARIS | ||
| 59 | TSS_RESULT | ||
| 60 | -#else | ||
| 61 | -inline TSS_RESULT | ||
| 62 | -#endif | ||
| 63 | write_data(int fd, void *data, UINT32 size) | ||
| 64 | { | ||
| 65 | int rc; | ||
diff --git a/recipes-tpm/trousers/trousers_0.3.13.bb b/recipes-tpm/trousers/trousers_git.bb index a69f763..1dedd7c 100644 --- a/recipes-tpm/trousers/trousers_0.3.13.bb +++ b/recipes-tpm/trousers/trousers_git.bb | |||
| @@ -6,17 +6,17 @@ SECTION = "security/tpm" | |||
| 6 | 6 | ||
| 7 | DEPENDS = "openssl" | 7 | DEPENDS = "openssl" |
| 8 | 8 | ||
| 9 | SRC_URI = "http://sourceforge.net/projects/trousers/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz \ | 9 | SRCREV = "4b9a70d5789b0b74f43957a6c19ab2156a72d3e0" |
| 10 | file://0001-tsp_tcsi_param.c-Include-limits.h-for-POSIX_MAX.patch \ | 10 | PV = "0.3.14+git${SRCPV}" |
| 11 | file://0001-Check-that-getpwent_r-is-available-before-using-it.patch \ | 11 | |
| 12 | file://07-read_data-not-inline.patch \ | 12 | SRC_URI = " \ |
| 13 | file://trousers.init.sh \ | 13 | git://git.code.sf.net/p/trousers/trousers \ |
| 14 | file://trousers-udev.rules \ | 14 | file://trousers.init.sh \ |
| 15 | file://tcsd.service \ | 15 | file://trousers-udev.rules \ |
| 16 | " | 16 | file://tcsd.service \ |
| 17 | 17 | " | |
| 18 | SRC_URI[md5sum] = "ad508f97b406f6e48cd90e85d78e7ca8" | 18 | |
| 19 | SRC_URI[sha256sum] = "bb908e4a3c88a17b247a4fc8e0fff3419d8a13170fe7bdfbe0e2c5c082a276d3" | 19 | S = "${WORKDIR}/git" |
| 20 | 20 | ||
| 21 | inherit autotools pkgconfig useradd update-rc.d ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','', d)} | 21 | inherit autotools pkgconfig useradd update-rc.d ${@bb.utils.contains('VIRTUAL-RUNTIME_init_manager','systemd','systemd','', d)} |
| 22 | 22 | ||
| @@ -61,10 +61,10 @@ FILES_libtspi = " \ | |||
| 61 | " | 61 | " |
| 62 | FILES_libtspi-dbg = " \ | 62 | FILES_libtspi-dbg = " \ |
| 63 | ${libdir}/.debug \ | 63 | ${libdir}/.debug \ |
| 64 | ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/tspi \ | 64 | ${prefix}/src/debug/${BPN}/${PV}-${PR}/git/src/tspi \ |
| 65 | ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/trspi \ | 65 | ${prefix}/src/debug/${BPN}/${PV}-${PR}/git/src/trspi \ |
| 66 | ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/include/*.h \ | 66 | ${prefix}/src/debug/${BPN}/${PV}-${PR}/git/src/include/*.h \ |
| 67 | ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/include/tss \ | 67 | ${prefix}/src/debug/${BPN}/${PV}-${PR}/git/src/include/tss \ |
| 68 | " | 68 | " |
| 69 | FILES_libtspi-dev = " \ | 69 | FILES_libtspi-dev = " \ |
| 70 | ${includedir} \ | 70 | ${includedir} \ |
| @@ -88,11 +88,11 @@ FILES_${PN}-dev += "${libdir}/trousers" | |||
| 88 | 88 | ||
| 89 | FILES_${PN}-dbg = " \ | 89 | FILES_${PN}-dbg = " \ |
| 90 | ${sbindir}/.debug \ | 90 | ${sbindir}/.debug \ |
| 91 | ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/tcs \ | 91 | ${prefix}/src/debug/${BPN}/${PV}-${PR}/git/src/tcs \ |
| 92 | ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/tcsd \ | 92 | ${prefix}/src/debug/${BPN}/${PV}-${PR}/git/src/tcsd \ |
| 93 | ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/tddl \ | 93 | ${prefix}/src/debug/${BPN}/${PV}-${PR}/git/src/tddl \ |
| 94 | ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/trousers \ | 94 | ${prefix}/src/debug/${BPN}/${PV}-${PR}/git/src/trousers \ |
| 95 | ${prefix}/src/debug/${PN}/${PV}-${PR}/${PN}-${PV}/src/include/trousers \ | 95 | ${prefix}/src/debug/${BPN}/${PV}-${PR}/git/src/include/trousers \ |
| 96 | " | 96 | " |
| 97 | FILES_${PN}-doc = " \ | 97 | FILES_${PN}-doc = " \ |
| 98 | ${mandir}/man5 \ | 98 | ${mandir}/man5 \ |
