[sblim-gather] Fix sblim-gather FTBFS if -Werror=format-security flag is used

vcrhonek vcrhonek at fedoraproject.org
Tue Feb 4 12:03:18 UTC 2014


commit f238a86c711e77e53bd169dc63b1fed4e784d98f
Author: Vitezslav Crhonek <vcrhonek at redhat.com>
Date:   Tue Feb 4 13:03:44 2014 +0100

    Fix sblim-gather FTBFS if -Werror=format-security flag is used

 sblim-gather-2.2.8-format-security.patch |   59 ++++++++++++++++++++++++++++++
 sblim-gather.spec                        |    9 ++++-
 2 files changed, 67 insertions(+), 1 deletions(-)
---
diff --git a/sblim-gather-2.2.8-format-security.patch b/sblim-gather-2.2.8-format-security.patch
new file mode 100644
index 0000000..6cec3e2
--- /dev/null
+++ b/sblim-gather-2.2.8-format-security.patch
@@ -0,0 +1,59 @@
+diff -up sblim-gather-2.2.8/comms/rcctest.c.orig sblim-gather-2.2.8/comms/rcctest.c
+--- sblim-gather-2.2.8/comms/rcctest.c.orig	2014-02-04 12:53:25.036297751 +0100
++++ sblim-gather-2.2.8/comms/rcctest.c	2014-02-04 12:53:43.738362560 +0100
+@@ -42,7 +42,7 @@ int main(int argc, char *argv[])
+   if (argc == 1) {
+     gethostname((char*)&hostname,sizeof(hostname));
+   } else {
+-    sprintf(hostname,argv[1]);
++    sprintf(hostname,"%s",argv[1]);
+   }
+   printf("Contacting %s\n",hostname);
+   if (rcc_init(hostname,&port) < 0 ) {
+diff -up sblim-gather-2.2.8/gatherctl.c.orig sblim-gather-2.2.8/gatherctl.c
+--- sblim-gather-2.2.8/gatherctl.c.orig	2013-02-12 02:08:25.000000000 +0100
++++ sblim-gather-2.2.8/gatherctl.c	2014-02-04 12:53:06.888233912 +0100
+@@ -146,5 +146,5 @@ static void printhelp()
+ {
+   int i;
+   for (i=0;commands[i];i++)
+-    printf(commands[i]);
++    printf("%s",commands[i]);
+ }
+diff -up sblim-gather-2.2.8/reposctl.c.orig sblim-gather-2.2.8/reposctl.c
+--- sblim-gather-2.2.8/reposctl.c.orig	2013-02-12 02:08:25.000000000 +0100
++++ sblim-gather-2.2.8/reposctl.c	2014-02-04 12:53:06.888233912 +0100
+@@ -271,7 +271,7 @@ static void printhelp()
+ {
+   int i;
+   for (i=0;commands[i];i++)
+-    printf(commands[i]);
++    printf("%s",commands[i]);
+ }
+ 
+ static void printvalue(ValueRequest *vr)
+@@ -317,7 +317,7 @@ static void printvalue(ValueRequest *vr)
+       printf("%f",*(double*)vr->vsValues[i].viValue);
+       break;
+     case MD_STRING:
+-      printf(vr->vsValues[i].viValue);
++      printf("%s",vr->vsValues[i].viValue);
+       break;
+     default:
+       printf("datatype %0x not supported",vr->vsDataType);
+diff -up sblim-gather-2.2.8/util/mlog.c.orig sblim-gather-2.2.8/util/mlog.c
+--- sblim-gather-2.2.8/util/mlog.c.orig	2013-02-12 02:08:25.000000000 +0100
++++ sblim-gather-2.2.8/util/mlog.c	2014-02-04 12:53:06.888233912 +0100
+@@ -52,10 +52,10 @@ void m_log(int priority, int errout, con
+   va_start(ap,fmt);
+   
+   vsnprintf(buf,4096,fmt,ap);
+-  syslog(priosysl,buf);
++  syslog(priosysl,"%s",buf);
+ 
+   if (errout) {
+-    fprintf(stderr,buf);
++    fprintf(stderr,"%s",buf);
+   }
+   va_end(ap);
+ }
diff --git a/sblim-gather.spec b/sblim-gather.spec
index 5e7130a..ecec73f 100644
--- a/sblim-gather.spec
+++ b/sblim-gather.spec
@@ -4,7 +4,7 @@
 
 Name:           sblim-gather
 Version:        2.2.8
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        SBLIM Gatherer
 
 Group:          Applications/System
@@ -31,6 +31,8 @@ Patch2:         sblim-gather-2.2.7-typos.patch
 
 # Patch3: removes version from docdir
 Patch3:         sblim-gather-2.2.8-docdir.patch
+# Patch4: fixes build fail if "-Werror=format-security" flag is used
+Patch4:         sblim-gather-2.2.8-format-security.patch
 
 Requires:       tog-pegasus >= %{tog_pegasus_version}
 Requires(post): systemd
@@ -88,6 +90,7 @@ tar xfvz %{SOURCE4}
 %patch1 -p1 -b .missing_providers
 %patch2 -p1 -b .typos
 %patch3 -p1 -b .docdir
+%patch4 -p1 -b .format-security
 
 %build
 %ifarch s390 s390x ppc ppc64
@@ -240,6 +243,10 @@ fi
 %postun provider -p /sbin/ldconfig
 
 %changelog
+* Tue Feb 04 2014 Vitezslav Crhonek <vcrhonek at redhat.com> - 2.2.8-5
+- Fix sblim-gather FTBFS if "-Werror=format-security" flag is used
+  Resolves: #1037318
+
 * Wed Aug 28 2013 Vitezslav Crhonek <vcrhonek at redhat.com> -  2.2.8-4
 - Fix for unversioned docdir change
   Resolves: #994086


More information about the scm-commits mailing list