Bug 339641. Fix for ZEN that was hanging logins on Terminal Server.
This commit is contained in:
		| @@ -63,6 +63,44 @@ static SS_UTF8_T SSCS_RESERVED2_KEY_CHAIN_ID[] = "SSCS_RESERVED2_KEYCHAIN2_ID"; | |||||||
| #define SSCS_CRED_MP_F			2 | #define SSCS_CRED_MP_F			2 | ||||||
|  |  | ||||||
| #define NSSCS_MAX_ID_LEN	 	256 | #define NSSCS_MAX_ID_LEN	 	256 | ||||||
|  | #define DebugLevel	0 | ||||||
|  |  | ||||||
|  | static SS_UTF8_T g_pDebugLogFilePath[] = {"\\micasa_lib.log"}; | ||||||
|  |  | ||||||
|  | #ifdef DEBUG | ||||||
|  | #define DbgTrace(LEVEL, X, Y) {                                  \ | ||||||
|  | char formatBuff[256];                                            \ | ||||||
|  | char printBuff[384];                                             \ | ||||||
|  | FILE  *pDebugFile;                                               \ | ||||||
|  |   if (LEVEL == 0 || DebugLevel >= LEVEL)                        \ | ||||||
|  |   {                                                             \ | ||||||
|  |      SYSTEMTIME sysTime;                                        \ | ||||||
|  |      GetLocalTime(&sysTime);                                    \ | ||||||
|  |      _snprintf(formatBuff, sizeof(formatBuff), "[%X-%X] [%02d:%02d:%02d] CASA_library ", GetCurrentProcessId(), GetCurrentThreadId(), sysTime.wHour, sysTime.wMinute, sysTime.wSecond); \ | ||||||
|  |      strncat(formatBuff, X, sizeof(formatBuff) - strlen(formatBuff) - 1); \ | ||||||
|  |      _snprintf(printBuff, sizeof(printBuff), formatBuff, Y);    \ | ||||||
|  |      if (g_pDebugLogFilePath)                                   \ | ||||||
|  |      {                                                          \ | ||||||
|  |         pDebugFile = fopen(g_pDebugLogFilePath, "a+");          \ | ||||||
|  |         if (pDebugFile)                                         \ | ||||||
|  |         {                                                       \ | ||||||
|  |            fwrite(printBuff, strlen(printBuff), 1, pDebugFile); \ | ||||||
|  |            fflush(pDebugFile);                                  \ | ||||||
|  |            fclose(pDebugFile);                                  \ | ||||||
|  |         }                                                       \ | ||||||
|  |      }                                                          \ | ||||||
|  |      else                                                       \ | ||||||
|  |         OutputDebugString(printBuff);                           \ | ||||||
|  |   }                                                             \ | ||||||
|  | } | ||||||
|  |  | ||||||
|  | #else | ||||||
|  | #define DbgTrace(LEVEL, X, Y) {} | ||||||
|  | #endif | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| typedef struct _sscs_linux_ss_handle | typedef struct _sscs_linux_ss_handle | ||||||
| { | { | ||||||
|   | |||||||
| @@ -91,6 +91,8 @@ void * ipc_win_create() | |||||||
| 	int rcode; | 	int rcode; | ||||||
| 	DWORD mode = PIPE_READMODE_MESSAGE; | 	DWORD mode = PIPE_READMODE_MESSAGE; | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "  -ipc_win_create- start\n", 0); | ||||||
|  |  | ||||||
| 	hPipe = CreateFile( | 	hPipe = CreateFile( | ||||||
| 		XTIER_RPC_PIPE,  | 		XTIER_RPC_PIPE,  | ||||||
| 		GENERIC_READ | GENERIC_WRITE,  | 		GENERIC_READ | GENERIC_WRITE,  | ||||||
| @@ -103,9 +105,12 @@ void * ipc_win_create() | |||||||
| 	if (hPipe == INVALID_HANDLE_VALUE) | 	if (hPipe == INVALID_HANDLE_VALUE) | ||||||
| 	{ | 	{ | ||||||
| 		rcode = GetLastError();	 | 		rcode = GetLastError();	 | ||||||
| 		return 0; | 		DbgTrace(0, " Create Pipe error:%d\r\n", rcode); | ||||||
|  | 		return -1; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "  -ipc_win_create- end\n", 0); | ||||||
|  |  | ||||||
| 	return hPipe;	 | 	return hPipe;	 | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -183,19 +188,12 @@ int ipc_unx_write(int fd, Byte *pData, int bytes) | |||||||
|  |  | ||||||
| int ipc_win_write(HANDLE hPipe, LPCVOID lpBuffer, DWORD bytesToWrite) | int ipc_win_write(HANDLE hPipe, LPCVOID lpBuffer, DWORD bytesToWrite) | ||||||
| { | { | ||||||
| //#ifdef SSCS_WIN32_PLAT_F |  | ||||||
| 	BOOL rcode; | 	BOOL rcode; | ||||||
| 	int icode; | 	int icode; | ||||||
| 	DWORD lpBytesWritten = 0; | 	DWORD lpBytesWritten = 0; | ||||||
| 	//LPCVOID msgLen = malloc(4); |  | ||||||
|  |  | ||||||
| 	 |  | ||||||
| 	 |  | ||||||
| //	rcode = WaitNamedPipe( |  | ||||||
| //			XTIER_RPC_PIPE, |  | ||||||
| //			NMPWAIT_WAIT_FOREVER); |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "  -ipc_win_write- start\n", 0); | ||||||
|  |  | ||||||
| 	// the server expects us to first write the number of bytes in the msg we're about to write. | 	// the server expects us to first write the number of bytes in the msg we're about to write. | ||||||
| 	rcode = WriteFile( | 	rcode = WriteFile( | ||||||
| @@ -208,14 +206,10 @@ int ipc_win_write(HANDLE hPipe, LPCVOID lpBuffer, DWORD bytesToWrite) | |||||||
| 	if (!rcode) | 	if (!rcode) | ||||||
| 	{ | 	{ | ||||||
| 		icode = GetLastError(); | 		icode = GetLastError(); | ||||||
| 		return 0; | 		DbgTrace(0, " Pipe Write Error:%d\r\n", icode); | ||||||
|  | 		return -1; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  |  | ||||||
| //	rcode = WaitNamedPipe( |  | ||||||
| //			XTIER_RPC_PIPE, |  | ||||||
| //			NMPWAIT_WAIT_FOREVER); |  | ||||||
|  |  | ||||||
| 	rcode = WriteFile( | 	rcode = WriteFile( | ||||||
| 				hPipe, | 				hPipe, | ||||||
| 				lpBuffer,			//LPCVOID lpBuffer, | 				lpBuffer,			//LPCVOID lpBuffer, | ||||||
| @@ -226,10 +220,12 @@ int ipc_win_write(HANDLE hPipe, LPCVOID lpBuffer, DWORD bytesToWrite) | |||||||
| 	if (!rcode) | 	if (!rcode) | ||||||
| 	{ | 	{ | ||||||
| 		icode = GetLastError(); | 		icode = GetLastError(); | ||||||
|  | 		DbgTrace(0, " Pipe Write Error:%d\r\n", icode); | ||||||
|  | 		return -1; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	firstReadAfterWrite = 1; | 	firstReadAfterWrite = 1; | ||||||
|  | 	DbgTrace(1, "  -ipc_win_write- end\n", 0); | ||||||
| 	return lpBytesWritten; | 	return lpBytesWritten; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -320,6 +316,7 @@ int ipc_win_read(HANDLE hPipe, LPVOID lpBuffer, DWORD numOfBytesToRead) | |||||||
| 	LPVOID pMsgLen = malloc(4); | 	LPVOID pMsgLen = malloc(4); | ||||||
| 	int icode; | 	int icode; | ||||||
| 	 | 	 | ||||||
|  | 	DbgTrace(1, "  -ipc_win_read- start\n", 0); | ||||||
| 	if (firstReadAfterWrite) | 	if (firstReadAfterWrite) | ||||||
| 	{ | 	{ | ||||||
| 		firstReadAfterWrite = 0; | 		firstReadAfterWrite = 0; | ||||||
| @@ -335,7 +332,8 @@ int ipc_win_read(HANDLE hPipe, LPVOID lpBuffer, DWORD numOfBytesToRead) | |||||||
| 		if (!rcode) | 		if (!rcode) | ||||||
| 		{ | 		{ | ||||||
| 			icode = GetLastError(); | 			icode = GetLastError(); | ||||||
| 			return 0; | 			DbgTrace(0, " Pipe Read error: %d\r\n", icode); | ||||||
|  | 			return -1; | ||||||
| 		} | 		} | ||||||
| 		 | 		 | ||||||
| 	} | 	} | ||||||
| @@ -347,10 +345,17 @@ int ipc_win_read(HANDLE hPipe, LPVOID lpBuffer, DWORD numOfBytesToRead) | |||||||
| 				&numBytesRead,			//LPDWORD lpNumberOfBytesRead, | 				&numBytesRead,			//LPDWORD lpNumberOfBytesRead, | ||||||
| 				NULL);					//LPOVERLAPPED lpOverlapped | 				NULL);					//LPOVERLAPPED lpOverlapped | ||||||
|  |  | ||||||
|  | 	if (!rcode) | ||||||
|  | 	{ | ||||||
|  | 		icode = GetLastError(); | ||||||
|  | 		DbgTrace(0, " Pipe Read error: %d\r\n", icode); | ||||||
|  | 		return -1; | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	if (pMsgLen) | 	if (pMsgLen) | ||||||
| 		free(pMsgLen); | 		free(pMsgLen); | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "  -ipc_win_read- end\n", 0); | ||||||
| 	return numBytesRead; | 	return numBytesRead; | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
| @@ -368,13 +373,13 @@ int ipc_unx_close(int fd) | |||||||
| int ipc_win_close(HANDLE hPipe) | int ipc_win_close(HANDLE hPipe) | ||||||
| { | { | ||||||
| //#ifdef SSCS_WIN32_PLAT_F | //#ifdef SSCS_WIN32_PLAT_F | ||||||
|  |  | ||||||
|  |  | ||||||
| 	BOOL rcode; | 	BOOL rcode; | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "  -ipc_win_close- start\n", 0); | ||||||
| 	rcode = DisconnectNamedPipe(hPipe);  | 	rcode = DisconnectNamedPipe(hPipe);  | ||||||
| 	rcode = CloseHandle(hPipe); | 	rcode = CloseHandle(hPipe); | ||||||
|  | 	DbgTrace(1, "  -ipc_win_close- end\n", 0); | ||||||
| 	return 0;	 | 	return 0;	 | ||||||
| 	 |  | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -230,6 +230,9 @@ int32_t ipc_OpenSecretStore | |||||||
| 	Byte *gpReqBuf = NULL; | 	Byte *gpReqBuf = NULL; | ||||||
| 	Byte *gpReplyBuf = NULL; | 	Byte *gpReplyBuf = NULL; | ||||||
| 	Byte *pReq = NULL, *pReply = NULL; | 	Byte *pReq = NULL, *pReply = NULL; | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "-ipc_OpenSecretStore- start\n", 0); | ||||||
|  |  | ||||||
| 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | ||||||
| 	{ | 	{ | ||||||
| 		return(NSSCS_E_SYSTEM_FAILURE);		 | 		return(NSSCS_E_SYSTEM_FAILURE);		 | ||||||
| @@ -353,6 +356,7 @@ int32_t ipc_OpenSecretStore | |||||||
| 		free(gpReplyBuf); | 		free(gpReplyBuf); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "-ipc_OpenSecretStore- end \n", 0); | ||||||
| 	return retCode; // map the return code from sockReturn | 	return retCode; // map the return code from sockReturn | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -382,6 +386,8 @@ int32_t ipc_CloseSecretStore | |||||||
| 	Byte *gpReplyBuf = NULL; | 	Byte *gpReplyBuf = NULL; | ||||||
| 	Byte *pReq = NULL, *pReply = NULL; | 	Byte *pReq = NULL, *pReply = NULL; | ||||||
|  |  | ||||||
|  | DbgTrace(1, "-ipc_CloseSecretStore- start \n", 0); | ||||||
|  |  | ||||||
| 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | ||||||
| 	{ | 	{ | ||||||
| 		return(NSSCS_E_SYSTEM_FAILURE);		 | 		return(NSSCS_E_SYSTEM_FAILURE);		 | ||||||
| @@ -453,7 +459,7 @@ int32_t ipc_CloseSecretStore | |||||||
|   } |   } | ||||||
|   while(0); |   while(0); | ||||||
|  |  | ||||||
|   DMSG(("Closing socket : %d\n",*(int*)ssHandle->platHandle)); |   //DMSG(("Closing socket : %d\n",*(int*)ssHandle->platHandle)); | ||||||
|   IPC_CLOSE(ssHandle->platHandle); |   IPC_CLOSE(ssHandle->platHandle); | ||||||
|    |    | ||||||
| 	if(gpReqBuf) | 	if(gpReqBuf) | ||||||
| @@ -468,6 +474,7 @@ int32_t ipc_CloseSecretStore | |||||||
| 		free(gpReplyBuf); | 		free(gpReplyBuf); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "-ipc_CloseSecretStore- end \r\n\r\n", 0); | ||||||
|   return retCode; // map return code |   return retCode; // map return code | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -1372,6 +1379,8 @@ int32_t ipc_ReadSecret | |||||||
| 	Byte *gpReplyBuf = NULL; | 	Byte *gpReplyBuf = NULL; | ||||||
| 	Byte *pReq = NULL, *pReply = NULL; | 	Byte *pReq = NULL, *pReply = NULL; | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "-ipc_ReadSecret- start %s\n", secretID->id); | ||||||
|  |  | ||||||
| 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | ||||||
| 	{ | 	{ | ||||||
| 		return(NSSCS_E_SYSTEM_FAILURE);		 | 		return(NSSCS_E_SYSTEM_FAILURE);		 | ||||||
| @@ -1601,6 +1610,8 @@ int32_t ipc_ReadSecret | |||||||
| 		free(gpReplyBuf); | 		free(gpReplyBuf); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   DbgTrace(1, "-ipc_ReadSecret- end \n", 0); | ||||||
|  |  | ||||||
|   return retCode; |   return retCode; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -1879,7 +1890,7 @@ int32_t ipc_RemoveSecret | |||||||
| 	Byte *gpReqBuf = NULL; | 	Byte *gpReqBuf = NULL; | ||||||
| 	Byte *gpReplyBuf = NULL; | 	Byte *gpReplyBuf = NULL; | ||||||
| 	Byte *pReq = NULL, *pReply = NULL; | 	Byte *pReq = NULL, *pReply = NULL; | ||||||
|  | 	DbgTrace(1, "-ipc_RemoveSecret- start %s\n", secretID->id); | ||||||
| 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | ||||||
| 	{ | 	{ | ||||||
| 		return(NSSCS_E_SYSTEM_FAILURE);		 | 		return(NSSCS_E_SYSTEM_FAILURE);		 | ||||||
| @@ -2046,7 +2057,7 @@ int32_t ipc_RemoveSecret | |||||||
| 		memset(gpReplyBuf, 0, MIN_REPLY_BUF_LEN); | 		memset(gpReplyBuf, 0, MIN_REPLY_BUF_LEN); | ||||||
| 		free(gpReplyBuf); | 		free(gpReplyBuf); | ||||||
|   } |   } | ||||||
|  | DbgTrace(1, "-ipc_RemoveSecret- end \n", 0); | ||||||
|   return retCode; |   return retCode; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -2077,6 +2088,7 @@ int32_t  ipc_GetSecretStoreInfo | |||||||
| 	Byte *gpReplyBuf = NULL; | 	Byte *gpReplyBuf = NULL; | ||||||
| 	Byte *pReq = NULL, *pReply = NULL; | 	Byte *pReq = NULL, *pReply = NULL; | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "-ipc_GetSecretStoreInfo- start \n", 0); | ||||||
| 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | ||||||
| 	{ | 	{ | ||||||
| 		return(NSSCS_E_SYSTEM_FAILURE);		 | 		return(NSSCS_E_SYSTEM_FAILURE);		 | ||||||
| @@ -2170,6 +2182,7 @@ int32_t  ipc_GetSecretStoreInfo | |||||||
| 		free(gpReplyBuf); | 		free(gpReplyBuf); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "-ipc_GetSecretStoreInfo- end \n", 0); | ||||||
|   return retCode; // map return code |   return retCode; // map return code | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -2201,6 +2214,8 @@ int32_t  ipc_GetKeychainInfo | |||||||
| 	Byte *gpReplyBuf = NULL; | 	Byte *gpReplyBuf = NULL; | ||||||
| 	Byte *pReq = NULL, *pReply = NULL; | 	Byte *pReq = NULL, *pReply = NULL; | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "-ipc_GetKeychainInfo- start \n", 0); | ||||||
|  |  | ||||||
| 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | ||||||
| 	{ | 	{ | ||||||
| 		return(NSSCS_E_SYSTEM_FAILURE);		 | 		return(NSSCS_E_SYSTEM_FAILURE);		 | ||||||
| @@ -2301,6 +2316,7 @@ int32_t  ipc_GetKeychainInfo | |||||||
| 		free(gpReplyBuf); | 		free(gpReplyBuf); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   DbgTrace(1, "-ipc_GetKeychainInfo- start \n", 0); | ||||||
|   return retCode;  |   return retCode;  | ||||||
|  |  | ||||||
| } | } | ||||||
| @@ -2693,6 +2709,8 @@ int32_t ipc_RemoveKey | |||||||
| 	Byte *gpReplyBuf = NULL; | 	Byte *gpReplyBuf = NULL; | ||||||
| 	Byte *pReq = NULL, *pReply = NULL; | 	Byte *pReq = NULL, *pReply = NULL; | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "-ipc_RemoveKey- start \n", 0); | ||||||
|  |  | ||||||
| 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | ||||||
| 	{ | 	{ | ||||||
| 		return(NSSCS_E_SYSTEM_FAILURE);		 | 		return(NSSCS_E_SYSTEM_FAILURE);		 | ||||||
| @@ -2871,6 +2889,8 @@ int32_t ipc_RemoveKey | |||||||
| 		free(gpReplyBuf); | 		free(gpReplyBuf); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "-ipc_RemoveKey- end \n", 0); | ||||||
|  |  | ||||||
|   return retCode; |   return retCode; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -2915,7 +2935,7 @@ int32_t ipc_ReadKey | |||||||
| 	Byte *gpReqBuf = NULL; | 	Byte *gpReqBuf = NULL; | ||||||
| 	Byte *gpReplyBuf = NULL; | 	Byte *gpReplyBuf = NULL; | ||||||
| 	Byte *pReq = NULL, *pReply = NULL; | 	Byte *pReq = NULL, *pReply = NULL; | ||||||
|  | 	DbgTrace(1, "-ipc_ReadKey- start %s\n",key); | ||||||
| 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | ||||||
| 	{ | 	{ | ||||||
| 		return(NSSCS_E_SYSTEM_FAILURE);		 | 		return(NSSCS_E_SYSTEM_FAILURE);		 | ||||||
| @@ -3149,7 +3169,7 @@ int32_t ipc_ReadKey | |||||||
| 		memset(gpReplyBuf, 0, MIN_REPLY_BUF_LEN); | 		memset(gpReplyBuf, 0, MIN_REPLY_BUF_LEN); | ||||||
| 		free(gpReplyBuf); | 		free(gpReplyBuf); | ||||||
|   } |   } | ||||||
|    |   DbgTrace(1, "-ipc_ReadKey- end\n", 0); | ||||||
|   return retCode; |   return retCode; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -3194,6 +3214,9 @@ int32_t ipc_ReadBinaryKey | |||||||
| 	Byte *gpReplyBuf = NULL; | 	Byte *gpReplyBuf = NULL; | ||||||
| 	Byte *pReq = NULL, *pReply = NULL; | 	Byte *pReq = NULL, *pReply = NULL; | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "-ipc_ReadBinaryKey- start\n", 0); | ||||||
|  |  | ||||||
|  |  | ||||||
| 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | ||||||
| 	{ | 	{ | ||||||
| 		return(NSSCS_E_SYSTEM_FAILURE);		 | 		return(NSSCS_E_SYSTEM_FAILURE);		 | ||||||
| @@ -3422,6 +3445,7 @@ int32_t ipc_ReadBinaryKey | |||||||
| 		free(gpReplyBuf); | 		free(gpReplyBuf); | ||||||
|   } |   } | ||||||
|    |    | ||||||
|  | 	DbgTrace(1, "-ipc_ReadBinaryKey- end\n", 0); | ||||||
|   return retCode; |   return retCode; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -3469,6 +3493,7 @@ int ipc_WriteKey | |||||||
| 	Byte *gpReplyBuf = NULL; | 	Byte *gpReplyBuf = NULL; | ||||||
| 	Byte *pReq = NULL, *pReply = NULL; | 	Byte *pReq = NULL, *pReply = NULL; | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "-ipc_WriteKey- start %s\n", key); | ||||||
| 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | ||||||
| 	{ | 	{ | ||||||
| 		return(NSSCS_E_SYSTEM_FAILURE);		 | 		return(NSSCS_E_SYSTEM_FAILURE);		 | ||||||
| @@ -3678,7 +3703,7 @@ int ipc_WriteKey | |||||||
| 		memset(gpReplyBuf, 0, MIN_REPLY_BUF_LEN); | 		memset(gpReplyBuf, 0, MIN_REPLY_BUF_LEN); | ||||||
| 		free(gpReplyBuf); | 		free(gpReplyBuf); | ||||||
|   } |   } | ||||||
|    |   DbgTrace(1, "-ipc_WriteKey- end\n", 0); | ||||||
|   return retCode; |   return retCode; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -3726,6 +3751,7 @@ int ipc_WriteBinaryKey | |||||||
| 	Byte *gpReplyBuf = NULL; | 	Byte *gpReplyBuf = NULL; | ||||||
| 	Byte *pReq = NULL, *pReply = NULL; | 	Byte *pReq = NULL, *pReply = NULL; | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "-ipc_WriteBinaryKey- start %s\n", key); | ||||||
| 	if (valLen > MAX_BINARY_KEY_LEN) | 	if (valLen > MAX_BINARY_KEY_LEN) | ||||||
| 	{ | 	{ | ||||||
| 		return(NSSCS_E_SYSTEM_FAILURE);		 | 		return(NSSCS_E_SYSTEM_FAILURE);		 | ||||||
| @@ -3913,7 +3939,7 @@ int ipc_WriteBinaryKey | |||||||
| 		memset(gpReplyBuf, 0, MIN_REPLY_BUF_LEN); | 		memset(gpReplyBuf, 0, MIN_REPLY_BUF_LEN); | ||||||
| 		free(gpReplyBuf); | 		free(gpReplyBuf); | ||||||
|   } |   } | ||||||
|  |   DbgTrace(1, "-ipc_WriteBinaryKey- end\n", 0); | ||||||
|   return retCode; |   return retCode; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -4269,6 +4295,8 @@ int32_t ipc_MergeCache(SSCS_SECRETSTORE_HANDLE_T *ssHandle, | |||||||
| 	Byte *gpReplyBuf = NULL; | 	Byte *gpReplyBuf = NULL; | ||||||
| 	Byte *pReq = NULL, *pReply = NULL; | 	Byte *pReq = NULL, *pReply = NULL; | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "-ipc_MergeCache- start\n", 0); | ||||||
|  |  | ||||||
| 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | 	if((gpReqBuf = malloc(MIN_REQUEST_BUF_LEN)) == NULL) | ||||||
| 	{ | 	{ | ||||||
| 		return(NSSCS_E_SYSTEM_FAILURE);		 | 		return(NSSCS_E_SYSTEM_FAILURE);		 | ||||||
| @@ -4418,6 +4446,8 @@ int32_t ipc_MergeCache(SSCS_SECRETSTORE_HANDLE_T *ssHandle, | |||||||
| 	free(gpReplyBuf); | 	free(gpReplyBuf); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | 	DbgTrace(1, "-ipc_MergeCache- end\n", 0); | ||||||
|  |    | ||||||
| 	return retCode; | 	return retCode; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -193,7 +193,16 @@ namespace sscs.common | |||||||
|                 } |                 } | ||||||
|  |  | ||||||
| 				mutex.WaitOne(); | 				mutex.WaitOne(); | ||||||
| 				sessionTable.Add(userId,user); |                  | ||||||
|  |                 try | ||||||
|  |                 { | ||||||
|  |                     sessionTable.Add(userId, user); | ||||||
|  |                 } | ||||||
|  |                 catch (Exception e) | ||||||
|  |                 { | ||||||
|  |                     CSSSLogger.DbgLog(e.ToString()); | ||||||
|  |                 } | ||||||
|  |  | ||||||
| 				mutex.ReleaseMutex(); | 				mutex.ReleaseMutex(); | ||||||
| 				ss = user.GetSecretStore(); | 				ss = user.GetSecretStore(); | ||||||
| 				ss.IncrRefCount(); | 				ss.IncrRefCount(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user