18908373 tpmadm status fails on s12_48 when run as a non-root user
authorDan Anderson <dan.anderson@oracle.com>
Mon, 14 Jul 2014 15:24:42 -0700
changeset 1999 501788b55416
parent 1998 0dfe74929e1c
child 2000 a55999d4dec9
18908373 tpmadm status fails on s12_48 when run as a non-root user
components/trousers/patches/tcsd_svrside.c.patch
--- a/components/trousers/patches/tcsd_svrside.c.patch	Fri Jul 11 07:13:49 2014 -0700
+++ b/components/trousers/patches/tcsd_svrside.c.patch	Mon Jul 14 15:24:42 2014 -0700
@@ -1,5 +1,5 @@
 --- src/tcsd/svrside.c	2010-06-09 13:19:00.000000000 -0700
-+++ src/tcsd/svrside.c	2012-04-19 11:27:31.232524632 -0700
++++ src/tcsd/svrside.c	2014-07-10 14:53:38.347867637 -0700
 @@ -27,6 +27,15 @@
  #include <arpa/inet.h>
  #include <errno.h>
@@ -280,15 +280,21 @@
  		LogError("Failed bind: %s", strerror(errno));
  		return -1;
  	}
[email protected]@ -285,7 +482,6 @@
[email protected]@ -285,7 +482,12 @@
  		LogError("Failed listen: %s", strerror(errno));
  		return -1;
  	}
 -	client_len = (unsigned)sizeof(client_addr);
++
++	if (chmod(serv_addr.un.sun_path, 0666) < 0) {
++		LogError("Failed chmod %s: %s", serv_addr.un.sun_path,
++		    strerror(errno));
++		return -1;
++	}
  	
  	if (getenv("TCSD_FOREGROUND") == NULL) {
  		if (daemon(0, 0) == -1) {
[email protected]@ -295,6 +491,12 @@
[email protected]@ -295,6 +497,12 @@
  		}
  	}
  
@@ -301,7 +307,7 @@
  	LogInfo("%s: TCSD up and running.", PACKAGE_STRING);
  	do {
  		newsd = accept(sd, (struct sockaddr *) &client_addr, &client_len);
[email protected]@ -314,20 +516,22 @@
[email protected]@ -314,20 +522,22 @@
  		}
  		LogDebug("accepted socket %i", newsd);