Bug 1412250

Summary: slapi_get_cacertfile() function declaration isn’t a prototype
Product: [Fedora] Fedora Reporter: Christian Heimes <cheimes>
Component: 389-ds-baseAssignee: Rich Megginson <rmeggins>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: cheimes, edewata, mhonek, mreynolds, nhosoi, nkinder, rmeggins
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.6.5-1.fc26 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-04 14:54:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Christian Heimes 2017-01-11 15:42:47 UTC
Description of problem:
/usr/include/dirsrv/slapi-plugin.h contains an invalid function prototype

Version-Release number of selected component (if applicable):
389-ds-base-devel-1.3.5.15-1.fc25.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Compile any component that includes slapi-plugin.h, e.g. FreeIPA

Actual results:
make[4]: Entering directory '/usr/src/freeipa/daemons/ipa-slapi-plugins/ipa-lockout'
/bin/sh ../../../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../..  -I. -I./../common -I/usr/include/dirsrv -DPREFIX=\""/usr/local"\" -DBINDIR=\""/usr/local/bin"\" -DLIBDIR=\""/usr/local/lib"\" -DLIBEXECDIR=\""/usr/local/libexec"\" -DDATADIR=\""/usr/local/share"\"    -I/usr/include/nspr4 -I/usr/include/nss3 -I/usr/include/nspr4  -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Werror-implicit-function-declaration  -g -O2 -MT ipa_lockout.lo -MD -MP -MF .deps/ipa_lockout.Tpo -c -o ipa_lockout.lo ipa_lockout.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../.. -I. -I./../common -I/usr/include/dirsrv -DPREFIX=\"/usr/local\" -DBINDIR=\"/usr/local/bin\" -DLIBDIR=\"/usr/local/lib\" -DLIBEXECDIR=\"/usr/local/libexec\" -DDATADIR=\"/usr/local/share\" -I/usr/include/nspr4 -I/usr/include/nss3 -I/usr/include/nspr4 -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Werror-implicit-function-declaration -g -O2 -MT ipa_lockout.lo -MD -MP -MF .deps/ipa_lockout.Tpo -c ipa_lockout.c  -fPIC -DPIC -o .libs/ipa_lockout.o
In file included from ipa_lockout.c:50:0:
/usr/include/dirsrv/slapi-plugin.h:6292:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 const char * slapi_get_cacertfile();
 ^~~~~


Expected results:
No warning

Additional info:
The correct function prototype is
const char * slapi_get_cacertfile( void );

Comment 1 Rich Megginson 2017-01-11 16:13:39 UTC
I think this is not an openldap issue since you're using /usr/include/dirsrv/slapi-plugin.h which is a 389-ds-base-devel file.

Comment 2 Christian Heimes 2017-01-11 16:21:02 UTC
Ah, you are right. I selected the wrong component. Thanks Rich!

Comment 3 Noriko Hosoi 2017-01-11 17:11:24 UTC
Thanks, Christian!

The issue has been addressed and fixed in the master branch with this patch:

commit 5b0c9c0a90b73f0b1a200d9ccb1209ccc5dcd7e3
Author: Lukas Slebodnik <lslebodn>
Date:   Fri Sep 2 15:10:44 2016 +0000

    Ticket 48979 - Allow to compile 389ds with warning Wstrict-prototypes

The change is going to be in 389-ds-base-1.3.6 release.  So far, we have no plan to backport the patch to 1.3.5.  Is it ok with you or too late?

> $ egrep -B 1 slapi_get_cacertfile *.[ch]
> [...]
> slapi-plugin.h:const char * slapi_get_cacertfile(void);
> --
> ssl.c-const char *
> ssl.c:slapi_get_cacertfile()

Comment 4 Christian Heimes 2017-01-12 15:40:36 UTC
It's just a warning and it's not going to cause any trouble soon. I can wait for 1.3.6.