Skip to content

Commit f4d272b

Browse files
authored
Make pg_waldump read encrypted WAL (#20)
This commit: - Adds build infrastructure for the frontend tools to compile with pg_tde. pg_tde dependencies will be built only if build flag `precone_ext` is on. It also makes `openssl` and `curl` required if `precone_ext` is on. - Makes pg_waldump work with the TDE encrypted WAL. If user set `-k` flag it will try to init tde keys etc and decode encrypted pages. If no `-k` options set, it behaves like community version - won't try to ini tde and won't be able to decrypt WAL. - Adds tap tests for encrypted WAL to pg_waldump. - Fixes Percona versioning in ./configure For PG-1003, PG-1005 Depends percona/pg_tde#362
1 parent 5ad99f7 commit f4d272b

File tree

13 files changed

+670
-83
lines changed

13 files changed

+670
-83
lines changed

.github/workflows/postgresql-current-make-debug.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ jobs:
3939
cd contrib/pg_tde
4040
git checkout main
4141
git pull
42-
./configure
4342
working-directory: src
4443

4544
- name: Build postgres

configure

Lines changed: 150 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for PostgreSQL 17.2.
3+
# Generated by GNU Autoconf 2.69 for PostgreSQL 17.2.1.
44
#
55
# Report bugs to <[email protected]>.
66
#
@@ -582,8 +582,8 @@ MAKEFLAGS=
582582
# Identity of this package.
583583
PACKAGE_NAME='PostgreSQL'
584584
PACKAGE_TARNAME='postgresql'
585-
PACKAGE_VERSION='17.2'
586-
PACKAGE_STRING='PostgreSQL 17.2'
585+
PACKAGE_VERSION='17.2.1'
586+
PACKAGE_STRING='PostgreSQL 17.2.1'
587587
PACKAGE_BUGREPORT='[email protected]'
588588
PACKAGE_URL='https://www.postgresql.org/'
589589

@@ -658,6 +658,7 @@ UUID_LIBS
658658
LDAP_LIBS_BE
659659
LDAP_LIBS_FE
660660
with_ssl
661+
enable_percona_ext
661662
PTHREAD_CFLAGS
662663
PTHREAD_LIBS
663664
PTHREAD_CC
@@ -762,7 +763,6 @@ CPPFLAGS
762763
LDFLAGS
763764
CFLAGS
764765
CC
765-
enable_percona_ext
766766
enable_injection_points
767767
enable_tap_tests
768768
enable_dtrace
@@ -845,7 +845,6 @@ enable_coverage
845845
enable_dtrace
846846
enable_tap_tests
847847
enable_injection_points
848-
enable_percona_ext
849848
with_blocksize
850849
with_segsize
851850
with_segsize_blocks
@@ -861,6 +860,7 @@ with_python
861860
with_gssapi
862861
with_krb_srvnam
863862
with_pam
863+
with_curl
864864
with_bsd_auth
865865
with_ldap
866866
with_bonjour
@@ -878,6 +878,7 @@ with_lz4
878878
with_zstd
879879
with_ssl
880880
with_openssl
881+
enable_percona_ext
881882
enable_largefile
882883
'
883884
ac_precious_vars='build_alias
@@ -1540,9 +1541,9 @@ Optional Features:
15401541
--enable-tap-tests enable TAP tests (requires Perl and IPC::Run)
15411542
--enable-injection-points
15421543
enable injection points (for testing)
1543-
--disable-percona-ext enable Percona specific features
15441544
--enable-depend turn on automatic dependency tracking
15451545
--enable-cassert enable assertion checks (for debugging)
1546+
--disable-percona-ext enable Percona specific features
15461547
--disable-largefile omit support for large files
15471548

15481549
Optional Packages:
@@ -1572,6 +1573,7 @@ Optional Packages:
15721573
--with-krb-srvnam=NAME default service principal name in Kerberos (GSSAPI)
15731574
[postgres]
15741575
--with-pam build with PAM support
1576+
--with-curl build with curl support
15751577
--with-bsd-auth build with BSD Authentication support
15761578
--with-ldap build with LDAP support
15771579
--with-bonjour build with Bonjour support
@@ -2835,7 +2837,7 @@ _ACEOF
28352837

28362838

28372839
PG_MAJORVERSION=`expr "$PACKAGE_VERSION" : '\([0-9][0-9]*\)'`
2838-
PG_MINORVERSION=`expr "$PACKAGE_VERSION" : '.*\.\([0-9][0-9]*\)'`
2840+
PG_MINORVERSION=`expr "$PACKAGE_VERSION" : '.*\.\([0-9][0-9]*\)*\.'`
28392841
test -n "$PG_MINORVERSION" || PG_MINORVERSION=0
28402842

28412843

@@ -2854,7 +2856,7 @@ cat >>confdefs.h <<_ACEOF
28542856
_ACEOF
28552857

28562858

2857-
PG_PERCONAVERSION=1
2859+
PG_PERCONAVERSION=`expr "$PACKAGE_VERSION" : '.*\.\([0-9][0-9]*\)'`
28582860

28592861
cat >>confdefs.h <<_ACEOF
28602862
#define PG_PERCONAVERSION "$PG_PERCONAVERSION"
@@ -3726,38 +3728,6 @@ fi
37263728

37273729

37283730

3729-
#
3730-
# Percona ext
3731-
#
3732-
3733-
3734-
# Check whether --enable-percona-ext was given.
3735-
if test "${enable_percona_ext+set}" = set; then :
3736-
enableval=$enable_percona_ext;
3737-
case $enableval in
3738-
yes)
3739-
3740-
$as_echo "#define PERCONA_EXT 1" >>confdefs.h
3741-
3742-
;;
3743-
no)
3744-
:
3745-
;;
3746-
*)
3747-
as_fn_error $? "no argument expected for --enable-percona-ext option" "$LINENO" 5
3748-
;;
3749-
esac
3750-
3751-
else
3752-
enable_percona_ext=yes
3753-
3754-
$as_echo "#define PERCONA_EXT 1" >>confdefs.h
3755-
3756-
fi
3757-
3758-
3759-
3760-
37613731
#
37623732
# Block size
37633733
#
@@ -8459,6 +8429,41 @@ fi
84598429
$as_echo "$with_pam" >&6; }
84608430

