summaryrefslogtreecommitdiff
path: root/app-crypt/trousers/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-05-12 16:42:50 +0300
committerV3n3RiX <venerix@koprulu.sector>2022-05-12 16:42:50 +0300
commit752d6256e5204b958b0ef7905675a940b5e9172f (patch)
tree330d16e6362a49cbed8875a777fe641a43376cd3 /app-crypt/trousers/files
parent0c100b7dd2b30e75b799d806df4ef899fd98e1ea (diff)
gentoo resync : 12.05.2022
Diffstat (limited to 'app-crypt/trousers/files')
-rw-r--r--app-crypt/trousers/files/tcsd.confd9
-rw-r--r--app-crypt/trousers/files/tcsd.initd31
-rw-r--r--app-crypt/trousers/files/trousers-0.3.14-fno-common.patch15
-rw-r--r--app-crypt/trousers/files/trousers-0.3.14-tcsd-fixes.patch58
4 files changed, 6 insertions, 107 deletions
diff --git a/app-crypt/trousers/files/tcsd.confd b/app-crypt/trousers/files/tcsd.confd
deleted file mode 100644
index 78bedb9fda30..000000000000
--- a/app-crypt/trousers/files/tcsd.confd
+++ /dev/null
@@ -1,9 +0,0 @@
-# /etc/conf.d/tscd
-
-# Configuration file for the TrouSerS' TCS daemon (tcsd) init script
-# Have a look on /etc/tcsd.conf too, there is more to configure there.
-
-# TPM_MODULES: name of the module(s) that should be loaded. You only need to
-# set this if your driver is not compiled in kernel and is not already loaded
-# on boot. (default: unset)
-#TPM_MODULES="tpm_atmel"
diff --git a/app-crypt/trousers/files/tcsd.initd b/app-crypt/trousers/files/tcsd.initd
index c9c050cb06d9..9b18c48e1ee3 100644
--- a/app-crypt/trousers/files/tcsd.initd
+++ b/app-crypt/trousers/files/tcsd.initd
@@ -1,38 +1,19 @@
#!/sbin/openrc-run
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
+command=/usr/sbin/tcsd
+description="TrouSerS' TCS daemon (tcsd)"
+command_user="tss:tss"
+
depend() {
use logger
need net
}
-checkconfig() {
- local mod
- if [ -n "${TPM_MODULES}" ] ; then
- for mod in ${TPM_MODULES} ; do
- lsmod | grep -q "^${mod}\b" \
- || modprobe ${mod} &>/dev/null \
- || ewarn "Failed to load module ${mod}"
- done
- # Should we sleep or something to wait for device creation?
- fi
+start_pre() {
if [ ! -c /dev/tpm ] && [ ! -c /dev/tpm0 ] ; then
eerror "No TPM device found!"
return 1
fi
- return 0
-}
-
-start() {
- ebegin "Starting TrouSerS' TCS daemon (tcsd)"
- checkconfig || eend $?
- start-stop-daemon --start --user tss --exec /usr/sbin/tcsd
- eend $?
-}
-
-stop() {
- ebegin "Stopping TrouSerS' TCS daemon (tcsd)"
- start-stop-daemon --stop --quiet --exec /usr/sbin/tcsd --user tss
- eend $?
}
diff --git a/app-crypt/trousers/files/trousers-0.3.14-fno-common.patch b/app-crypt/trousers/files/trousers-0.3.14-fno-common.patch
deleted file mode 100644
index 5046bc70883b..000000000000
--- a/app-crypt/trousers/files/trousers-0.3.14-fno-common.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/include/tcsd.h b/src/include/tcsd.h
-index 5b9462b..05bae97 100644
---- a/src/include/tcsd.h
-+++ b/src/include/tcsd.h
-@@ -166,8 +166,8 @@ void thread_signal_init();
-
- /* signal handling */
- #ifndef __APPLE__
--struct sigaction tcsd_sa_int;
--struct sigaction tcsd_sa_chld;
-+extern struct sigaction tcsd_sa_int;
-+extern struct sigaction tcsd_sa_chld;
- #endif
-
- #endif
diff --git a/app-crypt/trousers/files/trousers-0.3.14-tcsd-fixes.patch b/app-crypt/trousers/files/trousers-0.3.14-tcsd-fixes.patch
deleted file mode 100644
index 10031e088293..000000000000
--- a/app-crypt/trousers/files/trousers-0.3.14-tcsd-fixes.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-Index: trousers-0.3.14/src/tcs/ps/tcsps.c
-===================================================================
---- trousers-0.3.14.orig/src/tcs/ps/tcsps.c
-+++ trousers-0.3.14/src/tcs/ps/tcsps.c
-@@ -72,7 +72,7 @@ get_file()
- }
-
- /* open and lock the file */
-- system_ps_fd = open(tcsd_options.system_ps_file, O_CREAT|O_RDWR, 0600);
-+ system_ps_fd = open(tcsd_options.system_ps_file, O_CREAT|O_RDWR|O_NOFOLLOW, 0600);
- if (system_ps_fd < 0) {
- LogError("system PS: open() of %s failed: %s",
- tcsd_options.system_ps_file, strerror(errno));
-Index: trousers-0.3.14/src/tcsd/svrside.c
-===================================================================
---- trousers-0.3.14.orig/src/tcsd/svrside.c
-+++ trousers-0.3.14/src/tcsd/svrside.c
-@@ -473,6 +473,7 @@ main(int argc, char **argv)
- }
- return TCSERR(TSS_E_INTERNAL_ERROR);
- }
-+ setgid(pwd->pw_gid);
- setuid(pwd->pw_uid);
- #endif
- #endif
-Index: trousers-0.3.14/src/tcsd/tcsd_conf.c
-===================================================================
---- trousers-0.3.14.orig/src/tcsd/tcsd_conf.c
-+++ trousers-0.3.14/src/tcsd/tcsd_conf.c
-@@ -743,7 +743,7 @@ conf_file_init(struct tcsd_config *conf)
- #ifndef SOLARIS
- struct group *grp;
- struct passwd *pw;
-- mode_t mode = (S_IRUSR|S_IWUSR);
-+ mode_t mode = (S_IRUSR|S_IWUSR|S_IRGRP);
- #endif /* SOLARIS */
- TSS_RESULT result;
-
-@@ -798,15 +798,15 @@ conf_file_init(struct tcsd_config *conf)
- }
-
- /* make sure user/group TSS owns the conf file */
-- if (pw->pw_uid != stat_buf.st_uid || grp->gr_gid != stat_buf.st_gid) {
-+ if (stat_buf.st_uid != 0 || grp->gr_gid != stat_buf.st_gid) {
- LogError("TCSD config file (%s) must be user/group %s/%s", tcsd_config_file,
-- TSS_USER_NAME, TSS_GROUP_NAME);
-+ "root", TSS_GROUP_NAME);
- return TCSERR(TSS_E_INTERNAL_ERROR);
- }
-
-- /* make sure only the tss user can manipulate the config file */
-+ /* make sure only the tss user can read (but not manipulate) the config file */
- if (((stat_buf.st_mode & 0777) ^ mode) != 0) {
-- LogError("TCSD config file (%s) must be mode 0600", tcsd_config_file);
-+ LogError("TCSD config file (%s) must be mode 0640", tcsd_config_file);
- return TCSERR(TSS_E_INTERNAL_ERROR);
- }
- #endif /* SOLARIS */