cluster/cman/lib libcman.c libcman.h
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: pcaulfield at sourceware.org 2006-07-11 08:13:18
Modified files:
cman/lib : libcman.c libcman.h
Log message:
Don't copy the agent name if it's NULL. Make the requred size of the agent string clear.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/lib/libcman.c.diff?cvsroot=cluster&r1=1.24&r2=1.25
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/lib/libcman.h.diff?cvsroot=cluster&r1=1.25&r2=1.26
cman/lib/libcman.c +2 -1
@@ -943,7 +943,8 @@ ret =info_call (h,CMAN_CMD_GET_FENCE_INFO , &nodeid,sizeof (int ), &f,sizeof (f));if (!ret) { *time = f.fence_time; -strcpy (agent, f.fence_agent); +if (agent) +strcpy (agent, f.fence_agent); *fenced = ((f.flags &FENCE_FLAGS_FENCED ) !=0 ); }return ret;
cman/lib/libcman.h +5 -3
@@ -30,9 +30,10 @@/* * Some maxima */ -#define CMAN_MAX_ADDR_LEN sizeof(struct sockaddr_in6) -#define CMAN_MAX_NODENAME_LEN 255 -#define MAX_CLUSTER_NAME_LEN 16 +#define CMAN_MAX_ADDR_LEN sizeof(struct sockaddr_in6) +#define CMAN_MAX_NODENAME_LEN 255 +#define MAX_CLUSTER_NAME_LEN 16 +#define CMAN_MAX_FENCE_AGENT_NAME_LEN 255/* * Pass this into cman_get_node() as the nodeid to get local node information
@@ -286,6 +287,7 @@/* Get fence information for a node. * 'int *fenced' is only valid if the node is down, it is set to * 1 if the node has been fenced since it left the cluster. +* agent should be CMAN_MAX_FENCE_AGENT_NAME_LEN */ int cman_get_fenceinfo (cman_handle_t handle,int nodeid,uint64_t *fence_time,int *fenced,char *agent);
Quoted 10 lines · pcaulfield at sourceware.org
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: pcaulfield at sourceware.org 2006-07-11 08:13:18Modified files:
cman/lib :libcman.clibcman.hLog message:
Don't copy the agent name if it's NULL. Make the requred size of the agent string clear.
Nice, thanks!
-- Lon