trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nonstop-qfchen <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #523: TRAFODION [2025] Initialize authoriza...
Date Mon, 06 Jun 2016 16:59:18 GMT
Github user nonstop-qfchen commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/523#discussion_r65927234
  
    --- Diff: core/sql/cli/Context.cpp ---
    @@ -3718,19 +3719,27 @@ void ContextCli::createMxcmpSession()
         return;
     
       // Steps to perform
    -  // 1. Send the user ID to mxcmp (Linux only)
    -  // 2. Send either the user name or session ID to mxcmp
    -  // 3. Send the LDAP user name to mxcmp
    -  // 4. Set the mxcmpSessionInUse_ flag to TRUE
    +  // 1. Send the user details to mxcmp
    +  // 2. Send CQD's  to mxcmp
    +  // 3. Set the mxcmpSessionInUse_ flag to TRUE
     
    -  // Send the user ID
    +  // Send the user details (auth state, userID, and username
    +  CmpContext *cmpCntxt = CmpCommon::context();
    +  ex_assert(cmpCntxt, "No compiler context exists");
    +  NABoolean authOn = cmpCntxt->isAuthorizationEnabled();
    +
    +  // The message contains the following:
    +  //   (auth state and user ID are delimited by commas)
    +  //     authorization state (0 - off, 1 - on)
    +  //     integer user ID
    +  //     database user name
    +  // See CmpStatement::process (CmpMessageDatabaseUser) for more details
       Int32 userAsInt = (Int32) databaseUserID_;
    -  char userMessage [MAX_AUTHID_AS_STRING_LEN + 1 + MAX_USERNAME_LEN + 1];
    -  str_sprintf(userMessage, "%d,%s", userAsInt, databaseUserName_);
    +  char userMessage [MAX_AUTHID_AS_STRING_LEN + 1 + MAX_USERNAME_LEN + 1 + 2];
    --- End diff --
    
    The length of userAsInt (12 bytes) should be included as well? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message