This is an automated email from the ASF dual-hosted git repository.

yjhjstz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/main by this push:
     new c67e370d62 Fix FIPS mode checks and initialize segfile_count
c67e370d62 is described below

commit c67e370d62bf2c6f5cdeb26ee0c42457c0d56e88
Author: Jianghua Yang <[email protected]>
AuthorDate: Mon Mar 10 22:56:34 2025 +0800

    Fix FIPS mode checks and initialize segfile_count
---
 contrib/pgcrypto/openssl.c                         | 22 ----------------------
 src/backend/access/aocs/aocsam_handler.c           |  2 +-
 .../access/appendonly/appendonlyam_handler.c       |  2 +-
 3 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/contrib/pgcrypto/openssl.c b/contrib/pgcrypto/openssl.c
index 4ac9ebef76..2e844bc100 100644
--- a/contrib/pgcrypto/openssl.c
+++ b/contrib/pgcrypto/openssl.c
@@ -896,9 +896,6 @@ px_disable_fipsmode(void)
        ossl_cipher_types = ossl_cipher_types_all;
        fips = false;
 
-       if (!FIPS_mode_set)
-               return;
-
        FIPS_mode_set(0);
 #endif
 
@@ -923,15 +920,6 @@ px_enable_fipsmode(void)
         */
        ossl_aliases = NULL;
        ossl_cipher_types = NULL;
-
-       /* Make sure that we are linked against a FIPS enabled OpenSSL */
-       if (!FIPS_mode_set)
-       {
-               ereport(ERROR,
-                               (errmsg("FIPS enabled OpenSSL is required for 
strict FIPS mode"),
-                                errhint("Recompile OpenSSL with the FIPS 
module, or install a FIPS enabled OpenSSL distribution.")));
-       }
-
        /*
         * A non-zero return value means that FIPS mode was enabled, but the
         * full range of possible non-zero return values is not documented so
@@ -961,16 +949,6 @@ px_check_fipsmode(void)
        ereport(ERROR,
                        (errmsg("FIPS enabled OpenSSL is required for strict 
FIPS mode"),
                         errhint("Recompile OpenSSL with the FIPS module, or 
install a FIPS enabled OpenSSL distribution.")));
-#else
-
-       /* Make sure that we are linked against a FIPS enabled OpenSSL */
-       if (!FIPS_mode_set)
-       {
-               ereport(ERROR,
-                               (errmsg("FIPS enabled OpenSSL is required for 
strict FIPS mode"),
-                                errhint("Recompile OpenSSL with the FIPS 
module, or install a FIPS enabled OpenSSL distribution.")));
-       }
-
 #endif
 }
 
diff --git a/src/backend/access/aocs/aocsam_handler.c 
b/src/backend/access/aocs/aocsam_handler.c
index 2313216a49..83391b9e09 100644
--- a/src/backend/access/aocs/aocsam_handler.c
+++ b/src/backend/access/aocs/aocsam_handler.c
@@ -1683,7 +1683,7 @@ aoco_index_build_range_scan(Relation heapRelation,
        ExprContext *econtext;
        Snapshot        snapshot;
        AOCSFileSegInfo **seginfo = NULL;
-       int32 segfile_count;
+       int32 segfile_count = 0;
        int64 total_blockcount = 0; 
        BlockNumber lastBlock = start_blockno;
        int64 blockcounts = 0;
diff --git a/src/backend/access/appendonly/appendonlyam_handler.c 
b/src/backend/access/appendonly/appendonlyam_handler.c
index e74366cbfe..0136d4a850 100644
--- a/src/backend/access/appendonly/appendonlyam_handler.c
+++ b/src/backend/access/appendonly/appendonlyam_handler.c
@@ -1554,7 +1554,7 @@ appendonly_index_build_range_scan(Relation heapRelation,
        ExprContext *econtext;
        Snapshot        snapshot;
        FileSegInfo **seginfo = NULL;
-       int segfile_count;
+       int segfile_count = 0;
        int64 total_blockcount = 0;
        int64 previous_blkno = -1;
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to