if (sys_from != NULL) {
if (safe_str_neq("hello", op)) {  if(sys_from == NULL) { return FALSE; }
crmd_authorize_message(xmlNodePtr root_xml_node,		       IPC_Message *client_msg,		       crmd_client_t *curr_client){	// check the best case first	const char *sys_from   = xmlGetProp(root_xml_node,					    XML_ATTR_SYSFROM);	char *uuid = NULL;	char *client_name = NULL;	char *major_version = NULL;	char *minor_version = NULL;	const char *filtered_from;	gpointer table_key = NULL;	gboolean result;		FNIN();	if (sys_from != NULL) {		gboolean can_reply = FALSE; // no-one has registered with this id		filtered_from = sys_from;		/* The CIB can have two names on the DC */		if(strcmp(sys_from, CRM_SYSTEM_DCIB) == 0)			filtered_from = CRM_SYSTEM_CIB;				if (g_hash_table_lookup (ipc_clients, filtered_from) != NULL)			can_reply = TRUE;  // reply can be routed						CRM_DEBUG("Message reply can%s be routed from %s.",			   can_reply?"":" not", sys_from);		FNRET(can_reply);	}	// otherwise, check if it was a hello message	cl_log(LOG_INFO,	       "received client join msg: %s",	       (char*)client_msg->msg_body);	result = process_hello_message(client_msg,				       &uuid,				       &client_name,				       &major_version,				       &minor_version);	if (result == TRUE) {		// check version		int mav = atoi(major_version);		int miv = atoi(minor_version);		if (mav < 0 || miv < 0) {			cl_log(LOG_ERR,			       "Client version (%d:%d) is not acceptable",			       mav,			       miv);			result = FALSE;		}		cl_free(major_version);		cl_free(minor_version);	}	struct crm_subsystem_s *the_subsystem = NULL;	if (result == TRUE) {		/* if we already have one of those clients		 * only applies to te, pe etc.  not admin clients		 */				if (client_name == NULL)			CRM_DEBUG("Client had not registered with us yet");		else if (strcmp(CRM_SYSTEM_PENGINE, client_name) == 0) 			the_subsystem = pe_subsystem;		else if (strcmp(CRM_SYSTEM_TENGINE, client_name) == 0)			the_subsystem = te_subsystem;		else if (strcmp(CRM_SYSTEM_CIB, client_name) == 0)			the_subsystem = cib_subsystem;		if (the_subsystem != NULL) {			// do we already have one?			result =(fsa_input_register & the_subsystem->flag)==0;			if(result) {				the_subsystem->ipc =					curr_client->client_channel;			} // else we didnt ask for the client to start		} else if(client_name != NULL && uuid != NULL) {			table_key = (gpointer)				generate_hash_key(client_name, uuid);		} else {			result = FALSE;			cl_log(LOG_ERR,			       "Bad client details (client_name=%s, uuid=%s)",			       client_name, uuid);		}	}		if(result == TRUE && table_key == NULL)		table_key = (gpointer)cl_strdup(client_name);	if (result == TRUE) {		cl_log(LOG_INFO, "Accepted client %s", (char*)table_key);		curr_client->table_key = table_key;		curr_client->sub_sys = cl_strdup(client_name);		curr_client->uuid = cl_strdup(uuid);			g_hash_table_insert (ipc_clients,				     table_key,				     curr_client->client_channel);		send_hello_message(curr_client->client_channel,				   "n/a", CRM_SYSTEM_CRMD,				   "0", "1");		cl_log(LOG_INFO, "Updated client list with %s",		       (char*)table_key);				if(the_subsystem != NULL) {			set_bit_inplace(&fsa_input_register,					the_subsystem->flag);		}				s_crmd_fsa(C_SUBSYSTEM_CONNECT, I_NULL, NULL);	} else {		cl_log(LOG_ERR, "Rejected client logon request");		curr_client->client_channel->ch_status = IPC_DISC_PENDING;	}		if(uuid != NULL) cl_free(uuid);	if(client_name != NULL) cl_free(client_name);	/* hello messages should never be processed further */	FNRET(FALSE);}