meta-tpm: code style fixup

Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
This commit is contained in:
Lans Zhang
2017-07-20 10:30:19 +08:00
parent a654b0702f
commit dffeaacd06
7 changed files with 56 additions and 18 deletions
@@ -1,6 +1,9 @@
DESCRIPTION = "Basic packagegroup for TCG TSS and utilities that use it."
LICENSE = "MIT"
PR = "r0"
LIC_FILES_CHKSUM = "\
file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420 \
"
inherit packagegroup
@@ -1 +1 @@
include linux-yocto-tpm.inc
require linux-yocto-tpm.inc
@@ -1,6 +1,6 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/linux-yocto:"
SRC_URI += " \
SRC_URI += "\
${@bb.utils.contains('DISTRO_FEATURES', 'tpm', \
'file://tpm.scc file://tpm.cfg', '', d)} \
"
@@ -1,16 +1,3 @@
..........................................................................
. WARNING
.
. This file is a kernel configuration fragment, and not a full kernel
. configuration file. The final kernel configuration is made up of
. an assembly of processed fragments, each of which is designed to
. capture a specific part of the final configuration (e.g. platform
. configuration, feature configuration, and board specific hardware
. configuration). For more information on kernel configuration, please
. consult the product documentation.
.
..........................................................................
CONFIG_TCG_TPM=y
CONFIG_TCG_TIS=y
CONFIG_TCG_ATMEL=y
@@ -1,4 +1,3 @@
define KFEATURE_DESCRIPTION "TPM 1.x enablement"
kconf hardware tpm.cfg
@@ -1 +1 @@
include linux-yocto-tpm.inc
require linux-yocto-tpm.inc
@@ -0,0 +1,49 @@
trousers: fix compiling with musl
use POSIX getpwent instead of getpwent_r
Upstream-Status: Submitted
Signed-off-by: Armin Kuster <akuster@mvista.com>
Index: git/src/tspi/ps/tspps.c
===================================================================
--- git.orig/src/tspi/ps/tspps.c
+++ git/src/tspi/ps/tspps.c
@@ -66,9 +66,6 @@ get_user_ps_path(char **file)
TSS_RESULT result;
char *file_name = NULL, *home_dir = NULL;
struct passwd *pwp;
-#if (defined (__linux) || defined (linux) || defined(__GLIBC__))
- struct passwd pw;
-#endif
struct stat stat_buf;
char buf[PASSWD_BUFSIZE];
uid_t euid;
@@ -96,24 +93,15 @@ get_user_ps_path(char **file)
#else
setpwent();
while (1) {
-#if (defined (__linux) || defined (linux) || defined(__GLIBC__))
- rc = getpwent_r(&pw, buf, PASSWD_BUFSIZE, &pwp);
- if (rc) {
- LogDebugFn("USER PS: Error getting path to home directory: getpwent_r: %s",
- strerror(rc));
- endpwent();
- return TSPERR(TSS_E_INTERNAL_ERROR);
- }
-
-#elif (defined (__FreeBSD__) || defined (__OpenBSD__))
if ((pwp = getpwent()) == NULL) {
LogDebugFn("USER PS: Error getting path to home directory: getpwent: %s",
strerror(rc));
endpwent();
+#if (defined (__FreeBSD__) || defined (__OpenBSD__))
MUTEX_UNLOCK(user_ps_path);
+#endif
return TSPERR(TSS_E_INTERNAL_ERROR);
}
-#endif
if (euid == pwp->pw_uid) {
home_dir = strdup(pwp->pw_dir);
break;