Accepting request 393423 from home:trenn:branches:systemsmanagement

- Update to latest version: 1.8.17
D    ipmitool-1.8.10-implicit-fortify-decl.patch
D    ipmitool-1_8_16_HEAD.patch
D    latest_compile_fixes.patch
D    ipmitool-sol_memleak.patch
- Remove whitespace changes from:
M    0001-Incorporate-upstream-comments-to-289-add-whitespace.patch

OBS-URL: https://build.opensuse.org/request/show/393423
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/ipmitool?expand=0&rev=36
This commit is contained in:
Thomas Renninger 2016-05-03 13:21:12 +00:00 committed by Git OBS Bridge
parent 570b85101b
commit 61368ed885
11 changed files with 57 additions and 444 deletions

View File

@ -8,10 +8,10 @@ Subject: [PATCH] Incorporate upstream comments to #289, add whitespace, other
contrib/bmc-snmp-proxy | 130 +++++++++++++++++++++++++++++--------------------
1 file changed, 76 insertions(+), 54 deletions(-)
Index: ipmitool-1.8.15/contrib/bmc-snmp-proxy
Index: ipmitool-1.8.17/contrib/bmc-snmp-proxy
===================================================================
--- ipmitool-1.8.15.orig/contrib/bmc-snmp-proxy 2015-01-14 14:34:05.488699284 +0100
+++ ipmitool-1.8.15/contrib/bmc-snmp-proxy 2015-01-14 14:34:05.508699284 +0100
--- ipmitool-1.8.17.orig/contrib/bmc-snmp-proxy 2016-05-03 15:12:49.493408552 +0200
+++ ipmitool-1.8.17/contrib/bmc-snmp-proxy 2016-05-03 15:15:11.553530150 +0200
@@ -3,7 +3,7 @@
#
# bmc-snmp-proxy: Set SNMP proxy to BMC (Baseboard Management Controller)
@ -34,13 +34,7 @@ Index: ipmitool-1.8.15/contrib/bmc-snmp-proxy
TRAPD_CONF="/etc/snmp/snmptrapd.conf"
@@ -61,14 +61,16 @@
else
RETVAL=2
fi
+
return $RETVAL
}
@@ -66,7 +66,7 @@ bmc_info_exists()
check_snmp()
{
@ -48,11 +42,8 @@ Index: ipmitool-1.8.15/contrib/bmc-snmp-proxy
+ if [ ! -d /etc/snmp ] || [ ! -x /usr/sbin/snmpd ]; then
RETVAL=12
fi
+
return $RETVAL
}
@@ -81,11 +83,12 @@
@@ -81,11 +81,12 @@ write_snmp_conf()
printf "###############################################\n"
printf "# Automatically created by %s #\n" "${SCRIPT_NAME}"
printf "###############################################\n"
@ -70,15 +61,7 @@ Index: ipmitool-1.8.15/contrib/bmc-snmp-proxy
printf "###############################################\n"
}
@@ -96,6 +99,7 @@
printf -- "%s" "${1}"| grep -Eq \
"^${octet}\\.${octet}\\.${octet}\\.${octet}$"
+
return $?
}
@@ -116,37 +120,38 @@
@@ -116,27 +117,28 @@ set_snmp_proxy()
if check_vars; then
PROXY_TOKEN="-c ${BMC_COMMUNITY} ${BMC_IPv4} ${BMC_OID}"
@ -118,9 +101,8 @@ Index: ipmitool-1.8.15/contrib/bmc-snmp-proxy
+ RETVAL=7
fi
done
+
return $RETVAL
}
@@ -144,9 +146,8 @@ set_snmpd_conf_path()
disable_snmp_proxy()
{
@ -132,7 +114,7 @@ Index: ipmitool-1.8.15/contrib/bmc-snmp-proxy
fi
}
#############################################################################
@@ -156,6 +161,7 @@
@@ -156,6 +157,7 @@ disable_snmp_proxy()
pick_alert_dest()
{
test_ip="$1"
@ -140,7 +122,7 @@ Index: ipmitool-1.8.15/contrib/bmc-snmp-proxy
for ALERT_DEST in `seq 1 4`
do
temp_ip=$(${IPMITOOL} lan alert print ${CHANNEL} ${ALERT_DEST}\
@@ -169,12 +175,12 @@
@@ -169,12 +171,12 @@ pick_alert_dest()
set_alert_dest_ip()
{
${IPMITOOL} lan alert set ${CHANNEL} ${ALERT_DEST} ipaddr ${1} \
@ -156,7 +138,7 @@ Index: ipmitool-1.8.15/contrib/bmc-snmp-proxy
# Pick the first active LAN channel
for CHANNEL in `seq 1 14`
do
@@ -184,12 +190,12 @@
@@ -184,12 +186,12 @@ bmc_alert_dest()
# If TRAPD_IP is already set as an alert dest,
if pick_alert_dest "${TRAPD_IP}"; then
@ -172,11 +154,7 @@ Index: ipmitool-1.8.15/contrib/bmc-snmp-proxy
return $RETVAL
# set: the TRAPD_IP
set_alert_dest_ip "${TRAPD_IP}"
@@ -197,42 +203,54 @@
# No free alert destinations
RETVAL=9
fi
+
@@ -200,39 +202,50 @@ bmc_alert_dest()
return $RETVAL
}
@ -236,7 +214,7 @@ Index: ipmitool-1.8.15/contrib/bmc-snmp-proxy
printf "###############################################\n"
}
@@ -240,10 +258,9 @@
@@ -240,10 +253,9 @@ config_trapd()
{
# Proceed only if snmptrapd is available on the system
if [ -f ${TRAPD_CONF} ]; then
@ -249,7 +227,7 @@ Index: ipmitool-1.8.15/contrib/bmc-snmp-proxy
fi
}
@@ -253,6 +270,7 @@
@@ -253,6 +265,7 @@ trap_sink_exists()
# multiple
FORWARD_HOST=$(awk '/^trap.*sink/{print $2}; /^informsink/{print $2}' \
/etc/snmp/snmpd*conf | head -1)
@ -257,7 +235,7 @@ Index: ipmitool-1.8.15/contrib/bmc-snmp-proxy
if [ -z "${FORWARD_HOST}" ]; then
# there is no trapsink setup.
return 1
@@ -265,19 +283,20 @@
@@ -265,19 +278,20 @@ trap_sink_exists()
trap_forward()
{
NO_TRAP=0
@ -283,7 +261,7 @@ Index: ipmitool-1.8.15/contrib/bmc-snmp-proxy
else
NO_TRAP=1
fi
@@ -292,7 +311,6 @@
@@ -292,7 +306,6 @@ service_reload()
service $1 reload
[ $? -ne 0 ] && RETVAL=6
fi
@ -291,12 +269,7 @@ Index: ipmitool-1.8.15/contrib/bmc-snmp-proxy
}
#############################################################################
@@ -300,11 +318,12 @@
{
if bmc_info_exists && check_snmp; then
touch ${LOCKFILE}
+
set_snmpd_conf_path && set_snmp_proxy
@@ -304,7 +317,7 @@ start()
[ $RETVAL -eq 0 ] && service_reload snmpd
if [ "${TRAP_FORWARD}" = "yes" ]; then
@ -305,7 +278,7 @@ Index: ipmitool-1.8.15/contrib/bmc-snmp-proxy
[ $RETVAL -eq 0 ] && [ $NO_TRAP -eq 0 ] && \
service_reload snmptrapd
fi
@@ -320,10 +339,11 @@
@@ -320,7 +333,7 @@ stop()
[ $RETVAL -eq 0 ] && service_reload snmpd
if [ "${TRAP_FORWARD}" = "yes" ]; then
@ -314,11 +287,7 @@ Index: ipmitool-1.8.15/contrib/bmc-snmp-proxy
[ $RETVAL -eq 0 ] && [ $NO_TRAP -eq 0 ] && \
service_reload snmptrapd
fi
+
rm -f ${LOCKFILE}
fi
}
@@ -333,12 +353,13 @@
@@ -333,7 +346,7 @@ status()
{
eval_gettext "${SCRIPT_NAME}: snmp proxy to BMC is "
# Checking for lockfile is better.
@ -327,13 +296,7 @@ Index: ipmitool-1.8.15/contrib/bmc-snmp-proxy
if [ -f ${LOCKFILE} ]; then
eval_gettext "set"
else
eval_gettext "not set"
fi
+
echo
RETVAL=0
}
@@ -364,10 +385,10 @@
@@ -364,10 +377,10 @@ case "$RETVAL" in
0|1) ;;
2) eval_gettext "${SCRIPT_NAME}: failed to read ${BMC_INFO} " 1>&2 ;;
3) eval_gettext "${SCRIPT_NAME}: failed to get proxy config." 1>&2 ;;
@ -346,11 +309,3 @@ Index: ipmitool-1.8.15/contrib/bmc-snmp-proxy
8) eval_gettext "${SCRIPT_NAME}: failed to set IPMI alert dest." 1>&2 ;;
9) eval_gettext "${SCRIPT_NAME}: no free IPMI alert dest." 1>&2 ;;
10) eval_gettext "${SCRIPT_NAME}: failed to set IPMI PEF." 1>&2 ;;
@@ -379,6 +400,7 @@
if [ ${RETVAL} -gt 1 ]; then
eval_gettext " Return code: ${RETVAL}"; echo
fi
+
exit ${RETVAL}
#############################################################################
# end of file

