Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Unable to build: 'SECURE_SERVER_CERTIFICATE' undeclared in auxserver.c #95

Closed
happz opened this Issue May 24, 2016 · 5 comments

Comments

Projects
None yet
3 participants
Contributor

happz commented May 24, 2016

gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches   -fPIC -fno-strict-aliasing -D_GNU_SOURCE -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2  -Wall -O2 -g -DPCP_DEBUG -DPCP_VERSION=\"3.11.3\" -I./src/include -I./src/include/pcp -fPIC -fno-strict-aliasing -D_GNU_SOURCE -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2  -Wall -O2 -g -DPCP_DEBUG -DPCP_VERSION=\"3.11.3\" -I../src/include -I../src/include/pcp -fPIC -fno-strict-aliasing -D_GNU_SOURCE -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2  -Wall -O2 -g -DPCP_DEBUG -DPCP_VERSION=\"3.11.3\" -I../../src/include -I../../src/include/pcp -fPIC -fno-strict-aliasing -D_GNU_SOURCE -fstack-protector-all -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DPCP_INTERNAL '-DEXEC_SUFFIX=""' '-DDSO_SUFFIX="so"' -D_REENTRANT   -Wall -O2 -g -DPCP_DEBUG -DPCP_VERSION=\"3.11.3\" -I../../../src/include -I../../../src/include/pcp   -c -o auxserver.o auxserver.c

auxserver.c: In function '__pmSecureServerSetup':
auxserver.c:889:57: error: 'SECURE_SERVER_CERTIFICATE' undeclared (first use in this function)
     return __pmSecureServerCertificateSetup(db, passwd, SECURE_SERVER_CERTIFICATE);
                                                         ^
auxserver.c:889:57: note: each undeclared identifier is reported only once for each function it appears in
auxserver.c:890:1: warning: control reaches end of non-void function [-Wreturn-type]

I've found the only definition of SECURE_SERVER_CERTIFICATE, in src/libpcp/src/internal.h, defined only when both SOCKET_INTERNAL and HAVE_SECURE_SOCKETS are defined, however the line 889 in auxserver.c is guarded by #if !defined(HAVE_SECURE_SOCKETS) - therefore, when !defined(HAVE_SECURE_SOCKETS) is satisfied, there's no definition of SECURE_SERVER_CERTIFICATE because ifdef HAVE_SECURE_SOCKETS in internal.h cannot be fulfilled.

Commit 07519d0 changes the source of __pmSecureServerSetup, adding the SECURE_SERVER_CERTIFICATE usage.

Contributor

happz commented May 24, 2016

To make this complete, reproduced on Fedora 23, simple git clone, installing build dependencies, and ./Makepkgs --verbose ended with the aforementioned error.

Contributor

natoscott commented May 24, 2016

@happz thanks - yep, easily reproduced everywhere with "./Makepkgs --with-secure-sockets=no" ... fix will follow shortly.

Contributor

kmcdonell commented May 24, 2016

Same failure just started on FreeBSD 10.2 in my QA farm.
Looks like a snarfoo between impl.h, internal.h and auxserver.c for the __pmSecureServerSetup() prototype and the associated SECURE_SERVER_CERTIFICATE macro ... there are 3 different conditionals in play here and they should all be the same.
git blame suggests ... Matins and Nathan have coverage around these areas.

@natoscott natoscott closed this in b0a14ee May 25, 2016

Contributor

kmcdonell commented May 25, 2016

Nathan, confirming your latest fixes resolve the build problem for me on FreeBSD 10.2 (vm06).
Ta.

Contributor

happz commented May 25, 2016

I can also confirm successful builds on my Fedora 23 box with the fix applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment