From 7f24c23651750f0188957b8d81ca0fd85bb9a2d6 Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Mon, 28 Jun 2004 22:04:20 +0000 Subject: [PATCH] Fix cluster membership API not being authenticated bug. (Logical change 1.15) git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@31 fd59a12c-fef9-0310-b244-a6a79926bd2f --- exec/clm.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/exec/clm.c b/exec/clm.c index 5ff6f965..7d68e171 100644 --- a/exec/clm.c +++ b/exec/clm.c @@ -391,10 +391,26 @@ static int message_handler_req_exec_clm_nodejoin (int fd, void *message) static int message_handler_req_clm_init (int fd, void *message) { - log_printf (LOG_LEVEL_DEBUG, "Got request to initalize cluster membership service.\n"); - connections[fd].service = SOCKET_SERVICE_CLM; + SaErrorT error = SA_ERR_SECURITY; + struct res_lib_init res_lib_init; - return (0); + log_printf (LOG_LEVEL_DEBUG, "Got request to initalize cluster membership service.\n"); + if (connections[fd].authenticated) { + connections[fd].service = SOCKET_SERVICE_CLM; + error = SA_OK; + } + + res_lib_init.header.magic = MESSAGE_MAGIC; + res_lib_init.header.size = sizeof (struct res_lib_init); + res_lib_init.header.id = MESSAGE_RES_INIT; + res_lib_init.error = error; + + libais_send_response (fd, &res_lib_init, sizeof (res_lib_init)); + + if (connections[fd].authenticated) { + return (0); + } + return (-1); } int message_handler_req_clm_trackstart (int fd, void *message)