[sharutils] Pass compilation with -Werror=format-security

Petr Pisar ppisar at fedoraproject.org
Wed Dec 4 13:43:16 UTC 2013


commit 9c7526829041fd0157f852fd22baa0fc7b6420c6
Author: Petr Písař <ppisar at redhat.com>
Date:   Wed Dec 4 14:42:17 2013 +0100

    Pass compilation with -Werror=format-security

 ...s-compilation-with-Werror-format-security.patch |   30 ++++++++++++++++++++
 sharutils.spec                                     |    8 ++++-
 2 files changed, 37 insertions(+), 1 deletions(-)
---
diff --git a/sharutils-4.14-Pass-compilation-with-Werror-format-security.patch b/sharutils-4.14-Pass-compilation-with-Werror-format-security.patch
new file mode 100644
index 0000000..588b7f9
--- /dev/null
+++ b/sharutils-4.14-Pass-compilation-with-Werror-format-security.patch
@@ -0,0 +1,30 @@
+From ec0820718ccb224bafcddd82a281953b73a9e0b6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Wed, 4 Dec 2013 14:35:44 +0100
+Subject: [PATCH] Pass compilation with -Werror=format-security
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+<https://bugzilla.redhat.com/show_bug.cgi?id=1037323>
+
+Signed-off-by: Petr Písař <ppisar at redhat.com>
+---
+ src/shar-opts.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/shar-opts.h b/src/shar-opts.h
+index 2eed57c..70c2792 100644
+--- a/src/shar-opts.h
++++ b/src/shar-opts.h
+@@ -373,6 +373,7 @@ extern tOptions sharOptions;
+ #     include <libintl.h>
+ #   endif
+ 
++static inline char* aoGetsText(char const* pz) __attribute__ ((format_arg(1)));
+ static inline char* aoGetsText(char const* pz) {
+     if (pz == NULL) return NULL;
+     return (char*)gettext(pz);
+-- 
+1.8.3.1
+
diff --git a/sharutils.spec b/sharutils.spec
index 789ddd8..39a54a7 100644
--- a/sharutils.spec
+++ b/sharutils.spec
@@ -1,7 +1,7 @@
 Summary:    The GNU shar utilities for packaging and unpackaging shell archives
 Name:       sharutils
 Version:    4.14
-Release:    1%{?dist}
+Release:    2%{?dist}
 # The main code:                GPLv3+
 # lib (gnulib):                 LGPLv3+
 # lib/sys_socket.in.h:          LGPLv2+
@@ -11,6 +11,8 @@ Release:    1%{?dist}
 License:    GPLv3+ and LGPLv3+ and (LGPLv3+ or BSD) and LGPLv2+ and Public Domain and GFDL
 Group:      Applications/Archiving
 Source:     ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz
+# Pass compilation with -Werror=format-security, bug #1037323
+Patch0:     %{name}-4.14-Pass-compilation-with-Werror-format-security.patch
 URL:        http://www.gnu.org/software/%{name}/
 BuildRequires:      gettext
 Requires(post):     info
@@ -32,6 +34,7 @@ the shar files.
 
 %prep
 %setup -q
+%patch0 -p1 -b .format
 
 # convert TODO, THANKS to UTF-8
 for i in TODO THANKS; do
@@ -68,6 +71,9 @@ fi
 %{_mandir}/man5/*
 
 %changelog
+* Wed Dec 04 2013 Petr Pisar <ppisar at redhat.com> - 4.14-2
+- Pass compilation with -Werror=format-security (bug #1037323)
+
 * Mon Oct 21 2013 Petr Pisar <ppisar at redhat.com> - 4.14-1
 - 4.14 bump
 


More information about the scm-commits mailing list