[packages/ipv6calc] - up to 1.0.0; patch from fc

arekm arekm at pld-linux.org
Sat Sep 22 12:27:57 CEST 2018


commit 89aa954d18d129ff552d40efafe71f4dc3fee6c6
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sat Sep 22 12:27:49 2018 +0200

    - up to 1.0.0; patch from fc

 ipv6calc-1.0.0-9dc6e5ac.patch | 103 ++++++++++++++++++++++++++++++++++++++++++
 ipv6calc.spec                 |   8 ++--
 2 files changed, 108 insertions(+), 3 deletions(-)
---
diff --git a/ipv6calc.spec b/ipv6calc.spec
index fd39f20..d174f81 100644
--- a/ipv6calc.spec
+++ b/ipv6calc.spec
@@ -6,12 +6,13 @@
 Summary:	IPv6 address format change and calculation utility
 Summary(pl.UTF-8):	Narzędzie do zmiany formatu i przeliczania adresów IPv6
 Name:		ipv6calc
-Version:	0.97.3
-Release:	2
+Version:	1.0.0
+Release:	1
 License:	GPL v2
 Group:		Networking/Utilities
 Source0:	ftp://ftp.bieringer.de/pub/linux/IPv6/ipv6calc/%{name}-%{version}.tar.gz
-# Source0-md5:	1fc9c1a14802638f21e59408faa721a6
+# Source0-md5:	6eed2e5b8ca07330e044d809ade3b565
+Patch0:		ipv6calc-1.0.0-9dc6e5ac.patch
 URL:		http://www.deepspace6.net/projects/ipv6calc.html
 %{?with_geoip:BuildRequires:	GeoIP-devel >= 1.4.1}
 %{?with_ip2location:BuildRequires:	ip2location-c-devel}
