File 38.patch of Package cluster-glue.27808

From 3efce74cfa5a20cb204bad9ba56a278b3021b3e4 Mon Sep 17 00:00:00 2001
From: Lidong Zhong <lidong.zhong@suse.com>
Date: Thu, 22 Sep 2022 11:13:32 +0800
Subject: [PATCH] ibmhmc: get the correct hmc version

Currently the logic only get the first digit after 'V'/'R' in the
string. So "*RM V10R1.1020.0" will mistakenly recognized as version 1
instead of 10.

ref: bsc#1203635
---
 lib/plugins/stonith/ibmhmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/plugins/stonith/ibmhmc.c b/lib/plugins/stonith/ibmhmc.c
index c1b6f66d..85f91045 100644
--- a/lib/plugins/stonith/ibmhmc.c
+++ b/lib/plugins/stonith/ibmhmc.c
@@ -694,7 +694,7 @@ ibmhmc_set_config(StonithPlugin * s, StonithNVpair* list)
 	}		
 
 	/* parse the HMC's version info (i.e. "*RM V4R2.1" or "*RM R3V2.6") */
-	if ((sscanf(output, "*RM %c%1d", &firstchar, &firstnum) == 2)
+	if ((sscanf(output, "*RM %c%d", &firstchar, &firstnum) == 2)
 	&& ((firstchar == 'V') || (firstchar == 'R'))) {
 		dev->hmcver = firstnum;
 		if(Debug){
openSUSE Build Service is sponsored by