[packages/ippl] Fix build with -Werror=format-security

megabajt megabajt at pld-linux.org
Wed Feb 6 11:51:42 CET 2013


commit 30d307a4bad5d416221431aad1fe97dd649037a6
Author: Marcin Banasiak <marcin.banasiak at gmail.com>
Date:   Wed Feb 6 11:51:25 2013 +0100

    Fix build with -Werror=format-security

 ippl-format-security.patch | 21 +++++++++++++++++++++
 ippl.spec                  |  2 ++
 2 files changed, 23 insertions(+)
---
diff --git a/ippl.spec b/ippl.spec
index dbd323d..31008bd 100644
--- a/ippl.spec
+++ b/ippl.spec
@@ -12,6 +12,7 @@ Source0:	http://pltplp.net/ippl/archive/dev/%{name}-%{version}.tar.gz
 Source1:	%{name}d.init
 Source2:	%{name}.logrotate
 Source3:	%{name}.conf
+Patch0:		%{name}-format-security.patch
 URL:		http://pltplp.net/ippl/
 BuildRequires:	autoconf
 BuildRequires:	automake
@@ -41,6 +42,7 @@ O IPPL registra pacotes IP enviados à um sistema.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %{__aclocal}
diff --git a/ippl-format-security.patch b/ippl-format-security.patch
new file mode 100644
index 0000000..9569166
--- /dev/null
+++ b/ippl-format-security.patch
@@ -0,0 +1,21 @@
+diff -urN ippl-1.99.5/source/log.c ippl-1.99.5.new/source/log.c
+--- ippl-1.99.5/source/log.c	2000-01-29 19:03:21.000000000 +0100
++++ ippl-1.99.5.new/source/log.c	2013-02-06 11:43:38.220086091 +0100
+@@ -55,7 +55,7 @@
+   vsnprintf(buffer, BUFFER_SIZE, format, msg);
+   va_end(msg);
+ 
+-  syslog(LOGLEVEL, buffer);
++  syslog(LOGLEVEL, "%s", buffer);
+ }
+ 
+ /* Dummy close of a logging device */
+@@ -83,7 +83,7 @@
+ void logMessage(int fd, time_t *timestamp, char *msg) {
+   char date[27];
+ 
+-  snprintf(date, 27, asctime(localtime(timestamp)));
++  snprintf(date, 27, "%s", asctime(localtime(timestamp)));
+   write(fd, date+4, strlen(date)-10);
+   write(fd, " ", 1);
+   write(fd, msg, strlen(msg));
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ippl.git/commitdiff/30d307a4bad5d416221431aad1fe97dd649037a6



More information about the pld-cvs-commit mailing list