src/communication/security-server-comm.c
/* Authenticate client application *
 * Currently it only gets peer's credential information only *
 * If we need, we can extend in the futer */
Authenticate client application
Currently it only gets peer's credential information only
If we need, we can extend in the futer
Authenticate client application Currently it only gets peer ' s credential information only If we need we can extend in the futer
int authenticate_client_application(int sockfd, int *pid, int *uid)
{
	int retval = 0;
	struct ucred cr;
	unsigned int cl = sizeof(cr);
	if(getsockopt(sockfd, SOL_SOCKET, SO_PEERCRED, &cr, &cl) != 0)
	{
		retval = SECURITY_SERVER_ERROR_SOCKET;
		SEC_SVR_DBG("%s", "getsockopt failed");
		*pid = 0;
		goto error;
	}
	*pid = cr.pid;
	*uid = cr.uid;
error:
	return retval;
}
int authenticate_client_application ( int sockfd , int * pid , int * uid ) { int retval = 0 ; struct ucred cr ; unsigned int cl = sizeof ( cr ) ; if ( getsockopt ( sockfd , SOL_SOCKET , SO_PEERCRED , & cr , & cl ) != 0 ) { retval = SECURITY_SERVER_ERROR_SOCKET ; SEC_SVR_DBG ( " " , " " ) ; * pid = 0 ; goto error ; } * pid = cr . pid ; * uid = cr . uid ; error : return retval ; }
Authenticate client application
 Currently it only gets peer's credential information only
 If we need, we can extend in the futer
Authenticate client application Currently it only gets peer ' s credential information only If we need we can extend in the futer
/* get PID of socket peer */ /* Authenticate client that it's real client application */ /* TBA */