84618431

8432+
#
8433+
# curl
8434+
#
8435+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with curl support" >&5
8436+
$as_echo_n "checking whether to build with curl support... " >&6; }
8437+
8438+
8439+
8440+
# Check whether --with-curl was given.
8441+
if test "${with_curl+set}" = set; then :
8442+
withval=$with_curl;
8443+
case $withval in
8444+
yes)
8445+
8446+
$as_echo "#define USE_CURL 1" >>confdefs.h
8447+
8448+
;;
8449+
no)
8450+
:
8451+
;;
8452+
*)
8453+
as_fn_error $? "no argument expected for --with-curl option" "$LINENO" 5
8454+
;;
8455+
esac
8456+
8457+
else
8458+
with_curl=no
8459+
8460+
fi
8461+
8462+
8463+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_curl" >&5
8464+
$as_echo "$with_curl" >&6; }
8465+
8466+
84628467
#
84638468
# BSD AUTH
84648469
#
@@ -12371,6 +12376,43 @@ if test "$with_openssl" = yes ; then
1237112376
with_ssl=openssl
1237212377
fi
1237312378

12379+
#
12380+
# Percona ext
12381+
#
12382+
# Requires Open SSL and curl
12383+
#
12384+
12385+
12386+
# Check whether --enable-percona-ext was given.
12387+
if test "${enable_percona_ext+set}" = set; then :
12388+
enableval=$enable_percona_ext;
12389+
case $enableval in
12390+
yes)
12391+
12392+
$as_echo "#define PERCONA_EXT 1" >>confdefs.h
12393+
12394+
;;
12395+
no)
12396+
:
12397+
;;
12398+
*)
12399+
as_fn_error $? "no argument expected for --enable-percona-ext option" "$LINENO" 5
12400+
;;
12401+
esac
12402+
12403+
else
12404+
enable_percona_ext=yes
12405+
12406+
$as_echo "#define PERCONA_EXT 1" >>confdefs.h
12407+
12408+
fi
12409+
12410+
12411+
12412+
with_curl=yes
12413+
with_ssl=openssl
12414+
12415+
1237412416
if test "$with_ssl" = openssl ; then
1237512417
# Minimum required OpenSSL version is 1.0.2
1237612418

@@ -12653,6 +12695,56 @@ elif test "$with_ssl" != no ; then
1265312695
fi
1265412696

1265512697

