mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-25 01:37:18 +02:00
Remove useless SHA256 initialization when not using backup manifests
Attempting to take a base backup with Postgres linking to a build of OpenSSL with FIPS enabled currently fails with or even without a backup manifest requested because of this mandatory SHA256 initialization used for the manifest file itself. However, there is no need to do this initialization at all if backup manifests are not needed because there is no data to append to the manifest. Note that being able to use backup manifests with OpenSSL+FIPS requires a switch of the SHA2 implementation to use EVP, which would cause an ABI breakage so this cannot be backpatched to 13 as it has been already released, but at least avoiding this SHA256 initialization gives users the possibility to take a base backup even when specifying --no-manifest with pg_basebackup. Author: Michael Paquier Discussion: https://postgr.es/m/20201110020014.GE1887@paquier.xyz Backpatch-through: 13
This commit is contained in:
parent
c885e4a2f9
commit
9a94b92531
@ -57,12 +57,17 @@ InitializeBackupManifest(backup_manifest_info *manifest,
|
|||||||
backup_manifest_option want_manifest,
|
backup_manifest_option want_manifest,
|
||||||
pg_checksum_type manifest_checksum_type)
|
pg_checksum_type manifest_checksum_type)
|
||||||
{
|
{
|
||||||
|
memset(manifest, 0, sizeof(backup_manifest_info));
|
||||||
|
manifest->checksum_type = manifest_checksum_type;
|
||||||
|
|
||||||
if (want_manifest == MANIFEST_OPTION_NO)
|
if (want_manifest == MANIFEST_OPTION_NO)
|
||||||
manifest->buffile = NULL;
|
manifest->buffile = NULL;
|
||||||
else
|
else
|
||||||
|
{
|
||||||
manifest->buffile = BufFileCreateTemp(false);
|
manifest->buffile = BufFileCreateTemp(false);
|
||||||
manifest->checksum_type = manifest_checksum_type;
|
|
||||||
pg_sha256_init(&manifest->manifest_ctx);
|
pg_sha256_init(&manifest->manifest_ctx);
|
||||||
|
}
|
||||||
|
|
||||||
manifest->manifest_size = UINT64CONST(0);
|
manifest->manifest_size = UINT64CONST(0);
|
||||||
manifest->force_encode = (want_manifest == MANIFEST_OPTION_FORCE_ENCODE);
|
manifest->force_encode = (want_manifest == MANIFEST_OPTION_FORCE_ENCODE);
|
||||||
manifest->first_file = true;
|
manifest->first_file = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user