gcc-6: don't ship info pages
[unleashed-userland.git] / components / trousers / patches / 70-dilos.patch
blobbdd357c5c9a6cead81d275a1a7a0c40f7c58f360
1 Index: trousers-0.3.11.2/src/tspi/rpc/hosttable.c
2 ===================================================================
3 --- trousers-0.3.11.2/src/tspi/rpc/hosttable.c.orig
4 +++ trousers-0.3.11.2/src/tspi/rpc/hosttable.c
5 @@ -21,7 +21,7 @@
7 static struct host_table *ht = NULL;
9 -TSS_RESULT
10 +static TSS_RESULT
11 host_table_init()
13 ht = calloc(1, sizeof(struct host_table));
14 @@ -35,9 +35,8 @@ host_table_init()
15 return TSS_SUCCESS;
18 -#ifdef SOLARIS
19 -#pragma init(_init)
20 -void _init(void)
21 +#ifdef SOLARIS && defined(__SUNPRO_C))
22 +static void my_init(void)
23 #else
24 void __attribute__ ((constructor)) my_init(void)
25 #endif
26 @@ -46,11 +45,14 @@ void __attribute__ ((constructor)) my_in
27 __tspi_obj_list_init();
30 -void
31 +static void
32 host_table_final()
34 struct host_table_entry *hte, *next = NULL;
36 + if (ht == NULL) /* no host table to free */
37 + return;
39 MUTEX_LOCK(ht->lock);
41 for (hte = ht->entries; hte; hte = next) {
42 @@ -69,9 +71,8 @@ host_table_final()
43 ht = NULL;
46 -#ifdef SOLARIS
47 -#pragma fini(_fini)
48 -void _fini(void)
49 +#ifdef SOLARIS && defined(__SUNPRO_C))
50 +static void my_fini(void)
51 #else
52 void __attribute__ ((destructor)) my_fini(void)
53 #endif
54 @@ -79,6 +80,11 @@ void __attribute__ ((destructor)) my_fin
55 host_table_final();
58 +#ifdef SOLARIS
59 +#pragma init(my_init)
60 +#pragma fini(my_fini)
61 +#endif
63 TSS_RESULT
64 __tspi_add_table_entry(TSS_HCONTEXT tspContext, BYTE *host, int type, struct host_table_entry **ret)
66 Index: trousers-0.3.11.2/src/tcsd/Makefile.am
67 ===================================================================
68 --- trousers-0.3.11.2/src/tcsd/Makefile.am.orig
69 +++ trousers-0.3.11.2/src/tcsd/Makefile.am
70 @@ -2,7 +2,7 @@ sbin_PROGRAMS=tcsd
72 tcsd_CFLAGS=-DAPPID=\"TCSD\" -DVAR_PREFIX=\"@localstatedir@\" -DETC_PREFIX=\"@sysconfdir@\" -I${top_srcdir}/src/include -fPIE -DPIE
73 tcsd_LDADD=${top_builddir}/src/tcs/libtcs.a ${top_builddir}/src/tddl/libtddl.a -lpthread @CRYPTOLIB@
74 -tcsd_LDFLAGS=-pie -Wl,-z,relro -Wl,-z,now
75 +tcsd_LDFLAGS=-pie -Wl,-z,now
77 tcsd_SOURCES=svrside.c tcsd_conf.c tcsd_threads.c platform.c
79 Index: trousers-0.3.11.2/src/tcsd/Makefile.in
80 ===================================================================
81 --- trousers-0.3.11.2/src/tcsd/Makefile.in.orig
82 +++ trousers-0.3.11.2/src/tcsd/Makefile.in
83 @@ -64,7 +64,7 @@ am__configure_deps = $(am__aclocal_m4_de
84 mkinstalldirs = $(install_sh) -d
85 CONFIG_CLEAN_FILES =
86 CONFIG_CLEAN_VPATH_FILES =
87 -am__installdirs = "$(DESTDIR)$(sbindir)"
88 +am__installdirs = "$(DESTDIR)$(libdir)"
89 PROGRAMS = $(sbin_PROGRAMS)
90 am_tcsd_OBJECTS = tcsd-svrside.$(OBJEXT) tcsd-tcsd_conf.$(OBJEXT) \
91 tcsd-tcsd_threads.$(OBJEXT) tcsd-platform.$(OBJEXT)
92 @@ -212,7 +212,7 @@ pdfdir = @pdfdir@
93 prefix = @prefix@
94 program_transform_name = @program_transform_name@
95 psdir = @psdir@
96 -sbindir = @sbindir@
97 +sbindir = @libdir@
98 sharedstatedir = @sharedstatedir@
99 srcdir = @srcdir@
100 sysconfdir = @sysconfdir@
101 @@ -227,8 +227,9 @@ top_srcdir = @top_srcdir@
102 tcsd_CFLAGS = -DAPPID=\"TCSD\" -DVAR_PREFIX=\"@localstatedir@\" \
103 -DETC_PREFIX=\"@sysconfdir@\" -I${top_srcdir}/src/include \
104 -fPIE -DPIE $(am__append_1) $(am__append_2)
105 -tcsd_LDADD = ${top_builddir}/src/tcs/libtcs.a ${top_builddir}/src/tddl/libtddl.a -lpthread @CRYPTOLIB@
106 -tcsd_LDFLAGS = -pie -Wl,-z,relro -Wl,-z,now
107 +tcsd_LDADD = ${top_builddir}/src/tcs/libtcs.a ${top_builddir}/src/tddl/libtddl.a \
108 + -lpthread -lbsm -lscf -lresolv @CRYPTOLIB@
109 +tcsd_LDFLAGS = -pie -Wl,-z,now
110 tcsd_SOURCES = svrside.c tcsd_conf.c tcsd_threads.c platform.c
111 all: all-am
113 Index: trousers-0.3.11.2/src/include/tcsd.h
114 ===================================================================
115 --- trousers-0.3.11.2/src/include/tcsd.h.orig
116 +++ trousers-0.3.11.2/src/include/tcsd.h
117 @@ -48,15 +48,25 @@ struct tcsd_config
118 of this TCS System */
121 +#ifdef SOLARIS
122 +#define TCSD_DEFAULT_CONFIG_FILE "/etc/security/tcsd.conf"
123 +#else
124 #define TCSD_DEFAULT_CONFIG_FILE ETC_PREFIX "/tcsd.conf"
125 +#endif
126 extern char *tcsd_config_file;
128 #define TSS_USER_NAME "tss"
129 #define TSS_GROUP_NAME "tss"
131 #define TCSD_DEFAULT_MAX_THREADS 10
132 +#ifdef SOLARIS
133 +#define TCSD_DEFAULT_SYSTEM_PS_DIR "/var/tpm/system"
134 +#define TCSD_DEFAULT_SYSTEM_PS_FILE "/var/tpm/system/system.data"
135 +#define TCSD_DEFAULT_SOCKET "/var/tpm/tcsd-socket"
136 +#else
137 #define TCSD_DEFAULT_SYSTEM_PS_FILE VAR_PREFIX "/lib/tpm/system.data"
138 #define TCSD_DEFAULT_SYSTEM_PS_DIR VAR_PREFIX "/lib/tpm"
139 +#endif /* SOLARIS */
140 #define TCSD_DEFAULT_FIRMWARE_LOG_FILE "/sys/kernel/security/tpm0/binary_bios_measurements"
141 #define TCSD_DEFAULT_KERNEL_LOG_FILE "/sys/kernel/security/ima/binary_runtime_measurements"
142 #define TCSD_DEFAULT_FIRMWARE_PCRS 0x00000000
143 Index: trousers-0.3.11.2/src/include/tspps.h
144 ===================================================================
145 --- trousers-0.3.11.2/src/include/tspps.h.orig
146 +++ trousers-0.3.11.2/src/include/tspps.h
147 @@ -13,13 +13,17 @@
149 #define PASSWD_BUFSIZE 4096
151 +#ifdef SOLARIS
152 +#define TSS_USER_PS_DIR "/var/user/"
153 +#else
154 #define TSS_USER_PS_DIR ".trousers"
155 +#endif
156 #define TSS_USER_PS_FILE "user.data"
158 TSS_RESULT get_file(int *);
159 int put_file(int);
160 -inline TSS_RESULT read_data(int, void *, UINT32);
161 -inline TSS_RESULT write_data(int, void *, UINT32);
162 +TSS_RESULT read_data(int, void *, UINT32);
163 +TSS_RESULT write_data(int, void *, UINT32);
164 UINT32 psfile_get_num_keys(int);
165 TSS_RESULT psfile_get_parent_uuid_by_uuid(int, TSS_UUID *, TSS_UUID *);
166 TSS_RESULT psfile_remove_key_by_uuid(int, TSS_UUID *);
167 Index: trousers-0.3.11.2/src/tcsd/svrside.c
168 ===================================================================
169 --- trousers-0.3.11.2/src/tcsd/svrside.c.orig
170 +++ trousers-0.3.11.2/src/tcsd/svrside.c
171 @@ -27,6 +27,15 @@
172 #include <arpa/inet.h>
173 #include <errno.h>
174 #include <getopt.h>
175 +#ifdef SOLARIS
176 +#include <priv.h>
177 +#include <fcntl.h>
178 +#endif
179 +#ifndef HAVE_DAEMON
180 +#include <fcntl.h>
181 +#include <syslog.h>
182 +#endif
184 #include "trousers/tss.h"
185 #include "trousers_types.h"
186 #include "tcs_tsp.h"
187 @@ -46,6 +55,10 @@ extern char *optarg;
188 int sd;
189 char *tcsd_config_file = NULL;
191 +#ifdef SOLARIS
192 +static int get_event_log_from_kernel(void);
193 +#endif
195 static void
196 tcsd_shutdown(void)
198 @@ -173,6 +186,10 @@ tcsd_startup(void)
199 (void)req_mgr_final();
200 return result;
202 +#ifdef SOLARIS
203 + /* Not fatal if this fails */
204 + (void) get_event_log_from_kernel();
205 +#endif
207 result = owner_evict_init();
208 if (result != TSS_SUCCESS) {
209 @@ -211,16 +228,171 @@ reload_config(void)
210 return result;
213 +#ifdef SOLARIS
215 +extern int get_device_fd(void);
217 +#define TPM_IOCTL_GETEVTABLE 1
218 +struct tpm_evtable_ioblk {
219 + uint32_t buflen;
220 + caddr_t buf;
223 +static int
224 +store_eventlog(char *filename, struct tpm_evtable_ioblk *evlog)
226 + int fd;
227 + unsigned int bytes = 0;
229 + fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT, 0600);
230 + if (fd == -1) {
231 + LogError("Error opening logfile %s: %s", filename,
232 + strerror(errno));
233 + return (-1);
235 + while (bytes < evlog->buflen) {
236 + int n;
237 + n = write(fd, evlog->buf, evlog->buflen - bytes);
238 + if (n == -1 && errno != EAGAIN) {
239 + LogError("Error writing logfile %s: %s",
240 + filename, strerror(errno));
241 + close(fd);
242 + return (-1);
244 + if (n != -1)
245 + bytes += n;
247 + close(fd);
249 + return (0);
252 +static int
253 +get_event_log_from_kernel(void)
255 + int fd = get_device_fd();
256 + struct tpm_evtable_ioblk ioblk;
258 + if (fd == -1)
259 + return (-1);
261 + (void) memset(&ioblk, 0, sizeof (ioblk));
262 + if (ioctl(fd, TPM_IOCTL_GETEVTABLE, &ioblk)) {
263 + LogDebug("Cannot get event log from kernel: %s",
264 + strerror(errno));
265 + return (-1);
267 + if (ioblk.buflen == 0)
268 + return (0);
270 + ioblk.buf = calloc(1, ioblk.buflen);
271 + if (ioblk.buf == NULL) {
272 + return (-1);
274 + if (ioctl(fd, TPM_IOCTL_GETEVTABLE, &ioblk)) {
275 + free(ioblk.buf);
276 + LogDebug("Cannot get event log from kernel: %s",
277 + strerror(errno));
278 + return (-1);
281 + return (store_eventlog(tcsd_options.firmware_log_file, &ioblk));
285 + * For Solaris, make the tcsd privilege aware and drop
286 + * risky privileges if they are not needed.
287 + */
288 +static int
289 +drop_privs(void)
291 + priv_set_t *myprivs;
292 + int rv;
294 + /*
295 + * Drop unneeded privs such as fork/exec.
297 + * Get "basic" privs and remove the ones we don't want.
298 + */
299 + if ((myprivs = priv_str_to_set("basic", ",", NULL)) == NULL) {
300 + LogError("priv_str_to_set failed: %s", strerror(errno));
301 + return (1);
302 + } else {
303 + (void) priv_delset(myprivs, PRIV_PROC_EXEC);
304 + (void) priv_delset(myprivs, PRIV_PROC_FORK);
305 + (void) priv_delset(myprivs, PRIV_FILE_LINK_ANY);
306 + (void) priv_delset(myprivs, PRIV_PROC_INFO);
307 + (void) priv_delset(myprivs, PRIV_PROC_SESSION);
308 + (void) priv_delset(myprivs, PRIV_PROC_SETID);
310 + /* for auditing */
311 + (void) priv_addset(myprivs, PRIV_PROC_AUDIT);
313 + if ((rv = setppriv(PRIV_SET, PRIV_PERMITTED, myprivs)))
314 + return (rv);
315 + if ((rv = setppriv(PRIV_SET, PRIV_LIMIT, myprivs)))
316 + return (rv);
317 + if ((rv = setppriv(PRIV_SET, PRIV_INHERITABLE, myprivs)))
318 + return (rv);
320 + (void) priv_freeset(myprivs);
322 + return (0);
324 +#endif /* SOLARIS */
326 +#ifndef HAVE_DAEMON
327 +static int
328 +daemon(int nochdir, int noclose) {
329 + int rv, fd;
331 + if (!noclose) {
332 + closelog();
333 + closefrom(0);
336 + switch (fork()) {
337 + case -1: /* failure: parent process */
338 + return (-1);
339 + case 0: /* success: child process */
340 + break;
341 + default: /* success: parent process */
342 + exit (0);
345 + /* Create a new SID for the child process */
346 + if (setsid() == -1)
347 + return (-1);
348 + /* Prevent cwd from being left open and unremovable */
349 + if (!nochdir)
350 + (void) chdir("/");
351 + (void) umask(0);
352 + /* Redirect stdin, stdout, and stderr to /dev/null */
353 + if (!noclose && (fd = open("/dev/null", O_RDWR, 0)) != -1) {
354 + (void) dup2(fd, STDIN_FILENO);
355 + (void) dup2(fd, STDOUT_FILENO);
356 + (void) dup2(fd, STDERR_FILENO);
357 + if (fd > 2)
358 + (void)close (fd);
360 + return (0);
362 +#endif /* !HAVE_DAEMON */
365 main(int argc, char **argv)
367 - struct sockaddr_in serv_addr, client_addr;
368 + typedef union {
369 + struct sockaddr_in in;
370 + struct sockaddr_un un;
371 + } sockaddr_un_in_t;
372 + sockaddr_un_in_t serv_addr, client_addr;
373 + int rv;
374 TSS_RESULT result;
375 int newsd, c, option_index = 0;
376 - unsigned client_len;
377 + unsigned client_len, serv_len;
378 char *hostname = NULL;
379 - struct passwd *pwd;
380 + struct passwd *pwd = NULL;
381 struct hostent *client_hostent = NULL;
382 struct option long_options[] = {
383 {"help", 0, NULL, 'h'},
384 @@ -256,26 +428,50 @@ main(int argc, char **argv)
385 if ((result = tcsd_startup()))
386 return (int)result;
388 - sd = socket(AF_INET, SOCK_STREAM, 0);
389 - if (sd < 0) {
390 - LogError("Failed socket: %s", strerror(errno));
391 - return -1;
393 + if (tcsd_options.port == 0) { /* UNIX Domain socket */
394 + /* Use UNIX Domain socket instead of TCP/IP socket */
395 + sd = socket(AF_UNIX, SOCK_STREAM, 0);
396 + if (sd < 0) {
397 + LogError("Failed socket: %s", strerror(errno));
398 + return -1;
401 + memset(&serv_addr, 0, sizeof (serv_addr));
402 + serv_addr.un.sun_family = AF_UNIX;
403 + strncpy(serv_addr.un.sun_path, TCSD_DEFAULT_SOCKET,
404 + sizeof (serv_addr.un.sun_path));
405 + (void) unlink(TCSD_DEFAULT_SOCKET);
407 + } else { /* TCP socket */
408 + sd = socket(AF_INET, SOCK_STREAM, 0);
409 + if (sd < 0) {
410 + LogError("Failed socket: %s", strerror(errno));
411 + return -1;
414 - memset(&serv_addr, 0, sizeof (serv_addr));
415 - serv_addr.sin_family = AF_INET;
416 - serv_addr.sin_port = htons(tcsd_options.port);
418 - /* If no remote_ops are defined, restrict connections to localhost
419 - * only at the socket. */
420 - if (tcsd_options.remote_ops[0] == 0)
421 - serv_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
422 - else
423 - serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
425 - c = 1;
426 - setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, &c, sizeof(c));
427 - if (bind(sd, (struct sockaddr *) &serv_addr, sizeof (serv_addr)) < 0) {
428 + memset(&serv_addr, 0, sizeof (serv_addr));
429 + serv_addr.in.sin_family = AF_INET;
430 + serv_addr.in.sin_port = htons(tcsd_options.port);
432 + /* If no remote_ops are defined, restrict connections to localhost
433 + * only at the socket. */
434 + if (tcsd_options.remote_ops[0] == 0)
435 + serv_addr.in.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
436 + else
437 + serv_addr.in.sin_addr.s_addr = htonl(INADDR_ANY);
439 + c = 1;
440 + setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, &c, sizeof(c));
443 + if (tcsd_options.port == 0) { /* UNIX Domain socket */
444 + serv_len = (unsigned)sizeof(serv_addr.un);
445 + client_len = (unsigned)sizeof(client_addr.un);
446 + } else { /* TCP socket */
447 + serv_len = (unsigned)sizeof(serv_addr.in);
448 + client_len = (unsigned)sizeof(client_addr.in);
450 + if (bind(sd, (struct sockaddr *) &serv_addr, serv_len) < 0) {
451 LogError("Failed bind: %s", strerror(errno));
452 return -1;
454 @@ -296,7 +492,6 @@ main(int argc, char **argv)
455 LogError("Failed listen: %s", strerror(errno));
456 return -1;
458 - client_len = (unsigned)sizeof(client_addr);
460 if (getenv("TCSD_FOREGROUND") == NULL) {
461 if (daemon(0, 0) == -1) {
462 @@ -306,6 +501,12 @@ main(int argc, char **argv)
466 +#ifdef SOLARIS
467 + /* For Solaris, drop privileges for security. */
468 + if ((rv = drop_privs()))
469 + return (rv);
470 +#endif /* SOLARIS */
472 LogInfo("%s: TCSD up and running.", PACKAGE_STRING);
473 do {
474 newsd = accept(sd, (struct sockaddr *) &client_addr, &client_len);
475 @@ -325,20 +526,22 @@ main(int argc, char **argv)
477 LogDebug("accepted socket %i", newsd);
479 - if ((client_hostent = gethostbyaddr((char *) &client_addr.sin_addr,
480 - sizeof(client_addr.sin_addr),
481 + if (tcsd_options.port != 0) { /* TCP socket */
482 + if ((client_hostent = gethostbyaddr((char *) &client_addr.in.sin_addr,
483 + sizeof(client_addr.in.sin_addr),
484 AF_INET)) == NULL) {
485 - char buf[16];
486 - uint32_t addr = htonl(client_addr.sin_addr.s_addr);
487 + char buf[16];
488 + uint32_t addr = htonl(client_addr.in.sin_addr.s_addr);
490 - snprintf(buf, 16, "%d.%d.%d.%d", (addr & 0xff000000) >> 24,
491 - (addr & 0x00ff0000) >> 16, (addr & 0x0000ff00) >> 8,
492 - addr & 0x000000ff);
493 + snprintf(buf, 16, "%d.%d.%d.%d", (addr & 0xff000000) >> 24,
494 + (addr & 0x00ff0000) >> 16, (addr & 0x0000ff00) >> 8,
495 + addr & 0x000000ff);
497 - LogWarn("Host name for connecting IP %s could not be resolved", buf);
498 - hostname = strdup(buf);
499 - } else {
500 - hostname = strdup(client_hostent->h_name);
501 + LogWarn("Host name for connecting IP %s could not be resolved", buf);
502 + hostname = strdup(buf);
503 + } else {
504 + hostname = strdup(client_hostent->h_name);
508 tcsd_thread_create(newsd, hostname);
509 Index: trousers-0.3.11.2/src/tspi/rpc/tcstp/rpc.c
510 ===================================================================
511 --- trousers-0.3.11.2/src/tspi/rpc/tcstp/rpc.c.orig
512 +++ trousers-0.3.11.2/src/tspi/rpc/tcstp/rpc.c
513 @@ -342,41 +342,68 @@ send_init(struct host_table_entry *hte)
514 BYTE *buffer;
515 TSS_RESULT result;
517 - struct sockaddr_in addr;
518 - struct hostent *hEnt = NULL;
519 + if (get_port() == 0) { /* use UNIX Domain socket */
520 + struct sockaddr_un addr;
522 - sd = socket(PF_INET, SOCK_STREAM, 0);
523 - if (sd == -1) {
524 - LogError("socket: %s", strerror(errno));
525 - result = TSPERR(TSS_E_COMM_FAILURE);
526 - goto err_exit;
529 - __tspi_memset(&addr, 0, sizeof(addr));
530 - addr.sin_family = AF_INET;
531 - addr.sin_port = htons(get_port());
533 - LogDebug("Sending TSP packet to host %s.", hte->hostname);
535 - /* try to resolve by hostname first */
536 - hEnt = gethostbyname((char *)hte->hostname);
537 - if (hEnt == NULL) {
538 - /* if by hostname fails, try by dot notation */
539 - if (inet_aton((char *)hte->hostname, &addr.sin_addr) == 0) {
540 - LogError("hostname %s does not resolve to a valid address.", hte->hostname);
541 - result = TSPERR(TSS_E_CONNECTION_FAILED);
542 + sd = socket(PF_UNIX, SOCK_STREAM, 0);
543 + if (sd == -1) {
544 + LogError("socket(PF_UNIX): %s", strerror(errno));
545 + result = TSPERR(TSS_E_COMM_FAILURE);
546 goto err_exit;
548 - } else {
549 - memcpy(&addr.sin_addr, hEnt->h_addr_list[0], 4);
552 - LogDebug("Connecting to %s", inet_ntoa(addr.sin_addr));
553 + __tspi_memset(&addr, 0, sizeof(addr));
554 + addr.sun_family = AF_UNIX;
555 + strncpy(addr.sun_path, TCSD_DEFAULT_SOCKET,
556 + sizeof(addr.sun_path));
558 + LogDebug("Connecting to UNIX Domain socket %s",
559 + TCSD_DEFAULT_SOCKET);
561 + if (connect(sd, (struct sockaddr *) &addr, sizeof (addr))) {
562 + LogError("connect: %s", strerror(errno));
563 + result = TSPERR(TSS_E_COMM_FAILURE);
564 + goto err_exit;
567 + } else { /* use TCP socket */
568 + struct sockaddr_in addr;
569 + struct hostent *hEnt = NULL;
571 + sd = socket(PF_INET, SOCK_STREAM, 0);
572 + if (sd == -1) {
573 + LogError("socket: %s", strerror(errno));
574 + result = TSPERR(TSS_E_COMM_FAILURE);
575 + goto err_exit;
578 + __tspi_memset(&addr, 0, sizeof(addr));
579 + addr.sin_family = AF_INET;
580 + addr.sin_port = htons(get_port());
582 + LogDebug("Sending TSP packet to host %s.", hte->hostname);
584 + /* try to resolve by hostname first */
585 + hEnt = gethostbyname((char *)hte->hostname);
586 + if (hEnt == NULL) {
587 + /* if by hostname fails, try by dot notation */
588 + if (inet_aton((char *)hte->hostname, &addr.sin_addr) == 0) {
589 + LogError("hostname %s does not resolve to a valid address.", hte->hostname);
590 + result = TSPERR(TSS_E_CONNECTION_FAILED);
591 + goto err_exit;
593 + } else {
594 + memcpy(&addr.sin_addr, hEnt->h_addr_list[0], 4);
597 + LogDebug("Connecting to %s", inet_ntoa(addr.sin_addr));
599 - if (connect(sd, (struct sockaddr *) &addr, sizeof (addr))) {
600 - LogError("connect: %s", strerror(errno));
601 - result = TSPERR(TSS_E_COMM_FAILURE);
602 - goto err_exit;
603 + if (connect(sd, (struct sockaddr *) &addr, sizeof (addr))) {
604 + LogError("connect: %s", strerror(errno));
605 + result = TSPERR(TSS_E_COMM_FAILURE);
606 + goto err_exit;
610 if (send_to_socket(sd, hte->comm.buf, hte->comm.hdr.packet_size) < 0) {