[packages/ntp] - fixes for build with -Werror=format-security option

draenog draenog at pld-linux.org
Mon Oct 22 14:24:57 CEST 2012


commit f59e8d316a542780e589dbc5a96888fd6b49d74e
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Mon Oct 22 13:23:42 2012 +0100

    - fixes for build with -Werror=format-security option

 ntp-format-security.patch | 70 +++++++++++++++++++++++++++++++++++++++++++++++
 ntp.spec                  |  2 ++
 2 files changed, 72 insertions(+)
---
diff --git a/ntp.spec b/ntp.spec
index c0a859b..bc239cd 100644
--- a/ntp.spec
+++ b/ntp.spec
@@ -34,6 +34,7 @@ Patch1:		%{name}-no_libelf.patch
 Patch2:		%{name}-ipv6.patch
 Patch3:		%{name}-nano.patch
 Patch4:		%{name}-no_avahi.patch
+Patch5:		%{name}-format-security.patch
 # FC patches + 100
 Patch101:	%{name}-4.2.6p1-sleep.patch
 Patch102:	%{name}-4.2.6p1-droproot.patch
@@ -246,6 +247,7 @@ Este pacote contém documentação adicional sobre o NTP versão 4.
 %patch2 -p1
 %patch3 -p1
 %{!?with_avahi:%patch4 -p1}
+%patch5 -p1
 
 ## FC patches
 %patch101 -p1
diff --git a/ntp-format-security.patch b/ntp-format-security.patch
new file mode 100644
index 0000000..28fdbd2
--- /dev/null
+++ b/ntp-format-security.patch
@@ -0,0 +1,70 @@
+diff -ur ntp-4.2.6p5/lib/isc/unix/ifiter_ioctl.c ntp-4.2.6p5.new/lib/isc/unix/ifiter_ioctl.c
+--- ntp-4.2.6p5/lib/isc/unix/ifiter_ioctl.c	2010-12-25 09:40:34.000000000 +0000
++++ ntp-4.2.6p5.new/lib/isc/unix/ifiter_ioctl.c	2012-10-22 11:34:15.000000000 +0100
+@@ -159,7 +159,7 @@
+ 				break;
+ 		}
+ 		if (iter->bufsize >= IFCONF_BUFSIZE_MAX) {
+-			UNEXPECTED_ERROR(__FILE__, __LINE__,
++			UNEXPECTED_ERROR(__FILE__, __LINE__, "%s",
+ 					 isc_msgcat_get(isc_msgcat,
+ 							ISC_MSGSET_IFITERIOCTL,
+ 							ISC_MSG_BUFFERMAX,
+Only in ntp-4.2.6p5.new/lib/isc/unix: ifiter_ioctl.c~
+diff -ur ntp-4.2.6p5/ntpd/ntp_config.c ntp-4.2.6p5.new/ntpd/ntp_config.c
+--- ntp-4.2.6p5/ntpd/ntp_config.c	2012-10-22 11:43:38.000000000 +0100
++++ ntp-4.2.6p5.new/ntpd/ntp_config.c	2012-10-22 11:38:02.000000000 +0100
+@@ -2334,7 +2334,7 @@
+ 		if ((RES_MSSNTP & flags) && !warned_signd) {
+ 			warned_signd = 1;
+ 			fprintf(stderr, "%s\n", signd_warning);
+-			msyslog(LOG_WARNING, signd_warning);
++			msyslog(LOG_WARNING, "%s", signd_warning);
+ 		}
+ 	}
+ }
+Only in ntp-4.2.6p5.new/ntpd: ntp_config.c~
+diff -ur ntp-4.2.6p5/ntpd/ntp_control.c ntp-4.2.6p5.new/ntpd/ntp_control.c
+--- ntp-4.2.6p5/ntpd/ntp_control.c	2011-12-09 02:00:53.000000000 +0000
++++ ntp-4.2.6p5.new/ntpd/ntp_control.c	2012-10-22 11:37:11.000000000 +0100
+@@ -2962,7 +2962,7 @@
+ 			    " %s", str);
+ 		}
+ 		NLOG(NLOG_SYSEVENT)
+-		    msyslog(LOG_INFO, statstr);
++		    msyslog(LOG_INFO, "%s", statstr);
+ 	} else {
+ 
+ 		/*
+@@ -2994,7 +2994,7 @@
+ 			    " %s", str);
+ 		}
+ 		NLOG(NLOG_PEEREVENT)
+-		    msyslog(LOG_INFO, statstr);
++		    msyslog(LOG_INFO, "%s", statstr);
+ 	}
+ 	record_proto_stats(statstr);
+ #if DEBUG
+Only in ntp-4.2.6p5.new/ntpd: ntp_control.c~
+diff -ur ntp-4.2.6p5/ntpd/ntpd.c ntp-4.2.6p5.new/ntpd/ntpd.c
+--- ntp-4.2.6p5/ntpd/ntpd.c	2012-10-22 11:43:38.000000000 +0100
++++ ntp-4.2.6p5.new/ntpd/ntpd.c	2012-10-22 11:39:33.000000000 +0100
+@@ -1242,7 +1242,7 @@
+ 
+ 	msyslog(LOG_ERR, "%s:%d: fatal error:", file, line);
+ 	vsnprintf(errbuf, sizeof(errbuf), format, args);
+-	msyslog(LOG_ERR, errbuf);
++	msyslog(LOG_ERR, "%s", errbuf);
+ 	msyslog(LOG_ERR, "exiting (due to fatal error in library)");
+ 
+ 	abort();
+@@ -1264,7 +1264,7 @@
+ 
+ 	msyslog(LOG_ERR, "%s:%d: unexpected error:", file, line);
+ 	vsnprintf(errbuf, sizeof(errbuf), format, args);
+-	msyslog(LOG_ERR, errbuf);
++	msyslog(LOG_ERR, "%s", errbuf);
+ 
+ 	if (++unexpected_error_cnt == MAX_UNEXPECTED_ERRORS)
+ 	{
+Only in ntp-4.2.6p5.new/ntpd: ntpd.c~
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ntp.git/commitdiff/f59e8d316a542780e589dbc5a96888fd6b49d74e



More information about the pld-cvs-commit mailing list