Bug 1037232

Summary: openser FTBFS if "-Werror=format-security" flag is used
Product: [Fedora] Fedora Reporter: Dhiru Kholia <dkholia>
Component: openserAssignee: Orphan Owner <extras-orphan>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: bressers, dhiru, extras-orphan, ondrejj, ppisar
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-18 09:46:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1038083    

Description Dhiru Kholia 2013-12-03 03:26:40 UTC
Description of problem
----------------------

openser fails to build if "-Werror=format-security" flag is used.

...

action.c:361:4: error: format not a string literal and no format arguments [-Werror=format-security]

...

We are working on a proposal to enable "-Werror=format-security" for all
packages. Once this flag is enabled, GCC will refuse to compile code that could
be vulnerable to a string format security flaw. For more details, please see
https://fedorahosted.org/fesco/ticket/1185 page.

To understand why it is important to fix this, please see
https://fedoraproject.org/wiki/Format-Security-FAQ page.

How to fix this
---------------

The fix for these errors is quite simple. It's a matter of changing a
line like,

   printf(foo);

to read,

   printf("%s", foo);

That's it.

Please fix this issue in rawhide with a patch (which you should submit
to upstream to merge moving forward). Please do a new build with the
fix in rawhide. Other releases do not need to be directly fixed, but
there should be no harm in pushing out this fix/patch with other needed
changes to those branches.

In the event you don't fix this bug before the next mass rebuild,
provenpackagers may step in and update your package(s) to fix this
issue.

How reproducible
----------------

Build openser-1.3.4-31.fc20.src.rpm with "-Werror=format-security" flag to reproduce the problem.

To make this process easier, you can use a modified "redhat-rpm-config" package
from http://people.fedoraproject.org/~halfie/artifacts/redhat-rpm-config/ URL.

$ sha256sum redhat-rpm-config-9.1.0-56.fc20.*
faad7594b2080fe76497d0ce50808c905a93dd7b41c1defdde5ca57e3833d3d2  redhat-rpm-config-9.1.0-56.fc20.noarch.rpm
5aa9357174305c7285ffdbc92d7ffe1c07a8a95d5459b930461308f5aad75413  redhat-rpm-config-9.1.0-56.fc20.src.rpm

Comment 1 Jan ONDREJ 2013-12-03 06:28:16 UTC
openser has been orphaned for Fedora/EPEL and has no active development upstream. It's replacement is opensips (available in Fedora/EPEL).
Closing as WONTFIX.

Comment 2 Petr Pisar 2014-01-29 08:21:12 UTC
openser-1.3.4-31.fc21 fails to build in F21 due the -Werror=format-security:

Compiling timer.c
gcc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -g -Wca
st-align    -DNAME='"openser"' -DVERSION='"1.3.4-tls"' -DARCH='"x86_64"' -DOS='"linux"' -DCOMPILER='"gcc 4.8.2"' -D__CPU_x86_64 -D__OS_linux -D__SMP_yes -DCFG_DIR='"/etc/openser/"' -DP
KG_MALLOC -DSHM_MEM  -DSHM_MMAP -DUSE_IPV6 -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DSTATISTICS -DCHANGEABLE_DEBUG_LEVEL -DF_MALLOC  -DUSE_TLS -DFAST_LOCK -DADAPTIVE_WA
IT -DADAPTIVE_WAIT_LOOPS=1024  -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_EPOLL -DHA
VE_SIGIO_RT -DHAVE_SELECT  -c timer.c -o timer.o
In file included from parser/msg_parser.h:46:0,
                 from action.h:27,
                 from action.c:44:
parser/../ip_addr.h: In function 'matchnet':
parser/../ip_addr.h:184:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
  int ret;
      ^
In file included from mem/../lock_ops.h:68:0,
                 from mem/shm_mem.h:68,
                 from ut.h:52,
                 from action.c:54:
mem/../fastlock.h: In function 'release_lock':
mem/../fastlock.h:199:7: warning: variable 'val' set but not used [-Wunused-but-set-variable]
  char val;
       ^
action.c: In function 'do_action':
action.c:361:4: error: format not a string literal and no format arguments [-Werror=format-security]
    LOG(a->elem[0].u.number, a->elem[1].u.string);
    ^
action.c:361:4: error: format not a string literal and no format arguments [-Werror=format-security]
action.c:361:4: error: format not a string literal and no format arguments [-Werror=format-security]
action.c:361:4: error: format not a string literal and no format arguments [-Werror=format-security]
action.c:361:4: error: format not a string literal and no format arguments [-Werror=format-security]
action.c:361:4: error: format not a string literal and no format arguments [-Werror=format-security]
action.c:361:4: error: format not a string literal and no format arguments [-Werror=format-security]
cc1: some warnings being treated as errors
make: *** [action.o] Error 1


If you cannot fix it, retire this package instead just an orphaning.

Comment 3 Dhiru Kholia 2014-01-29 09:26:51 UTC
Hi Jan,

Have you seen http://www.kamailio.org/ page?

Comment 4 Petr Pisar 2014-03-18 09:46:13 UTC
This package has been retired in F21:

Renamed to Kamailio. Fedora users should switch to OpenSIPS.