16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
authorDan Anderson <dan.anderson@oracle.com>
Fri, 01 Mar 2013 11:12:29 -0800
changeset 1186 447cb9b2ff93
parent 1185 835ceb24d83b
child 1187 28a8efc39260
16391309 TrouSerS ERROR: max number of connections reached (10), new connection refused
components/trousers/Makefile
components/trousers/patches/tcsd_Makefile.in.patch
components/trousers/tcsd.sh
components/trousers/tcsd.xml
components/trousers/trousers.p5m
--- a/components/trousers/Makefile	Thu Feb 28 23:38:15 2013 -0700
+++ b/components/trousers/Makefile	Fri Mar 01 11:12:29 2013 -0800
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../../make-rules/shared-macros.mk
@@ -42,13 +42,17 @@
 
 LIBS=-lnsl -lsocket -lgen
 
+CONFIGURE_OPTIONS += --sbindir=/usr/lib
 CONFIGURE_OPTIONS += --with-gui=openssl
 CONFIGURE_OPTIONS += CC="$(CC)"
 CONFIGURE_OPTIONS += LD="$(CC)"
 CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
-CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)"
+CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS) -lpthread -lbsm -lscf -lresolv"
 CONFIGURE_OPTIONS += LIBS="$(LIBS)"
 
+# Enable ASLR for this component
+ASLR_MODE = $(ASLR_ENABLE)
+
 COMPONENT_POST_CONFIGURE_ACTION = (cd $(COMPONENT_SRC); \
 	for f in `ls src/include/tss/*.h` ; do \
 		/usr/bin/dos2unix $$f $$f; \
--- a/components/trousers/patches/tcsd_Makefile.in.patch	Thu Feb 28 23:38:15 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
---- src/tcsd/Makefile.in.old	Thu Jan 28 13:56:46 2010
-+++ src/tcsd/Makefile.in	Wed Mar  3 16:35:23 2010
[email protected]@ -47,7 +47,7 @@
- mkinstalldirs = $(install_sh) -d
- CONFIG_CLEAN_FILES =
- CONFIG_CLEAN_VPATH_FILES =
--am__installdirs = "$(DESTDIR)$(sbindir)"
-+am__installdirs = "$(DESTDIR)$(libdir)"
- PROGRAMS = $(sbin_PROGRAMS)
- am_tcsd_OBJECTS = tcsd-svrside.$(OBJEXT) tcsd-tcsd_conf.$(OBJEXT) \
- 	tcsd-tcsd_threads.$(OBJEXT) tcsd-platform.$(OBJEXT)
[email protected]@ -185,7 +185,7 @@
- prefix = @[email protected]
- program_transform_name = @[email protected]
- psdir = @[email protected]
--sbindir = @[email protected]
-+sbindir = @[email protected]
- sharedstatedir = @[email protected]
- srcdir = @[email protected]
- sysconfdir = @[email protected]
[email protected]@ -200,7 +200,8 @@
- tcsd_CFLAGS = -DAPPID=\"TCSD\" -DVAR_PREFIX=\"@[email protected]\" \
- 	-DETC_PREFIX=\"@[email protected]\" -I${top_srcdir}/src/include \
- 	$(am__append_1) $(am__append_2)
--tcsd_LDADD = ${top_builddir}/src/tcs/libtcs.a ${top_builddir}/src/tddl/libtddl.a -lpthread @[email protected]
-+tcsd_LDADD = ${top_builddir}/src/tcs/libtcs.a ${top_builddir}/src/tddl/libtddl.a \
-+	-lpthread -lbsm -lscf -lresolv @[email protected]
- tcsd_SOURCES = svrside.c tcsd_conf.c tcsd_threads.c platform.c
- all: all-am
- 
--- a/components/trousers/tcsd.sh	Thu Feb 28 23:38:15 2013 -0700
+++ b/components/trousers/tcsd.sh	Fri Mar 01 11:12:29 2013 -0800
@@ -1,4 +1,4 @@
-#!/sbin/sh
+#! /usr/bin/sh
 #
 # CDDL HEADER START
 #
@@ -19,7 +19,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
 #
 
 . /lib/svc/share/smf_include.sh
@@ -29,32 +29,26 @@
 
 if [ -z "$SMF_FMRI" ]; then
 	echo "SMF framework variables are not initialized."
-	exit $SMF_EXIT_ERR
+	exit $SMF_EXIT_ERR_NOSMF
 fi
 
-tcsd_start() 	{
-	echo /usr/lib/64/tcsd 
-	/usr/lib/64/tcsd >/dev/null 2>&1 &
-}
-	
-tcsd_stop()	{
-	/usr/bin/pkill -x tcsd >/dev/null 2>&1
-}
-
 case "$1" in
 'start')
-	tcsd_start 
-	;;
+	if [ ! -r "/dev/tpm" ]; then
+		smf_method_exit $SMF_EXIT_TEMP_DISABLE no_supported_hardware \
+			"No TPM device /dev/tpm found"
+	fi
 
-'stop')
-	tcsd_stop
+	echo /usr/lib/tcsd 
+	/usr/lib/tcsd >/dev/null 2>&1 &
 	;;
 
+# Attribute exec=':kill' in manifest tcsd.xml stops the tcsd daemon.
 
 *)
-	echo "Usage: $0 {start|stop}"
+	echo "Usage: $0 start"
 	exit 1
 	;;
+esac
 
-esac
 exit $SMF_EXIT_OK
--- a/components/trousers/tcsd.xml	Thu Feb 28 23:38:15 2013 -0700
+++ b/components/trousers/tcsd.xml	Fri Mar 01 11:12:29 2013 -0800
@@ -21,7 +21,7 @@
 
  CDDL HEADER END
 
- Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
 
         NOTE:  This service manifest is not editable; its contents will
         be overwritten by package or patch operations, including
@@ -59,8 +59,8 @@
 
         <exec_method
                 type='method'
-                name='stop'
-                exec='/lib/svc/method/tcsd.sh stop'
+                name='start'
+                exec='/lib/svc/method/tcsd.sh start'
                 timeout_seconds='60'>
 		<method_context>
 			<method_credential user='root' group='sys' />
@@ -69,8 +69,8 @@
 
         <exec_method
                 type='method'
-                name='start'
-                exec='/lib/svc/method/tcsd.sh start'
+                name='stop'
+                exec=':kill'
                 timeout_seconds='60'>
 		<method_context>
 			<method_credential user='root' group='sys' />
@@ -100,7 +100,7 @@
 	<template>
 		<common_name>
 			<loctext xml:lang='C'>
-				TCS Daemon
+				Trusted Computing Services Daemon
 			</loctext>
 		</common_name>
 		<documentation>
--- a/components/trousers/trousers.p5m	Thu Feb 28 23:38:15 2013 -0700
+++ b/components/trousers/trousers.p5m	Fri Mar 01 11:12:29 2013 -0800
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
 #
 
 <transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
@@ -84,11 +84,10 @@
 file path=usr/include/tss/tss_structs.h
 file path=usr/include/tss/tss_typedef.h
 file path=usr/lib/$(MACH64)/libtspi.so.1.1.3
-file path=usr/lib/$(MACH64)/tcsd mode=555 owner=root
+file path=usr/lib/$(MACH64)/llib-ltspi.ln
 file path=usr/lib/libtspi.so.1.1.3
 file path=usr/lib/llib-ltspi
 file path=usr/lib/llib-ltspi.ln
-file path=usr/lib/$(MACH64)/llib-ltspi.ln
 file path=usr/lib/tcsd mode=555 owner=root
 file path=usr/share/man/man3/Tspi_ChangeAuth.3
 file path=usr/share/man/man3/Tspi_ChangeAuthAsym.3
@@ -189,7 +188,8 @@
 link path=usr/lib/libtspi.so target=libtspi.so.1.1.3
 link path=usr/lib/libtspi.so.1 target=libtspi.so.1.1.3
 #
-# libtspi requires 646%UTF-8.so in package utf-8. This is for function
-# Trspi_Native_To_UNICODE() which calls iconv_open() to open this library.
+# libtspi requires 646%UTF-16LE.so and UTF-16LE%646.so, which are in
+# package utf-8. This is for function Trspi_Native_To_UNICODE() which calls
+# iconv_open() to dynamically load these libraries
 #
 depend fmri=pkg:/system/library/iconv/utf-8 type=require