SHA256
1
0
forked from pool/ipmitool
ipmitool/autotools_define_DOWNLOAD.diff
Thomas Renninger 0728bd93f6 Accepting request 773431 from home:trenn:branches:systemsmanagement
- bsc#1163026
- CVE-2020-5208
- Use license macro for COPYING, instead of doc
- Add ChangeLog mainline log to docs for shorter
  obs changelogs. This will be the last more detailed
  changelog, due to more important buffer overflow patches.
  Otherwise this changelog will not include (mainline) changes
  anymore.
- Update to version 1.8.18+git20200204.7ccea28:
  * fru, sdr: Fix id_string buffer overflows
  * lanp: Fix buffer overflows in get_lan_param_select
  * channel: Fix buffer overflow
  * session: Fix buffer overflow in ipmi_get_session_info
  * fru: Fix buffer overflow in ipmi_spd_print_fru
  * fru: Fix buffer overflow vulnerabilities
  * chassis: bootmbox: Refix 62a04390
  * configure: Drop requirement for curses et. al libs
- Add a configure option to disable IANA PEN database internet download
A    autotools_define_DOWNLOAD.diff
D    create_pen_list_from_local_file.patch
- New pen database:
M    enterprise-numbers
- Patches adjusted to latest mainline code:
M    fix_file_permissions.patch
M    ipmitool_adjust_suse_paths.patch
M    several_more_compile_fixes.patch

OBS-URL: https://build.opensuse.org/request/show/773431
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/ipmitool?expand=0&rev=51
2020-02-11 12:28:03 +00:00

123 lines
3.9 KiB
Diff

Make IANA PEN download configurable - fix uninitalized DOWNLOAD variable
Currently if you do not have wget and curl requirement met, you get
this error:
[ 93s] configure: WARNING: ** Neither wget nor curl could be found.
[ 93s] configure: WARNING: ** IANA PEN database will not be installed by `make install` !
[ 93s] configure: WARNING: ** Download is:
[ 93s] configure: WARNING:
...
[ 104s] configure: error: conditional "DOWNLOAD" was never defined.
[ 104s] Usually this means the macro was only invoked conditionally.
[ 104s] error: Bad exit status from /var/tmp/rpm-tmp.TYnvu5 (%build)
Internet download is restricted in most build environments.
So there must be a knob to enable/disable IANA PEN database download.
For security reasons and as a good manner for open source tools, the internet
download is by default set to off.
This patch initializes all needed variables and also introduces to make the
IANA PEN internet download configurable.
./configure
then has this additional feature:
--enable-iana-download Download IANA PEN database [default=no]
Depending on whether it has explicitly been enabled this additional output
is shown after build env is successfully set up via ./configure:
Download IANA PEN database : yes
IANA PEN database URL : http://www.iana.org/assignments/enterprise-numbers
The URL is unfortunately hardcoded in the message. I couldn't find a quick
way to show the IANA_PEN_URL variable there, so if this is ever changed (it is
not configurable right now, but maybe with a follow up patch in the future),
it has to be changed in the help string as well.
---
Makefile.am | 5 ++---
configure.ac | 38 ++++++++++++++++++++++++++------------
2 files changed, 28 insertions(+), 15 deletions(-)
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,7 +41,6 @@
$(distdir).tar.gz $(distdir).tar.bz2
SUBDIRS = lib src include doc contrib control
-IANA_PEN = http://www.iana.org/assignments/enterprise-numbers
dist-hook:
cp control/ipmitool.spec $(distdir)
@@ -52,8 +51,8 @@
enterprise-numbers:
@echo Downloading IANA PEN database...
- @$(DOWNLOAD) "$(IANA_PEN)" > tmpfile.$$PPID || {\
- echo "FAILED to download the IANA PEN database"; \
+ @$(DOWNLOAD) "$(IANA_PEN_URL)" > tmpfile.$$PPID || {\
+ echo "FAILED to download the IANA PEN database from $(IANA_PEN_URL)"; \
rm tmpfile.$$PPID; \
false; \
}
--- a/configure.ac
+++ b/configure.ac
@@ -56,23 +56,34 @@
exec_prefix="$prefix"
fi
-if test "x$WGET" = "x"; then
- if test "x$CURL" = "x"; then
- AC_MSG_WARN([** Neither wget nor curl could be found.])
- AC_MSG_WARN([** IANA PEN database will not be installed by `make install` !])
+xiana_pen_url="http://www.iana.org/assignments/enterprise-numbers"
+AC_SUBST(IANA_PEN_URL, xiana_pen_url)
+
+AC_ARG_ENABLE([iana-download],
+ [AC_HELP_STRING([--enable-iana-download],
+ [Download IANA PEN database [default=no]])],
+ [xenable_iana_download=$enableval],
+ [xenable_iana_download=no])
+if test "x$xenable_iana_download" = "xyes"; then
+ if test "x$WGET" = "x"; then
+ if test "x$CURL" = "x"; then
+ AC_MSG_WARN([** Neither wget nor curl could be found.])
+ AC_MSG_WARN([** IANA PEN database will not be installed by `make install` !])
+ xenable_iana_download="no"
+ else
+ DOWNLOAD="$CURL -#"
+ fi
else
- DOWNLOAD="$CURL -#"
- AM_CONDITIONAL([DOWNLOAD], [true])
+ DOWNLOAD="$WGET -c -nd -O -"
fi
-else
- DOWNLOAD="$WGET -c -nd -O -"
+fi
+if test "x$xenable_iana_download" = "xyes"; then
AM_CONDITIONAL([DOWNLOAD], [true])
+ AC_SUBST(DOWNLOAD, $DOWNLOAD)
+else
+ AM_CONDITIONAL([DOWNLOAD], [false])
fi
-AC_MSG_WARN([** Download is:])
-AC_MSG_WARN($DOWNLOAD)
-AC_SUBST(DOWNLOAD, $DOWNLOAD)
-
dnl
dnl set default option values
dnl
@@ -776,4 +787,7 @@
AC_MSG_RESULT([ ipmievd : yes])
AC_MSG_RESULT([ ipmishell : $xenable_ipmishell])
AC_MSG_RESULT([])
+AC_MSG_RESULT([ Download IANA PEN database : $xenable_iana_download])
+AC_MSG_RESULT([ IANA PEN database URL : $xiana_pen_url])
+AC_MSG_RESULT([])