12698+
if test "$with_curl" = "yes" ; then
12699+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for curl_easy_setopt in -lcurl" >&5
12700+
$as_echo_n "checking for curl_easy_setopt in -lcurl... " >&6; }
12701+
if ${ac_cv_lib_curl_curl_easy_setopt+:} false; then :
12702+
$as_echo_n "(cached) " >&6
12703+
else
12704+
ac_check_lib_save_LIBS=$LIBS
12705+
LIBS="-lcurl $LIBS"
12706+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12707+
/* end confdefs.h. */
12708+
12709+
/* Override any GCC internal prototype to avoid an error.
12710+
Use char because int might match the return type of a GCC
12711+
builtin and then its argument prototype would still apply. */
12712+
#ifdef __cplusplus
12713+
extern "C"
12714+
#endif
12715+
char curl_easy_setopt ();
12716+
int
12717+
main ()
12718+
{
12719+
return curl_easy_setopt ();
12720+
;
12721+
return 0;
12722+
}
12723+
_ACEOF
12724+
if ac_fn_c_try_link "$LINENO"; then :
12725+
ac_cv_lib_curl_curl_easy_setopt=yes
12726+
else
12727+
ac_cv_lib_curl_curl_easy_setopt=no
12728+
fi
12729+
rm -f core conftest.err conftest.$ac_objext \
12730+
conftest$ac_exeext conftest.$ac_ext
12731+
LIBS=$ac_check_lib_save_LIBS
12732+
fi
12733+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curl_curl_easy_setopt" >&5
12734+
$as_echo "$ac_cv_lib_curl_curl_easy_setopt" >&6; }
12735+
if test "x$ac_cv_lib_curl_curl_easy_setopt" = xyes; then :
12736+
cat >>confdefs.h <<_ACEOF
12737+
#define HAVE_LIBCURL 1
12738+
_ACEOF
12739+
12740+
LIBS="-lcurl $LIBS"
12741+
12742+
else
12743+
as_fn_error $? "library 'curl' is required for curl support" "$LINENO" 5
12744+
fi
12745+
12746+
fi
12747+
1265612748
if test "$with_pam" = yes ; then
1265712749
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_start in -lpam" >&5
1265812750
$as_echo_n "checking for pam_start in -lpam... " >&6; }
@@ -13823,6 +13915,19 @@ else
1382313915
fi
1382413916

1382513917

13918+
fi
13919+
13920+
if test "$with_curl" = "yes" ; then
13921+
ac_fn_c_check_header_mongrel "$LINENO" "curl/curl.h" "ac_cv_header_curl_curl_h" "$ac_includes_default"
13922+
if test "x$ac_cv_header_curl_curl_h" = xyes; then :
13923+
13924+
else
13925+
13926+
as_fn_error $? "header file <curl/curl.h> is required for curl support" "$LINENO" 5
13927+
13928+
fi
13929+
13930+
1382613931
fi
1382713932

1382813933
if test "$with_pam" = yes ; then
@@ -14941,7 +15046,7 @@ else
1494115046
We can't simply define LARGE_OFF_T to be 9223372036854775807,
1494215047
since some C++ compilers masquerading as C compilers
1494315048
incorrectly reject 9223372036854775807. */
14944-
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
15049+
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
1494515050
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
1494615051
&& LARGE_OFF_T % 2147483647 == 1)
1494715052
? 1 : -1];
@@ -14987,7 +15092,7 @@ else
1498715092
We can't simply define LARGE_OFF_T to be 9223372036854775807,
1498815093
since some C++ compilers masquerading as C compilers
1498915094
incorrectly reject 9223372036854775807. */
14990-
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
15095+
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
1499115096
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
1499215097
&& LARGE_OFF_T % 2147483647 == 1)
1499315098
? 1 : -1];
@@ -15011,7 +15116,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1501115116
We can't simply define LARGE_OFF_T to be 9223372036854775807,
1501215117
since some C++ compilers masquerading as C compilers
1501315118
incorrectly reject 9223372036854775807. */
15014-
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
15119+
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
1501515120
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
1501615121
&& LARGE_OFF_T % 2147483647 == 1)
1501715122
? 1 : -1];
@@ -15056,7 +15161,7 @@ else
1505615161
We can't simply define LARGE_OFF_T to be 9223372036854775807,
1505715162
since some C++ compilers masquerading as C compilers
1505815163
incorrectly reject 9223372036854775807. */
15059-
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
15164+
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
1506015165
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
1506115166
&& LARGE_OFF_T % 2147483647 == 1)
1506215167
? 1 : -1];
@@ -15080,7 +15185,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1508015185
We can't simply define LARGE_OFF_T to be 9223372036854775807,
1508115186
since some C++ compilers masquerading as C compilers
1508215187
incorrectly reject 9223372036854775807. */
15083-
#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
15188+
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
1508415189
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
1508515190
&& LARGE_OFF_T % 2147483647 == 1)
1508615191
? 1 : -1];

0 commit comments

Comments
 (0)