Github user linwen commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1081#discussion_r95713954
  
    --- Diff: src/backend/libpq/rangerrest.c ---
    @@ -381,29 +449,38 @@ int call_ranger_rest(CURL_HANDLE curl_handle, const 
char* request)
     }
     
     /*
    - * arg_list: List of RangerRequestJsonArgs
    + * check privilege(s) from ranger
    + * @param  request_list    List of RangerRequestJsonArgs
    + * @param  result_list             List of RangerPrivilegeResults
    + * @return 0 get response from ranger and parse success; -1 other error
      */
    -int check_privilege_from_ranger(List *arg_list)
    +int check_privilege_from_ranger(List *request_list, List *result_list)
     {
    -   json_object* jrequest = create_ranger_request_json(arg_list);
    +   json_object* jrequest = create_ranger_request_json(request_list, 
result_list);
        Assert(jrequest != NULL);
    +
        const char *request = json_object_to_json_string(jrequest);
    -   elog(LOG, "Send JSON request to Ranger: %s", request);
        Assert(request != NULL);
    +   elog(LOG, "Send JSON request to Ranger: %s", request);
    +
        struct curl_context_t curl_context;
        memset(&curl_context, 0, sizeof(struct curl_context_t));
     
        /* call GET method to send request*/
        if (call_ranger_rest(&curl_context, request) < 0)
        {
    -           return RANGERCHECK_NO_PRIV;
    +           return -1;
        }
     
        /* free the JSON object */
        json_object_put(jrequest);
     
        /* parse the JSON-format result */
    -   RangerACLResult ret = 
parse_ranger_response(curl_context.response.buffer);
    +   int ret = parse_ranger_response(curl_context.response.buffer, 
result_list);
    +   if (ret < 0) 
    +   {
    +           elog(WARNING, "parse_ranger_response() failed");
    --- End diff --
    
    agree.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to