src/communication/security-server-comm.c
/* Checking client is pre-defined middleware daemons *
 * Check privilege API is only allowed to middleware daemons *
 * cmd line list of middleware daemons are listed in
 * /usr/share/security-server/mw-list */
Checking client is pre-defined middleware daemons
Check privilege API is only allowed to middleware daemons
cmd line list of middleware daemons are listed in
/usr/share/security-server/mw-list
Checking client is pre - defined middleware daemons Check privilege API is only allowed to middleware daemons cmd line list of middleware daemons are listed in / usr / share / security - server / mw - list
int search_middleware_cmdline(char *cmdline)
{
	FILE *fp = NULL;
	int ret;
	char middleware[SECURITY_SERVER_MAX_PATH_LEN];
	fp = fopen(SECURITY_SERVER_MIDDLEWARE_LIST_PATH, "r");
	if(fp == NULL)
	{
		SEC_SVR_DBG("%s", "Error oening mw-list file");
		return SECURITY_SERVER_ERROR_FILE_OPERATION;
	}
	ret = SECURITY_SERVER_ERROR_AUTHENTICATION_FAILED;
	while(fgets(middleware, SECURITY_SERVER_MAX_PATH_LEN, fp) != NULL)
	{
		if(strncmp(middleware, cmdline, strlen(middleware)-1) == 0)
		{
			SEC_SVR_DBG("%s", "found matching cmd line");
			ret = SECURITY_SERVER_SUCCESS;
			break;
		}
	}
	if(fp != NULL)
		fclose(fp);
	return ret;
}
int search_middleware_cmdline ( char * cmdline ) { FILE * fp = NULL ; int ret ; char middleware [ SECURITY_SERVER_MAX_PATH_LEN ] ; fp = fopen ( SECURITY_SERVER_MIDDLEWARE_LIST_PATH , " " ) ; if ( fp == NULL ) { SEC_SVR_DBG ( " " , " " ) ; return SECURITY_SERVER_ERROR_FILE_OPERATION ; } ret = SECURITY_SERVER_ERROR_AUTHENTICATION_FAILED ; while ( fgets ( middleware , SECURITY_SERVER_MAX_PATH_LEN , fp ) != NULL ) { if ( strncmp ( middleware , cmdline , strlen ( middleware ) - 1 ) == 0 ) { SEC_SVR_DBG ( " " , " " ) ; ret = SECURITY_SERVER_SUCCESS ; break ; } } if ( fp != NULL ) fclose ( fp ) ; return ret ; }
Checking client is pre-defined middleware daemons
 Check privilege API is only allowed to middleware daemons
 cmd line list of middleware daemons are listed in
 /usr/share/security-server/mw-list
Checking client is pre - defined middleware daemons Check privilege API is only allowed to middleware daemons cmd line list of middleware daemons are listed in / usr / share / security - server / mw - list
/* Open the list file */ /* error on file */ /* Search each line */ /* found */