[packages/ldapdiff] fix -Werror=format-security errors

glen glen at pld-linux.org
Tue Jul 16 13:23:15 CEST 2013


commit 230f0193d1c39e7dc614be1c1a67c315d1288f7f
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue Jul 16 14:19:23 2013 +0300

    fix -Werror=format-security errors

 format-security.patch | 15 +++++++++++++++
 ldapdiff.spec         |  8 +++++---
 2 files changed, 20 insertions(+), 3 deletions(-)
---
diff --git a/ldapdiff.spec b/ldapdiff.spec
index 196745f..e53d85a 100644
--- a/ldapdiff.spec
+++ b/ldapdiff.spec
@@ -6,12 +6,11 @@ License:	GPL v3+
 Group:		Applications/System
 Source0:	https://launchpad.net/ldapdiff/trunk/%{version}/+download/%{name}-%{version}_src.tgz
 # Source0-md5:	5da4ec7860cad79804d5af3958af7a2a
+Patch0:		format-security.patch
 URL:		http://launchpad.net/ldapdiff
 BuildRequires:	openldap-devel
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define	rpmcflags -Wno-error=format-security
-
 %description
 ldapdiff combines "diff" and "patch" functionality in one application.
 The difference is, that ldapdiff is not designed for use on flat ascii
@@ -20,7 +19,10 @@ files.
 
 %prep
 %setup -q
-%{__make} clean
+%patch0 -p1
+
+# dirty tarball. cleanup
+rm ldapdiff *.o
 
 %build
 %configure
diff --git a/format-security.patch b/format-security.patch
new file mode 100644
index 0000000..7f01f18
--- /dev/null
+++ b/format-security.patch
@@ -0,0 +1,15 @@
+ldaplog.c: In function 'ldiflogsyslog':
+ldaplog.c:72:2: error: format not a string literal and no format arguments [-Werror=format-security]
+  syslog(level,msg);
+  ^
+--- ldapdiff-1.4.1/ldaplog.c~	2008-10-23 22:10:05.000000000 +0300
++++ ldapdiff-1.4.1/ldaplog.c	2013-07-16 14:16:35.775472728 +0300
+@@ -69,7 +69,7 @@
+   case LOG2 : level = LOG_DEBUG;
+        break;
+  }
+- syslog(level,msg);
++ syslog(level,"%s",msg);
+  closelog();
+ }
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ldapdiff.git/commitdiff/2deedf831f11e318263724bbf61426548f41884c



More information about the pld-cvs-commit mailing list