Missing include in be-secure-openssl.c? - Mailing list pgsql-hackers

From Tom Lane
Subject Missing include in be-secure-openssl.c?
Date
Msg-id 1051867.1635720347@sss.pgh.pa.us
Whole thread Raw
Responses Re: Missing include in be-secure-openssl.c?
List pgsql-hackers
hamerkop has been failing recently [1] with

  c:\\build-farm-local\\buildroot\\head\\pgsql.build\\src\\backend\\libpq\\be-secure-openssl.c(67): error C2143:
\215\\\225\266\203G\203\211\201[:')' \202\252 '(' \202\314\221O\202\311\202\240\202\350\202\334\202\271\202\361\201B
[c:\\build-farm-local\\buildroot\\HEAD\\pgsql.build\\postgres.vcxproj]
  c:\\build-farm-local\\buildroot\\head\\pgsql.build\\src\\backend\\libpq\\be-secure-openssl.c(67): error C2091:
\212\326\220\224\202\315\212\326\220\224\202\360\225\324\202\271\202\334\202\271\202\361\201B
[c:\\build-farm-local\\buildroot\\HEAD\\pgsql.build\\postgres.vcxproj]
  c:\\build-farm-local\\buildroot\\head\\pgsql.build\\src\\backend\\libpq\\be-secure-openssl.c(67): error C2059:
\215\\\225\266\203G\203\211\201[:')' [c:\\build-farm-local\\buildroot\\HEAD\\pgsql.build\\postgres.vcxproj] 
  c:\\build-farm-local\\buildroot\\head\\pgsql.build\\src\\backend\\libpq\\be-secure-openssl.c(67): error C2143:
\215\\\225\266\203G\203\211\201[:')' \202\252 '\222\350\220\224'
\202\314\221O\202\311\202\240\202\350\202\334\202\271\202\361\201B
[c:\\build-farm-local\\buildroot\\HEAD\\pgsql.build\\postgres.vcxproj]
  c:\\build-farm-local\\buildroot\\head\\pgsql.build\\src\\backend\\libpq\\be-secure-openssl.c(67): error C2143:
\215\\\225\266\203G\203\211\201[:'{' \202\252 '\222\350\220\224'
\202\314\221O\202\311\202\240\202\350\202\334\202\271\202\361\201B
[c:\\build-farm-local\\buildroot\\HEAD\\pgsql.build\\postgres.vcxproj]
  c:\\build-farm-local\\buildroot\\head\\pgsql.build\\src\\backend\\libpq\\be-secure-openssl.c(67): error C2059:
\215\\\225\266\203G\203\211\201[:'\222\350\220\224'
[c:\\build-farm-local\\buildroot\\HEAD\\pgsql.build\\postgres.vcxproj]
  c:\\build-farm-local\\buildroot\\head\\pgsql.build\\src\\backend\\libpq\\be-secure-openssl.c(571): error C2065:
'x509name':\222\350\213`\202\263\202\352\202\304\202\242\202\310\202\242\216\257\225\312\216q\202\305\202\267\201B
[c:\\build-farm-local\\buildroot\\HEAD\\pgsql.build\\postgres.vcxproj]
  c:\\build-farm-local\\buildroot\\head\\pgsql.build\\src\\backend\\libpq\\be-secure-openssl.c(571): error C2296: '*':
\226\263\214\370\202\305\202\267\201B\215\266\203I\203y\203\211\203\223\203h\202\311\202\315\214^'LPCSTR'
\202\252\216w\222\350\202\263\202\352\202\304\202\242\202\334\202\267\201B
[c:\\build-farm-local\\buildroot\\HEAD\\pgsql.build\\postgres.vcxproj]
  c:\\build-farm-local\\buildroot\\head\\pgsql.build\\src\\backend\\libpq\\be-secure-openssl.c(576): error C2065:
'x509name':\222\350\213`\202\263\202\352\202\304\202\242\202\310\202\242\216\257\225\312\216q\202\305\202\267\201B
[c:\\build-farm-local\\buildroot\\HEAD\\pgsql.build\\postgres.vcxproj]
  c:\\build-farm-local\\buildroot\\head\\pgsql.build\\src\\backend\\libpq\\be-secure-openssl.c(582): error C2065:
'x509name':\222\350\213`\202\263\202\352\202\304\202\242\202\310\202\242\216\257\225\312\216q\202\305\202\267\201B
[c:\\build-farm-local\\buildroot\\HEAD\\pgsql.build\\postgres.vcxproj]
  c:\\build-farm-local\\buildroot\\head\\pgsql.build\\src\\backend\\libpq\\be-secure-openssl.c(623): error C2065:
'x509name':\222\350\213`\202\263\202\352\202\304\202\242\202\310\202\242\216\257\225\312\216q\202\305\202\267\201B
[c:\\build-farm-local\\buildroot\\HEAD\\pgsql.build\\postgres.vcxproj]
  c:\\build-farm-local\\buildroot\\head\\pgsql.build\\src\\backend\\libpq\\be-secure-openssl.c(1377): error C2143:
\215\\\225\266\203G\203\211\201[:')' \202\252 '(' \202\314\221O\202\311\202\240\202\350\202\334\202\271\202\361\201B
[c:\\build-farm-local\\buildroot\\HEAD\\pgsql.build\\postgres.vcxproj]
  c:\\build-farm-local\\buildroot\\head\\pgsql.build\\src\\backend\\libpq\\be-secure-openssl.c(1377): error C2091:
\212\326\220\224\202\315\212\326\220\224\202\360\225\324\202\271\202\334\202\271\202\361\201B
[c:\\build-farm-local\\buildroot\\HEAD\\pgsql.build\\postgres.vcxproj]
  c:\\build-farm-local\\buildroot\\head\\pgsql.build\\src\\backend\\libpq\\be-secure-openssl.c(1377): error C2059:
\215\\\225\266\203G\203\211\201[:')' [c:\\build-farm-local\\buildroot\\HEAD\\pgsql.build\\postgres.vcxproj] 
  c:\\build-farm-local\\buildroot\\head\\pgsql.build\\src\\backend\\libpq\\be-secure-openssl.c(1377): error C2143:
\215\\\225\266\203G\203\211\201[:')' \202\252 '\222\350\220\224'
\202\314\221O\202\311\202\240\202\350\202\334\202\271\202\361\201B
[c:\\build-farm-local\\buildroot\\HEAD\\pgsql.build\\postgres.vcxproj]
  c:\\build-farm-local\\buildroot\\head\\pgsql.build\\src\\backend\\libpq\\be-secure-openssl.c(1377): error C2143:
\215\\\225\266\203G\203\211\201[:'{' \202\252 '\222\350\220\224'
\202\314\221O\202\311\202\240\202\350\202\334\202\271\202\361\201B
[c:\\build-farm-local\\buildroot\\HEAD\\pgsql.build\\postgres.vcxproj]
  c:\\build-farm-local\\buildroot\\head\\pgsql.build\\src\\backend\\libpq\\be-secure-openssl.c(1377): error C2059:
\215\\\225\266\203G\203\211\201[:'\222\350\220\224'
[c:\\build-farm-local\\buildroot\\HEAD\\pgsql.build\\postgres.vcxproj]

While I can't actually read these error messages, judging by the line
numbers and the ASCII fragments, it's spitting up on uses of the typedef
X509_NAME.  There are also nearby warnings that look like some of the
associated functions aren't declared.

I observe that the OpenSSL docs say you are supposed to
#include <openssl/x509.h>
when using these functions.  We are including that header in
some other modules, but not here.  I speculate that we've gotten
away with that so far because of indirect inclusions; but hamerkop
must be running an OpenSSL version that has rearranged the headers
enough that that doesn't work anymore.  That machine was offline
for awhile right before it started to fail, so it seems plausible
that it was rebuilt with some pretty bleeding-edge OpenSSL version.

Anyway, I propose adding that #include.

            regards, tom lane

[1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=hamerkop&dt=2021-10-29%2008%3A12%3A40



pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: row filtering for logical replication
Next
From: Andres Freund
Date:
Subject: Re: [RFC] building postgres with meson -v