[libdb4] Adjusted for -Werror=format-security gcc flag.
Jan Staněk
jstanek at fedoraproject.org
Tue Dec 3 08:53:05 UTC 2013
commit 6122dbabea9e54c33f2bb1abf22b0ac635dc5b3e
Author: Jan Staněk <jstanek at redhat.com>
Date: Tue Dec 3 09:53:00 2013 +0100
Adjusted for -Werror=format-security gcc flag.
db-4.8.30-format-security.patch | 57 +++++++++++++++++++++++++++++++++++++++
libdb4.spec | 7 ++++-
2 files changed, 63 insertions(+), 1 deletions(-)
---
diff --git a/db-4.8.30-format-security.patch b/db-4.8.30-format-security.patch
new file mode 100644
index 0000000..ad8b7c2
--- /dev/null
+++ b/db-4.8.30-format-security.patch
@@ -0,0 +1,57 @@
+# Adjustments necessary in order for gcc with -Werror=format-security to compile libdb4
+
+diff -up db-4.8.30/repmgr/repmgr_net.c.broken db-4.8.30/repmgr/repmgr_net.c
+--- db-4.8.30/repmgr/repmgr_net.c.broken 2013-12-03 09:22:53.411671609 +0100
++++ db-4.8.30/repmgr/repmgr_net.c 2013-12-03 09:23:13.020780748 +0100
+@@ -1331,7 +1331,7 @@ __repmgr_listen(env)
+ }
+
+ ret = net_errno;
+- __db_err(env, ret, why);
++ __db_err(env, ret, "%s", why);
+ clean: if (s != INVALID_SOCKET)
+ (void)closesocket(s);
+ return (ret);
+
+diff -up db-4.8.30/crypto/aes_method.c.broken db-4.8.30/crypto/aes_method.c
+--- db-4.8.30/crypto/aes_method.c.broken 2013-12-03 09:31:46.131623201 +0100
++++ db-4.8.30/crypto/aes_method.c 2013-12-03 09:32:12.875772465 +0100
+@@ -267,6 +267,6 @@ __aes_err(env, err)
+ errstr = "AES error unrecognized";
+ break;
+ }
+- __db_errx(env, errstr);
++ __db_errx(env, "%s", errstr);
+ return;
+ }
+
+diff -up db-4.8.30/txn/txn.c.broken db-4.8.30/txn/txn.c
+--- db-4.8.30/txn/txn.c.broken 2013-12-03 09:35:35.259668694 +0100
++++ db-4.8.30/txn/txn.c 2013-12-03 09:36:34.155889373 +0100
+@@ -113,7 +113,7 @@ __txn_begin_pp(dbenv, parent, txnpp, fla
+ return (ret);
+ if (parent != NULL && !F_ISSET(parent, TXN_SNAPSHOT) &&
+ LF_ISSET(DB_TXN_SNAPSHOT)) {
+- __db_errx(env,
++ __db_errx(env, "%s",
+ "Child transaction snapshot setting must match parent");
+ return (EINVAL);
+ }
+@@ -168,7 +168,7 @@ __txn_begin(env, ip, parent, txnpp, flag
+
+ *txnpp = NULL;
+ if ((ret = __os_calloc(env, 1, sizeof(DB_TXN), &txn)) != 0) {
+- __db_errx(env, TxnAlloc);
++ __db_errx(env, "%s", TxnAlloc);
+ return (ret);
+ }
+
+@@ -315,7 +315,7 @@ __txn_compensate_begin(env, txnpp)
+ int ret;
+
+ if ((ret = __os_calloc(env, 1, sizeof(DB_TXN), &txn)) != 0) {
+- __db_errx(env, TxnAlloc);
++ __db_errx(env, "%s", TxnAlloc);
+ return (ret);
+ }
+
diff --git a/libdb4.spec b/libdb4.spec
index 38b27f5..c535afb 100644
--- a/libdb4.spec
+++ b/libdb4.spec
@@ -4,7 +4,7 @@
Summary: The Berkeley DB database library (version 4) for C
Name: libdb4
Version: 4.8.30
-Release: 12%{?dist}
+Release: 13%{?dist}
URL: http://www.oracle.com/database/berkeley-db/
License: Sleepycat and BSD
Group: System Environment/Libraries
@@ -21,6 +21,7 @@ Patch20: db-1.85-errno.patch
Patch21: db-4.6.21-1.85-compat.patch
Patch22: db-4.5.20-jni-include-dir.patch
Patch23: db-4.8.30-quotas-segfault.patch
+Patch24: db-4.8.30-format-security.patch
Conflicts: filesystem < 3
Obsoletes: db4 < 5.0.0
@@ -165,6 +166,7 @@ popd
%patch21 -p1 -b .185compat
%patch22 -p1 -b .4.5.20.jni
%patch23 -p1 -b .quotas-segfault
+%patch24 -p1 -b .format-security
# Fix HREF references in the docs which would otherwise break when we split the docs up into subpackages.
set +x
@@ -388,6 +390,9 @@ chrpath -d ${RPM_BUILD_ROOT}%{_libdir}/*.so ${RPM_BUILD_ROOT}%{_bindir}/*
%{_libdir}/%{name}/libdb_java.so
%changelog
+* Tue Dec 03 2013 Jan Stanek <jstanek at redhat.com> - 4.8.30-13
+- Adjusted for -Werror=format-security gcc flag.
+
* Fri Nov 08 2013 Honza Horak <hhorak at redhat.com> - 4.8.30-12
- Updated the config files for aarch64 architecture (#1028112)
More information about the scm-commits
mailing list