diff --git a/0007-bsc#1175328-check-for-correct-fd.patch b/0007-bsc#1175328-check-for-correct-fd.patch new file mode 100644 index 0000000..f50295e --- /dev/null +++ b/0007-bsc#1175328-check-for-correct-fd.patch @@ -0,0 +1,13 @@ +Index: ipmitool-1.8.18+git20200916.1245aaa387dc/lib/helper.c +=================================================================== +--- ipmitool-1.8.18+git20200916.1245aaa387dc.orig/lib/helper.c ++++ ipmitool-1.8.18+git20200916.1245aaa387dc/lib/helper.c +@@ -935,7 +935,7 @@ ipmi_start_daemon(struct ipmi_intf *intf + exit(1); + } + ret = dup(fd); +- if (ret != STDOUT_FILENO) { ++ if (ret != STDERR_FILENO) { + lprintf(LOG_ERR, "failed to reset stderr: %s (%d)", strerror(errno), errno); + exit(1); + } diff --git a/0008-bsc#1181063-dont-parametrize-pidfile-name.patch b/0008-bsc#1181063-dont-parametrize-pidfile-name.patch new file mode 100644 index 0000000..b1ec6e9 --- /dev/null +++ b/0008-bsc#1181063-dont-parametrize-pidfile-name.patch @@ -0,0 +1,39 @@ +Index: ipmitool-1.8.18+git20200916.1245aaa387dc/src/ipmievd.c +=================================================================== +--- ipmitool-1.8.18+git20200916.1245aaa387dc.orig/src/ipmievd.c ++++ ipmitool-1.8.18+git20200916.1245aaa387dc/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 (strcasecmp(argv[i], "help") == 0) { +Index: ipmitool-1.8.18+git20200916.1245aaa387dc/doc/ipmievd.8.in +=================================================================== +--- ipmitool-1.8.18+git20200916.1245aaa387dc.orig/doc/ipmievd.8.in ++++ ipmitool-1.8.18+git20200916.1245aaa387dc/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 +-/var/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 +-/var/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. diff --git a/ipmitool.changes b/ipmitool.changes index 9d4bfee..c60eefe 100644 --- a/ipmitool.changes +++ b/ipmitool.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Thu Jan 28 13:53:14 UTC 2021 - Josef Möllers + +- Do not append the device number to the PIDFILE pathname + as this will confuse systemd. + [bsc#1181063, 0008-bsc#1181063-dont-parametrize-pidfile-name.patch] + +------------------------------------------------------------------- +Thu Jan 28 09:10:47 UTC 2021 - Josef Möllers + +- When really starting the daemon, in lib/helper.c::ipmi_start_daemon() + stdin/stdout/stderr are redirected to /dev/null and this is checked + but the check for stderr tests for STDOUT_FILENO. This is, most + likely, a copy-paste error. + [bsc#1175328, 0007-bsc#1175328-check-for-correct-fd.patch] + ------------------------------------------------------------------- Wed Sep 23 07:49:45 UTC 2020 - Klaus Kämpf diff --git a/ipmitool.spec b/ipmitool.spec index 2907468..041cc23 100644 --- a/ipmitool.spec +++ b/ipmitool.spec @@ -33,6 +33,8 @@ Patch3: 0003-Cleanup-and-compiler-issues-only-no-functional-chang.patch Patch4: 0004-Adjust-SUSE-paths.patch Patch5: 0005-HPM-x-compatibility-message-is-DEBUG-only.patch Patch6: 0006-Make-IANA-PEN-download-configurable-fix-uninitalized.patch +Patch7: 0007-bsc#1175328-check-for-correct-fd.patch +Patch8: 0008-bsc#1181063-dont-parametrize-pidfile-name.patch BuildRequires: libtool BuildRequires: openssl-devel BuildRequires: readline-devel