View File

@ -1,8 +1,8 @@
Index: ipmitool-1.8.16/lib/helper.c
Index: ipmitool-1.8.17/lib/helper.c
===================================================================
--- ipmitool-1.8.16.orig/lib/helper.c 2015-11-22 13:50:54.000000000 +0100
+++ ipmitool-1.8.16/lib/helper.c 2016-02-25 13:25:40.147488838 +0100
@@ -659,7 +659,6 @@ ipmi_start_daemon(struct ipmi_intf *intf
--- ipmitool-1.8.17.orig/lib/helper.c 2016-05-01 10:03:39.000000000 +0200
+++ ipmitool-1.8.17/lib/helper.c 2016-05-03 14:09:39.830095667 +0200
@@ -664,7 +664,6 @@ ipmi_start_daemon(struct ipmi_intf *intf
#endif
chdir("/");
@ -10,11 +10,11 @@ Index: ipmitool-1.8.16/lib/helper.c
for (fd=0; fd<64; fd++) {
if (fd != intf->fd)
Index: ipmitool-1.8.16/src/ipmievd.c
Index: ipmitool-1.8.17/src/ipmievd.c
===================================================================
--- ipmitool-1.8.16.orig/src/ipmievd.c 2015-11-22 13:50:54.000000000 +0100
+++ ipmitool-1.8.16/src/ipmievd.c 2016-02-25 13:25:40.155489280 +0100
@@ -701,6 +701,7 @@ ipmievd_main(struct ipmi_event_intf * ei
--- ipmitool-1.8.17.orig/src/ipmievd.c 2016-05-01 10:03:39.000000000 +0200
+++ ipmitool-1.8.17/src/ipmievd.c 2016-05-03 14:09:39.838096118 +0200
@@ -702,6 +702,7 @@ ipmievd_main(struct ipmi_event_intf * ei
int i, rc;
int daemon = 1;
struct sigaction act;
@ -22,7 +22,7 @@ Index: ipmitool-1.8.16/src/ipmievd.c
memset(pidfile, 0, 64);
sprintf(pidfile, "%s%d", DEFAULT_PIDFILE, eintf->intf->devnum);
@@ -763,8 +764,9 @@ ipmievd_main(struct ipmi_event_intf * ei
@@ -764,8 +765,9 @@ ipmievd_main(struct ipmi_event_intf * ei
ipmi_start_daemon(eintf->intf);

View File

@ -1,52 +0,0 @@
More compiler warning fixes
These were in SUSE distris for quite some time and got
forwardported from 1.8.10 to 1.8.11.
Index: lib/ipmi_sdradd.c
===================================================================
--- lib/ipmi_sdradd.c.orig 2015-01-14 15:38:00.728760259 +0100
+++ lib/ipmi_sdradd.c 2015-01-14 15:38:11.500760430 +0100
@@ -38,6 +38,7 @@
#include <stdio.h>
#include <time.h>
#include <fcntl.h>
+#include <unistd.h>
#include <ipmitool/helper.h>
#include <ipmitool/log.h>
Index: lib/ipmi_hpmfwupg.c
===================================================================
--- lib/ipmi_hpmfwupg.c.orig 2015-01-14 15:38:00.728760259 +0100
+++ lib/ipmi_hpmfwupg.c 2015-01-14 15:38:11.504760430 +0100
@@ -40,6 +40,8 @@
#include "../src/plugins/lan/md5.h"
#include <stdio.h>
#include <time.h>
+#include <ctype.h>
+#include <unistd.h>
#include <sys/param.h>
#if HAVE_CONFIG_H
Index: configure.ac
===================================================================
--- configure.ac.orig 2015-01-14 15:38:00.728760259 +0100
+++ configure.ac 2015-01-14 16:29:03.744808956 +0100
@@ -25,6 +25,7 @@
AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN
+AC_GNU_SOURCE
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STRTOD
@@ -32,7 +33,7 @@
AC_CHECK_FUNCS([memmove memset strchr strdup strerror])
AC_CHECK_FUNCS([getpassphrase])
-CFLAGS="$CFLAGS -Wall -Wextra -std=c99 -pedantic -Wformat -Wformat-nonliteral"
+CFLAGS="$CFLAGS -fno-strict-aliasing -Wreturn-type -std=c99"
AM_PROG_LIBTOOL
LIBTOOL="$LIBTOOL --silent"

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9c972fbfa9e400ba96a55464be25557f0386a1d44d238ebe9757c2b9b6e8eff7
size 461483

3
ipmitool-1.8.17.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3541244fe81298dbd611795a60f969f41c6073f05a23487999707b5be79792d0
size 474729

View File

@ -1,97 +0,0 @@
diff --git a/lib/hpm2.c b/lib/hpm2.c
index 6420629..f13be07 100644
--- a/lib/hpm2.c
+++ b/lib/hpm2.c
@@ -128,7 +128,7 @@ int hpm2_get_capabilities(struct ipmi_intf * intf,
#endif
/* check HPM.2 revision */
- if (caps->hpm2_revision_id != HPM2_REVISION) {
+ if (caps->hpm2_revision_id == 0) {
lprintf(LOG_NOTICE, "Bad HPM.2 revision, rev=%d",
caps->hpm2_revision_id);
return -1;
diff --git a/lib/ipmi_fru.c b/lib/ipmi_fru.c
index 40f98e7..5ca6466 100644
--- a/lib/ipmi_fru.c
+++ b/lib/ipmi_fru.c
@@ -5042,6 +5042,11 @@ ipmi_fru_set_field_string_rebuild(struct ipmi_intf * intf, uint8_t fruId,
header.offset.product += change_size_by_8;
}
+ if ((f_type == 'c' ) || (f_type == 'b' ) || (f_type == 'p' )) {
+ printf("Change multi offset from %d to %d\n", header.offset.multi, header.offset.multi + change_size_by_8);
+ header.offset.multi += change_size_by_8;
+ }
+
/* Adjust length of the section */
if (f_type == 'c')
{
diff --git a/lib/ipmi_sel.c b/lib/ipmi_sel.c
index 5df66a7..fbdccd9 100644
--- a/lib/ipmi_sel.c
+++ b/lib/ipmi_sel.c
@@ -419,7 +419,12 @@ ipmi_sel_add_entries_fromfile(struct ipmi_intf * intf, const char * filename)
memset(&sel_event, 0, sizeof(struct sel_event_record));
sel_event.record_id = 0x0000;
sel_event.record_type = 0x02;
- sel_event.sel_type.standard_type.gen_id = 0x00;
+ /*
+ * IPMI spec §32.1 generator ID
+ * Bit 0 = 1 "Software defined"
+ * Bit 1-7: SWID (IPMI spec §5.5), using 2 = "System management software"
+ */
+ sel_event.sel_type.standard_type.gen_id = 0x41;
sel_event.sel_type.standard_type.evm_rev = rqdata[0];
sel_event.sel_type.standard_type.sensor_type = rqdata[1];
sel_event.sel_type.standard_type.sensor_num = rqdata[2];
diff --git a/lib/ipmi_user.c b/lib/ipmi_user.c
index 6074209..e339c2a 100644
--- a/lib/ipmi_user.c
+++ b/lib/ipmi_user.c
@@ -590,7 +590,7 @@ ipmi_user_priv(struct ipmi_intf *intf, int argc, char **argv)
user_access.user_id);
return (-1);
} else {
- printf("Set Privilege Level command successful (user %d)",
+ printf("Set Privilege Level command successful (user %d)\n",
user_access.user_id);
return 0;
}
@@ -602,6 +602,7 @@ ipmi_user_mod(struct ipmi_intf *intf, int argc, char **argv)
/* Disable / Enable */
uint8_t user_id;
uint8_t operation;
+ uint8_t ccode;
if (argc != 2) {
print_user_usage();
@@ -613,8 +614,14 @@ ipmi_user_mod(struct ipmi_intf *intf, int argc, char **argv)
operation = (strncmp(argv[0], "disable", 7) == 0) ?
IPMI_PASSWORD_DISABLE_USER : IPMI_PASSWORD_ENABLE_USER;
- return _ipmi_set_user_password(intf, user_id, operation,
+ ccode = _ipmi_set_user_password(intf, user_id, operation,
(char *)NULL, 0);
+ if (eval_ccode(ccode) != 0) {
+ lprintf(LOG_ERR, "Set User Password command failed (user %d)",
+ user_id);
+ return (-1);
+ }
+ return 0;
}
int
diff --git a/src/plugins/ipmi_intf.c b/src/plugins/ipmi_intf.c
index 19ba5e3..090ab2f 100644
--- a/src/plugins/ipmi_intf.c
+++ b/src/plugins/ipmi_intf.c
@@ -451,7 +451,7 @@ ipmi_intf_socket_connect(struct ipmi_intf * intf)
}
/* OK, now try to connect with the scope id from this interface address */
- if (addr6->sin6_scope_id != 0) {
+ if (addr6->sin6_scope_id != 0 || !IN6_IS_ADDR_LINKLOCAL(&tmp6->sin6_addr)) {
if (connect(intf->fd, rp->ai_addr, rp->ai_addrlen) != -1) {
hints.ai_family = rp->ai_family;
lprintf(LOG_DEBUG, "Successful connected on %s interface with scope id %d", ifa->ifa_name, tmp6->sin6_scope_id);

View File

@ -1,21 +0,0 @@
Index: ipmitool-1.8.16/src/plugins/lanplus/lanplus.c
===================================================================
--- ipmitool-1.8.16.orig/src/plugins/lanplus/lanplus.c 2015-11-22 13:50:54.000000000 +0100
+++ ipmitool-1.8.16/src/plugins/lanplus/lanplus.c 2016-02-25 13:38:10.989859786 +0100
@@ -2101,7 +2101,7 @@ ipmi_lanplus_send_payload(
struct ipmi_v2_payload * payload)
{
struct ipmi_rs * rsp = NULL;
- uint8_t * msg_data;
+ uint8_t * msg_data = NULL;
int msg_length;
struct ipmi_session * session = intf->session;
struct ipmi_rq_entry * entry = NULL;
@@ -2341,6 +2341,7 @@ ipmi_lanplus_send_payload(
case IPMI_PAYLOAD_TYPE_RMCP_OPEN_REQUEST:
case IPMI_PAYLOAD_TYPE_RAKP_1:
case IPMI_PAYLOAD_TYPE_RAKP_3:
+ case IPMI_PAYLOAD_TYPE_SOL:
free(msg_data);
msg_data = NULL;
break;

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Tue May 3 13:08:43 UTC 2016 - trenn@suse.de
- Update to latest version: 1.8.17
D ipmitool-1.8.10-implicit-fortify-decl.patch
D ipmitool-1_8_16_HEAD.patch
D latest_compile_fixes.patch
D ipmitool-sol_memleak.patch
- Remove whitespace changes from:
M 0001-Incorporate-upstream-comments-to-289-add-whitespace.patch
-------------------------------------------------------------------
Thu Feb 25 11:57:55 UTC 2016 - trenn@suse.de

View File

@ -27,20 +27,16 @@ Url: http://ipmitool.sourceforge.net/
Summary: Utility for IPMI Control
License: BSD-3-Clause
Group: System/Management
Version: 1.8.16
Version: 1.8.17
Release: 0
Source: http://heanet.dl.sourceforge.net/sourceforge/%{name}/%{name}-%{version}.tar.bz2
Source1: ipmievd.service
Source2: ipmievd.sysconf
Patch1: ipmitool-1_8_16_HEAD.patch
Patch3: fwum_enhance_output.patch
Patch6: fix_file_permissions.patch
Patch8: several_more_compile_fixes.patch
Patch9: ipmitool_adjust_suse.paths
Patch10: 0001-Incorporate-upstream-comments-to-289-add-whitespace.patch
Patch11: ipmitool-1.8.10-implicit-fortify-decl.patch
Patch12: latest_compile_fixes.patch
Patch13: ipmitool-sol_memleak.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# bmc-snmp-proxy needs /usr/sbin/snmpd
@ -68,15 +64,11 @@ and setting LAN configuration, and chassis power control.
%prep
%setup -q
%patch1 -p1
%patch3 -p1
%patch6 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p0
%patch12 -p1
%patch13 -p1
%build
touch INSTALL NEWS

View File

@ -1,175 +0,0 @@
Fix compile issues
Use _XOPEN_SOURCE 500 in ipmi_main to get getpass defined.
from manpage:
getpass():
Since glibc 2.2.2:
_BSD_SOURCE ||
(_XOPEN_SOURCE >= 500 ||
_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) &&
!(_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600)
and more compiler warning fixing stuff...
Signed-off-by: Thomas Renninger <trenn@suse.de>
Index: ipmitool-1.8.16/lib/ipmi_chassis.c
===================================================================
--- ipmitool-1.8.16.orig/lib/ipmi_chassis.c 2015-11-22 13:50:54.000000000 +0100
+++ ipmitool-1.8.16/lib/ipmi_chassis.c 2016-02-25 13:25:49.392010059 +0100
@@ -30,6 +30,7 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
+#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
Index: ipmitool-1.8.16/lib/ipmi_main.c
===================================================================
--- ipmitool-1.8.16.orig/lib/ipmi_main.c 2015-11-22 13:50:54.000000000 +0100
+++ ipmitool-1.8.16/lib/ipmi_main.c 2016-02-25 13:25:49.400010253 +0100
@@ -29,7 +29,7 @@
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
-#define _XOPEN_SOURCE 700
+#define _XOPEN_SOURCE 500
#include <stdlib.h>
#include <stdio.h>
Index: ipmitool-1.8.16/lib/ipmi_sel.c
===================================================================
--- ipmitool-1.8.16.orig/lib/ipmi_sel.c 2016-02-25 13:25:35.059202081 +0100
+++ ipmitool-1.8.16/lib/ipmi_sel.c 2016-02-25 13:25:49.408010606 +0100
@@ -2399,18 +2399,18 @@ ipmi_sel_interpret(struct ipmi_intf *int
evt.sel_type.standard_type.timestamp;
/* skip timestamp */
- cursor = index((const char *)cursor, ';');
+ cursor = strchr((const char *)cursor, ';');
cursor++;
/* FIXME: parse originator */
evt.sel_type.standard_type.gen_id = 0x0020;
/* skip originator info */
- cursor = index((const char *)cursor, ';');
+ cursor = strchr((const char *)cursor, ';');
cursor++;
/* Get sensor type */
- cursor = index((const char *)cursor, '(');
+ cursor = strchr((const char *)cursor, '(');
cursor++;
errno = 0;
@@ -2421,7 +2421,7 @@ ipmi_sel_interpret(struct ipmi_intf *int
status = (-1);
break;
}
- cursor = index((const char *)cursor, ',');
+ cursor = strchr((const char *)cursor, ',');
cursor++;
errno = 0;
@@ -2434,7 +2434,7 @@ ipmi_sel_interpret(struct ipmi_intf *int
}
/* skip to event type info */
- cursor = index((const char *)cursor, ':');
+ cursor = strchr((const char *)cursor, ':');
cursor++;
errno = 0;
@@ -2447,7 +2447,7 @@ ipmi_sel_interpret(struct ipmi_intf *int
}
/* skip to event dir info */
- cursor = index((const char *)cursor, '(');
+ cursor = strchr((const char *)cursor, '(');
cursor++;
if (*cursor == 'a') {
evt.sel_type.standard_type.event_dir = 0;
@@ -2455,7 +2455,7 @@ ipmi_sel_interpret(struct ipmi_intf *int
evt.sel_type.standard_type.event_dir = 1;
}
/* skip to data info */
- cursor = index((const char *)cursor, ' ');
+ cursor = strchr((const char *)cursor, ' ');
cursor++;
if (evt.sel_type.standard_type.sensor_type == 0xF0) {
@@ -2474,7 +2474,7 @@ ipmi_sel_interpret(struct ipmi_intf *int
}
/* Get to previous state */
- cursor = index((const char *)cursor, 'M');
+ cursor = strchr((const char *)cursor, 'M');
cursor++;
/* Set previous state */
@@ -2488,7 +2488,7 @@ ipmi_sel_interpret(struct ipmi_intf *int
}
/* Get to current state */
- cursor = index((const char *)cursor, 'M');
+ cursor = strchr((const char *)cursor, 'M');
cursor++;
/* Set current state */
@@ -2502,7 +2502,7 @@ ipmi_sel_interpret(struct ipmi_intf *int
}
/* skip to cause */
- cursor = index((const char *)cursor, '=');
+ cursor = strchr((const char *)cursor, '=');
cursor++;
errno = 0;
evt.sel_type.standard_type.event_data[1] |=
@@ -2521,7 +2521,7 @@ ipmi_sel_interpret(struct ipmi_intf *int
status = (-1);
break;
}
- cursor = index((const char *)cursor, ' ');
+ cursor = strchr((const char *)cursor, ' ');
cursor++;
errno = 0;
@@ -2533,7 +2533,7 @@ ipmi_sel_interpret(struct ipmi_intf *int
break;
}
- cursor = index((const char *)cursor, ' ');
+ cursor = strchr((const char *)cursor, ' ');
cursor++;
errno = 0;
Index: ipmitool-1.8.16/src/ipmishell.c
===================================================================
--- ipmitool-1.8.16.orig/src/ipmishell.c 2015-11-22 13:50:54.000000000 +0100
+++ ipmitool-1.8.16/src/ipmishell.c 2016-02-25 13:25:49.412010855 +0100
@@ -30,6 +30,9 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
+/* strdup needs this */
+#define _XOPEN_SOURCE 500
+
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
Index: ipmitool-1.8.16/lib/log.c
===================================================================
--- ipmitool-1.8.16.orig/lib/log.c 2015-11-22 13:50:54.000000000 +0100
+++ ipmitool-1.8.16/lib/log.c 2016-02-25 13:25:49.420011423 +0100
@@ -30,6 +30,9 @@
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
+/* strdup needs this */
+#define _XOPEN_SOURCE 500
+
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

View File

@ -4,11 +4,11 @@ Changes partly very old and not possible to find the original author.
Signed-off-by: Thomas Renninger <trenn@suse.de>
Index: ipmitool-1.8.16/lib/ipmi_ekanalyzer.c
Index: ipmitool-1.8.17/lib/ipmi_ekanalyzer.c
===================================================================
--- ipmitool-1.8.16.orig/lib/ipmi_ekanalyzer.c 2015-11-22 13:50:54.000000000 +0100
+++ ipmitool-1.8.16/lib/ipmi_ekanalyzer.c 2016-02-25 13:25:42.079597717 +0100
@@ -3365,7 +3365,7 @@ ipmi_ek_display_board_p2p_record(struct
--- ipmitool-1.8.17.orig/lib/ipmi_ekanalyzer.c 2016-05-01 10:03:39.000000000 +0200
+++ ipmitool-1.8.17/lib/ipmi_ekanalyzer.c 2016-05-03 14:09:46.242458958 +0200
@@ -3363,7 +3363,7 @@ ipmi_ek_display_board_p2p_record(struct
printf("\n");
offset += sizeof(struct fru_picmgext_guid);
}
@ -17,7 +17,7 @@ Index: ipmitool-1.8.16/lib/ipmi_ekanalyzer.c
offset < record->header.len;
offset += sizeof(struct fru_picmgext_link_desc)) {
/* to solve little endian/big endian problem */
@@ -3524,7 +3524,7 @@ ipmi_ek_display_radial_ipmb0_record(stru
@@ -3522,7 +3522,7 @@ ipmi_ek_display_radial_ipmb0_record(stru
if (record->data[offset] < 1) {
return;
}
@ -26,7 +26,7 @@ Index: ipmitool-1.8.16/lib/ipmi_ekanalyzer.c
unsigned char entry_count = 0;
printf(" IPMB-0 Hub Descriptor\n");
printf("\tHardware Address: 0x%02x\n",
@@ -3982,7 +3982,7 @@ ipmi_ek_display_clock_config_record(stru
@@ -3980,7 +3980,7 @@ ipmi_ek_display_clock_config_record(stru
(feature & 1) ? "Source" : "Receiver");
printf("\tFamily: 0x%02x - AccLVL: 0x%02x\n",
family, accuracy);
@ -35,10 +35,10 @@ Index: ipmitool-1.8.16/lib/ipmi_ekanalyzer.c
freq, min_freq, max_freq);
}
printf("\n");
Index: ipmitool-1.8.16/lib/ipmi_picmg.c
Index: ipmitool-1.8.17/lib/ipmi_picmg.c
===================================================================
--- ipmitool-1.8.16.orig/lib/ipmi_picmg.c 2015-11-22 13:50:54.000000000 +0100
+++ ipmitool-1.8.16/lib/ipmi_picmg.c 2016-02-25 13:25:42.087598155 +0100
--- ipmitool-1.8.17.orig/lib/ipmi_picmg.c 2016-05-01 10:03:39.000000000 +0200
+++ ipmitool-1.8.17/lib/ipmi_picmg.c 2016-05-03 14:09:46.250459411 +0200
@@ -855,7 +855,7 @@ ipmi_picmg_portstate_get(struct ipmi_int
}
else if (d->type >= 0x06 && d->type <= 0xef)
@ -48,7 +48,7 @@ Index: ipmitool-1.8.16/lib/ipmi_picmg.c
}
else if (d->type >= 0xf0 && d->type <= 0xfe)
{
@@ -1703,7 +1703,7 @@ ipmi_picmg_clk_get(struct ipmi_intf * in
@@ -1707,7 +1707,7 @@ ipmi_picmg_clk_get(struct ipmi_intf * in
oemval2str( rsp->data[3], rsp->data[4],
picmg_clk_accuracy_vals));
@ -57,11 +57,11 @@ Index: ipmitool-1.8.16/lib/ipmi_picmg.c
}
}
}
Index: ipmitool-1.8.16/lib/ipmi_sdr.c
Index: ipmitool-1.8.17/lib/ipmi_sdr.c
===================================================================
--- ipmitool-1.8.16.orig/lib/ipmi_sdr.c 2015-11-22 13:50:54.000000000 +0100
+++ ipmitool-1.8.16/lib/ipmi_sdr.c 2016-02-25 13:25:42.095598619 +0100
@@ -52,6 +52,7 @@
--- ipmitool-1.8.17.orig/lib/ipmi_sdr.c 2016-05-01 10:03:39.000000000 +0200
+++ ipmitool-1.8.17/lib/ipmi_sdr.c 2016-05-03 14:09:46.258459865 +0200
@@ -53,6 +53,7 @@
#include <ipmitool/ipmi_entity.h>
#include <ipmitool/ipmi_constants.h>
#include <ipmitool/ipmi_strings.h>