Print this page
9856 pkcs11_tpm.so.1 changes syslog facility

*** 287,296 **** --- 287,298 ---- * (C) COPYRIGHT International Business Machines Corp. 2001, 2002 */ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright 2018 Gary Mills */ #include <alloca.h> #include <libgen.h> #include <sys/varargs.h>
*** 299,325 **** extern API_Proc_Struct_t *Anchor; extern int logging; void logit(int, char *, ...); static int enabled = 0; void ! loginit() { if (!enabled) { enabled = 1; openlog("tpmtoken", LOG_PID | LOG_NDELAY, LOG_DAEMON); (void) setlogmask(LOG_UPTO(LOG_DEBUG)); logit(LOG_DEBUG, "Logging enabled %d enabled", enabled); } } void logterm() { closelog(); enabled = 0; } /*ARGSUSED*/ void logit(int type, char *fmt, ...) --- 301,334 ---- extern API_Proc_Struct_t *Anchor; extern int logging; void logit(int, char *, ...); + #ifdef DEBUG static int enabled = 0; + #endif /* DEBUG */ void ! loginit() ! { ! #ifdef DEBUG if (!enabled) { enabled = 1; openlog("tpmtoken", LOG_PID | LOG_NDELAY, LOG_DAEMON); (void) setlogmask(LOG_UPTO(LOG_DEBUG)); logit(LOG_DEBUG, "Logging enabled %d enabled", enabled); } + #endif /* DEBUG */ } void logterm() { + #ifdef DEBUG closelog(); enabled = 0; + #endif /* DEBUG */ } /*ARGSUSED*/ void logit(int type, char *fmt, ...)
*** 341,352 **** #endif /* DEBUG */ } void ! AddToSessionList(pSess) ! Session_Struct_t *pSess; { Session_Struct_t *pCur; (void) pthread_mutex_lock(&(Anchor->SessListMutex)); --- 350,360 ---- #endif /* DEBUG */ } void ! AddToSessionList(Session_Struct_t *pSess) { Session_Struct_t *pCur; (void) pthread_mutex_lock(&(Anchor->SessListMutex));
*** 368,379 **** (void) pthread_mutex_unlock(&(Anchor->SessListMutex)); } void ! RemoveFromSessionList(pSess) ! Session_Struct_t *pSess; { Session_Struct_t *pCur, *pTmp; (void) pthread_mutex_lock(&(Anchor->SessListMutex)); --- 376,386 ---- (void) pthread_mutex_unlock(&(Anchor->SessListMutex)); } void ! RemoveFromSessionList(Session_Struct_t *pSess) { Session_Struct_t *pCur, *pTmp; (void) pthread_mutex_lock(&(Anchor->SessListMutex));