File 0008-bsc#1181063-dont-parametrize-pidfile-name.patch of Package ipmitool.24404

Index: ipmitool-1.8.18+git20200204.7ccea28/doc/ipmievd.8.in
===================================================================
--- ipmitool-1.8.18+git20200204.7ccea28.orig/doc/ipmievd.8.in
+++ ipmitool-1.8.18+git20200204.7ccea28/doc/ipmievd.8.in
@@ -174,8 +174,7 @@ Do NOT become a daemon, instead log all
 .TP
 \fIpidfile\fP=<\fBfilename\fR>
 Save process ID to this file when in daemon mode.  Defaults to
-/run/ipmievd.pid\fIN\fP (where \fIN\fP is the ipmi device
-number -- defaults to 0).
+/var/run/ipmievd.pid.
 .RE
 
 .TP 
@@ -197,8 +196,7 @@ Do NOT become a daemon, instead log all
 .TP
 \fIpidfile\fP=<\fBfilename\fR>
 Save process ID to this file when in daemon mode.  Defaults to
-/run/ipmievd.pid\fIN\fP (where \fIN\fP is the ipmi device
-number -- defaults to 0).
+/var/run/ipmievd.pid.
 .TP 
 \fItimeout\fP=<\fBseconds\fR>
 Time between checks for SEL polling method.  Default is 10 seconds.
Index: ipmitool-1.8.18+git20200204.7ccea28/src/ipmievd.c
===================================================================
--- ipmitool-1.8.18+git20200204.7ccea28.orig/src/ipmievd.c
+++ ipmitool-1.8.18+git20200204.7ccea28/src/ipmievd.c
@@ -702,8 +702,8 @@ ipmievd_main(struct ipmi_event_intf * ei
 	struct sigaction act;
 	mode_t oldumask;
 
-	memset(pidfile, 0, 64);
-	sprintf(pidfile, "%s%d", DEFAULT_PIDFILE, eintf->intf->devnum);
+	memset(pidfile, 0, sizeof(pidfile));
+	strncpy(pidfile, DEFAULT_PIDFILE, sizeof(pidfile)-1);
 
 	for (i = 0; i < argc; i++) {
 		if (strncasecmp(argv[i], "help", 4) == 0) {
openSUSE Build Service is sponsored by