Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 25527200BAF for ; Mon, 31 Oct 2016 21:14:27 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 23FF6160B08; Mon, 31 Oct 2016 20:14:27 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6C0A5160AED for ; Mon, 31 Oct 2016 21:14:26 +0100 (CET) Received: (qmail 28557 invoked by uid 500); 31 Oct 2016 20:14:22 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 27696 invoked by uid 99); 31 Oct 2016 20:14:22 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Oct 2016 20:14:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 12961E1075; Mon, 31 Oct 2016 20:14:22 +0000 (UTC) From: laurentgo To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill pull request #578: DRILL-4280: Kerberos Authentication Content-Type: text/plain Message-Id: <20161031201422.12961E1075@git1-us-west.apache.org> Date: Mon, 31 Oct 2016 20:14:21 +0000 (UTC) archived-at: Mon, 31 Oct 2016 20:14:27 -0000 Github user laurentgo commented on a diff in the pull request: https://github.com/apache/drill/pull/578#discussion_r85796563 --- Diff: contrib/native/client/src/clientlib/drillClientImpl.cpp --- @@ -427,6 +511,121 @@ connectionStatus_t DrillClientImpl::validateHandshake(DrillUserProperties* prope getMessage(ERR_CONN_AUTHFAIL, this->m_handshakeErrorId.c_str(), this->m_handshakeErrorMsg.c_str())); + case exec::user::AUTH_REQUIRED: { + DRILL_MT_LOG(DRILL_LOG(LOG_TRACE) << "Server requires SASL authentication." << std::endl;) + SaslAuthenticatorImpl saslAuthenticator(properties); + int saslResult = 0; + std::string chosenMech; + const char *out; + unsigned outlen; + saslResult = saslAuthenticator.init(m_mechanisms, chosenMech, &out, &outlen); + if (saslResult != SASL_OK) { + DRILL_MT_LOG(DRILL_LOG(LOG_TRACE) << "Authenticator init failed. Code: " << saslResult << std::endl;) + return handleConnError(CONN_AUTH_FAILED, "User authentication init failed."); + } + if (NULL == out) { + out = (&::google::protobuf::internal::kEmptyString)->c_str(); --- End diff -- we should not use protobuf internal constants. Either use the empty string "" here (it might be okay if some of the functions you call out with are not keeping reference on it after returning), or create a special constant. --- 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. ---