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

maxyang 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 cb671fe1b7 Fix some compilation and habitual thinking errors.
cb671fe1b7 is described below

commit cb671fe1b78d0b1d3d13142679661915eb14b275
Author: zhangwenchao <[email protected]>
AuthorDate: Wed Dec 11 18:42:23 2024 +0800

    Fix some compilation and habitual thinking errors.
    
    Fix a variable used uninitialized compilation error and an always
    true judgement in authorization.
    
    Authored-by: Zhang Wenchao [email protected]
---
 src/backend/commands/tag.c | 4 ++--
 src/backend/libpq/auth.c   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/backend/commands/tag.c b/src/backend/commands/tag.c
index ffe849bd2d..bab2c2b5a2 100644
--- a/src/backend/commands/tag.c
+++ b/src/backend/commands/tag.c
@@ -471,7 +471,7 @@ AddTagDescriptions(List *tags,
                bool    isnull;
                bool    has_matching_allowed_val;
                List    *allowed_values;
-               ListCell        *value_cell;
+               ListCell        *value_cell = NULL;
                
                has_matching_allowed_val = false;
                def = lfirst(cell);
@@ -871,7 +871,7 @@ transformTagValues(int action, Oid tagId, Datum oldvalues,
                                   List *allowed_values, bool unset)
 {
        List            *resultValues = untransformTagValues(oldvalues);
-       ListCell        *value_cell;
+       ListCell        *value_cell = NULL;
        Datum           result;
 
        Assert(!(resultValues && unset));
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c
index 7937b05e51..ad0e7e57f3 100644
--- a/src/backend/libpq/auth.c
+++ b/src/backend/libpq/auth.c
@@ -395,7 +395,7 @@ auth_failed(Port *port, int status, char *logdetail)
        account_status = DatumGetInt16(SysCacheGetAttr(AUTHNAME, auth_tuple,
                                                
Anum_pg_authid_rolaccountstatus, &account_status_isnull));
        if (enable_password_profile && !authform->rolsuper && 
authform->rolenableprofile &&
-               (account_status != ROLE_ACCOUNT_STATUS_LOCKED ||
+               (account_status != ROLE_ACCOUNT_STATUS_LOCKED &&
                 account_status != ROLE_ACCOUNT_STATUS_LOCKED_TIMED))
                SendLoginFailedSignal(port->user_name);
 


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

Reply via email to