@@ -36,6 +37,7 @@ IPv6 do DNS lub odpytywaniu w rodzaju nslookup -q=ANY `ipv6calc -r
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %configure \
diff --git a/ipv6calc-1.0.0-9dc6e5ac.patch b/ipv6calc-1.0.0-9dc6e5ac.patch
new file mode 100644
index 0000000..b54b0c2
--- /dev/null
+++ b/ipv6calc-1.0.0-9dc6e5ac.patch
@@ -0,0 +1,103 @@
+diff --git a/configure b/configure
+--- a/configure
++++ b/configure
+@@ -4297,6 +4297,38 @@ else
+ 				{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** missing CFLAGS support: -Wextra" >&5
+ $as_echo "$as_me: WARNING: *** missing CFLAGS support: -Wextra" >&2;}
+ 
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++		CFLAGS="$CFLAGS_SAVE"
++
++		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: *** check for CFLAGS: -Werror=format-truncation" >&5
++$as_echo "*** check for CFLAGS: -Werror=format-truncation" >&6; }
++		CFLAGS_SAVE="$CFLAGS"
++		CFLAGS="$CFLAGS -Werror=format-truncation"
++		cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++int a=1;
++int
++main ()
++{
++
++  ;
++  return 0;
++}
++
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++
++				{ $as_echo "$as_me:${as_lineno-$LINENO}: result: *** CFLAGS supported: -Werror=format-truncation" >&5
++$as_echo "*** CFLAGS supported: -Werror=format-truncation" >&6; }
++				# disable errors related to format-truncation
++				CFLAGS_EXTRA="$CFLAGS_EXTRA -Werror=format-truncation=0"
++
++else
++
++				{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** missing CFLAGS support: -Werror=format-truncation" >&5
++$as_echo "$as_me: WARNING: *** missing CFLAGS support: -Werror=format-truncation" >&2;}
++
+ fi
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ 		CFLAGS="$CFLAGS_SAVE"
+diff --git a/configure.in b/configure.in
+--- a/configure.in
++++ b/configure.in
+@@ -135,6 +135,22 @@ AC_ARG_ENABLE([compiler-warning-to-error],
+ 				AC_MSG_WARN([*** missing CFLAGS support: -Wextra])
+ 			])
+ 		CFLAGS="$CFLAGS_SAVE"
++
++		AC_MSG_RESULT([*** check for CFLAGS: -Werror=format-truncation])
++		CFLAGS_SAVE="$CFLAGS"
++		CFLAGS="$CFLAGS -Werror=format-truncation"
++		AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
++			     [[int a=1;]])
++			],
++			[
++				AC_MSG_RESULT([*** CFLAGS supported: -Werror=format-truncation])
++				# disable errors related to format-truncation
++				CFLAGS_EXTRA="$CFLAGS_EXTRA -Werror=format-truncation=0"
++			],
++			[
++				AC_MSG_WARN([*** missing CFLAGS support: -Werror=format-truncation])
++			])
++		CFLAGS="$CFLAGS_SAVE"
+ 	])
+ 
+ dnl *************************************************
+diff --git a/databases/lib/libipv6calc_db_wrapper_DBIP.c b/databases/lib/libipv6calc_db_wrapper_DBIP.c
+--- a/databases/lib/libipv6calc_db_wrapper_DBIP.c
++++ b/databases/lib/libipv6calc_db_wrapper_DBIP.c
+@@ -786,8 +786,7 @@ char *libipv6calc_db_wrapper_DBIP_database_info(const unsigned int type) {
+ 	};
+ 
+ 	char year[5];
+-	strncpy(year, datastring, 4);
+-	year[4] = '\0';
++	snprintf(year, sizeof(year), "%s", datastring);
+ 	snprintf(resultstring, sizeof(resultstring), "DBIP-%d/%s %s Copyright (c) %s db-ip.com All Rights Reserved"
+ 		, type
+ 		, datastring
+diff --git a/ipv6calc/ipv6calc.c b/ipv6calc/ipv6calc.c
+index 2eb8ebc..9c961c2 100644
+--- a/ipv6calc/ipv6calc.c
++++ b/ipv6calc/ipv6calc.c
+@@ -1941,7 +1941,7 @@ PIPE_input:
+ 
+ 			if ((formatoptions & FORMATOPTION_print_iid_var) == FORMATOPTION_print_iid_var) {
+ 				iid_random_result = ipv6addr_iidrandomdetection(&ipv6addr, &iid_statistics);
+-				sprintf(resultstring2, "%-40s R=%d h=%7.3f r=%7.3f db= %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d dbh= %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d da= %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d dd= %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d dda= %d", resultstring, \
++				snprintf(resultstring2, sizeof(resultstring2), "%-40s R=%d h=%7.3f r=%7.3f db= %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d dbh= %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d da= %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d dd= %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d dda= %d", resultstring, \
+ 					iid_random_result, iid_statistics.hexdigit, iid_statistics.lls_residual, \
+ 					iid_statistics.digit_blocks[0], iid_statistics.digit_blocks[1], iid_statistics.digit_blocks[2], iid_statistics.digit_blocks[3], iid_statistics.digit_blocks[4], iid_statistics.digit_blocks[5], iid_statistics.digit_blocks[6], iid_statistics.digit_blocks[7], iid_statistics.digit_blocks[8], iid_statistics.digit_blocks[9], iid_statistics.digit_blocks[10], iid_statistics.digit_blocks[11], iid_statistics.digit_blocks[12], iid_statistics.digit_blocks[13], iid_statistics.digit_blocks[14], iid_statistics.digit_blocks[15], \
+ 					iid_statistics.digit_blocks_hexdigit[0], iid_statistics.digit_blocks_hexdigit[1], iid_statistics.digit_blocks_hexdigit[2], iid_statistics.digit_blocks_hexdigit[3], iid_statistics.digit_blocks_hexdigit[4], iid_statistics.digit_blocks_hexdigit[5], iid_statistics.digit_blocks_hexdigit[6], iid_statistics.digit_blocks_hexdigit[7], iid_statistics.digit_blocks_hexdigit[8], iid_statistics.digit_blocks_hexdigit[9], iid_statistics.digit_blocks_hexdigit[10], iid_statistics.digit_blocks_hexdigit[11], iid_statistics.digit_blocks_hexdigit[12], iid_statistics.digit_blocks_hexdigit[13], iid_statistics.digit_blocks_hexdigit[14], iid_statistics.digit_blocks_hexdigit[15], \
+@@ -1950,7 +1950,7 @@ PIPE_input:
+ 					iid_statistics.digit_delta[16], iid_statistics.digit_delta[17], iid_statistics.digit_delta[18], iid_statistics.digit_delta[19], iid_statistics.digit_delta[20], iid_statistics.digit_delta[21], iid_statistics.digit_delta[22], iid_statistics.digit_delta[23], iid_statistics.digit_delta[24], iid_statistics.digit_delta[25], iid_statistics.digit_delta[26], iid_statistics.digit_delta[27], iid_statistics.digit_delta[28], iid_statistics.digit_delta[29], iid_statistics.digit_delta[30], \
+ 					iid_statistics.digit_delta_amount
+ 				);
+-				sprintf(resultstring, "%s", resultstring2);
++				snprintf(resultstring, sizeof(resultstring), "%s", resultstring2);
+ 			};
+ 			break;
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ipv6calc.git/commitdiff/89aa954d18d129ff552d40efafe71f4dc3fee6c6



More information about the pld-cvs-commit mailing list