more warning-removal patches
These changes remove the last of the -Wformat-security warnings:
* daemons/clvmd/clvmd-command.c (do_command): Avoid using a non-literal snprintf format string. Use "%s".
* daemons/clvmd/clvmd.c (send_message): Likewise, but for log_error.
* daemons/clvmd/clvmd-cman.c (_cluster_send_message): Likewise.
Index: daemons/clvmd/clvmd-command.c
===================================================================
RCS file: /cvs/lvm2/LVM2/daemons/clvmd/clvmd-command.c,v retrieving revision 1.14
clvmd/clvmd-command.c +2 -2
@@ -118,7 +118,7 @@ int do_command(struct local_client *clie/* Replace EIO with something less scary */ if (status ==EIO ) { *retlen = -1 +snprintf (*buf, buflen, +1 +snprintf (*buf, buflen,"%s" ,get_last_lvm_error ());return EIO ; }
@@ -141,7 +141,7 @@ int do_command(struct local_client *clie/* Check the status of the command and return the error text */ if (status) { - *retlen =1 +snprintf (*buf, buflen,strerror (status)); + *retlen =1 +snprintf (*buf, buflen,"%s" ,strerror (status)); }return status;
Index: daemons/clvmd/clvmd.c
===================================================================
RCS file: /cvs/lvm2/LVM2/daemons/clvmd/clvmd.c,v
retrieving revision 1.34
clvmd/clvmd.c +2 -2
@@ -1701,7 +1701,7 @@ static int send_message(void *buf, int mif (retry_cnt >MAX_RETRIES ) { errno = saved_errno; -log_error (errtext); +log_error ("%s" , errtext); errno = saved_errno;break ; }
@@ -1725,7 +1725,7 @@ static int send_message(void *buf, int mcontinue ; } -log_error (errtext); +log_error ("%s" , errtext);break ; } ptr += len;
Index: daemons/clvmd/clvmd-cman.c
===================================================================
RCS file: /cvs/lvm2/LVM2/daemons/clvmd/clvmd-cman.c,v retrieving revision 1.17
clvmd/clvmd-cman.c +1 -1
@@ -137,7 +137,7 @@ static int _cluster_send_message(void *bif (cman_send_data (c_handle, buf, msglen,0 ,CLUSTER_PORT_CLVMD , nodeid) <=0 ) { -log_error (errtext); +log_error ("%s" , errtext); }return msglen; }