You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Hao Hao (Code Review)" <ge...@cloudera.org> on 2020/03/12 00:26:39 UTC

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Hao Hao has uploaded this change for review. ( http://gerrit.cloudera.org:8080/15416


Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................

[ranger] pass 'principal' and 'keytab' to the subprocess

This patch adds the C++ side change to pass the Kudu principal and
keytab to the Java Ranger subprocess.

Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
---
M src/kudu/ranger/CMakeLists.txt
M src/kudu/ranger/ranger_client.cc
M src/kudu/ranger/ranger_client.h
M src/kudu/security/init.cc
M src/kudu/security/init.h
5 files changed, 39 insertions(+), 29 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/16/15416/1
-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 1
Gerrit-Owner: Hao Hao <ha...@cloudera.com>

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hao Hao has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 9:

(7 comments)

http://gerrit.cloudera.org:8080/#/c/15416/7/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/7/src/kudu/ranger/ranger_client.cc@42
PS7, Line 42: #include "kudu/util/subprocess.h"
            : 
            : DEFINE_string(ranger_java_path, "java",
            :               "The path where the Java binary was installed. If "
            :               "the value isn't an absolute path, it will be evaluated "
            :               "using the Kudu user's PATH
> We'll probably want to centralize this, if it'll be reused for other JVM-ba
Ack


http://gerrit.cloudera.org:8080/#/c/15416/7/src/kudu/ranger/ranger_client.cc@200
PS7, Line 200: 
> nit: parentheses usually denote something that is optional, which doesn't s
Done


http://gerrit.cloudera.org:8080/#/c/15416/7/src/kudu/ranger/ranger_client.cc@203
PS7, Line 203: GROUP_FLAG_VALIDATOR(ranger_config_flags, ValidateRangerConfiguration);
> Can std::move()
Done


http://gerrit.cloudera.org:8080/#/c/15416/7/src/kudu/ranger/ranger_client.cc@202
PS7, Line 202: 
             : GROUP_FLAG_VALIDATOR(ranger_config_flags, ValidateRangerConfiguration);
             : 
             : #define HISTINIT(member, x) member = METRI
> These should be 'ret'.
Done


http://gerrit.cloudera.org:8080/#/c/15416/7/src/kudu/ranger/ranger_client.cc@222
PS7, Line 222: }
> Can std::move(argv).
Done


http://gerrit.cloudera.org:8080/#/c/15416/8/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/8/src/kudu/ranger/ranger_client.cc@169
PS8, Line 169:     ret.emplace_back("-i");
> warning: std::move of the const expression of the trivially-copyable type '
Done


http://gerrit.cloudera.org:8080/#/c/15416/8/src/kudu/ranger/ranger_client.cc@171
PS8, Line 171:     ret.emplace_back("-k");
> warning: std::move of the const expression of the trivially-copyable type '
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 9
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Comment-Date: Thu, 19 Mar 2020 01:10:54 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hao Hao has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 4:

(4 comments)

http://gerrit.cloudera.org:8080/#/c/15416/3/src/kudu/ranger/ranger_client.h
File src/kudu/ranger/ranger_client.h:

http://gerrit.cloudera.org:8080/#/c/15416/3/src/kudu/ranger/ranger_client.h@101
PS3, Line 101: } // namespace ranger
             : } // namespace kudu
             : 
             : 
             : 
> Maybe just put this in an anonymous namespace in the .cc file? Then we don'
Done


http://gerrit.cloudera.org:8080/#/c/15416/3/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/3/src/kudu/ranger/ranger_client.cc@371
PS3, Line 371: 
> nit: Remove std.
Done


http://gerrit.cloudera.org:8080/#/c/15416/3/src/kudu/ranger/ranger_client.cc@385
PS3, Line 385: r (const auto& action : *actions) {
             :     auto req = req_list.add_requests();
             :     req->set_action(action);
             :     req->set_database(db);
             :     req->set_table(tbl.ToString());
             :   }
> nit: Why not just RETURN_NOT_OK_PREPEND?
Done


http://gerrit.cloudera.org:8080/#/c/15416/3/src/kudu/ranger/ranger_client.cc@372
PS3, Line 372:   string db;
             :   Slice tbl;
             : 
             :   auto s = ParseRangerTableIdentifier(table_name, &db, &tbl);
             :   if (PREDICT_FALSE(!s.ok())) {
             :     LOG(WARNING) << Substitute(kDenyNonRangerTableTemplate, table_name);
             :     return Status::NotAuthorized(kUnauthorizedAction);
             :   }
             : 
             :   RangerRequestListPB req_list;
             :   RangerResponseListPB resp_list;
             :   req_list.set_user(user_name);
             : 
             :   for (const auto& action : *actions) {
             :     auto req = req_list.add_requests();
             :     req->set_action(action);
             :     req->set_database(db);
             :     req->set_table(tbl.ToString());
             :   }
             : 
             :   RETURN_NOT_OK(subprocess_->Execute(req_list, &resp_list));
             : 
             :   DCHECK_EQ(actions->size(), resp_list.responses_size());
             : 
> nit: It's generally less error-prone to only mutate an outparam if this suc
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 4
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Sun, 15 Mar 2020 00:45:12 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hao Hao has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 1:

(4 comments)

http://gerrit.cloudera.org:8080/#/c/15416/1/src/kudu/ranger/CMakeLists.txt
File src/kudu/ranger/CMakeLists.txt:

http://gerrit.cloudera.org:8080/#/c/15416/1/src/kudu/ranger/CMakeLists.txt@45
PS1, Line 45: server_process
> Kind of surprised to see this instead of just 'security'?
Done


http://gerrit.cloudera.org:8080/#/c/15416/1/src/kudu/ranger/ranger_client.h
File src/kudu/ranger/ranger_client.h:

http://gerrit.cloudera.org:8080/#/c/15416/1/src/kudu/ranger/ranger_client.h@101
PS1, Line 101: Kerberos
> nit: "the Kerberos principal"
Done


http://gerrit.cloudera.org:8080/#/c/15416/1/src/kudu/ranger/ranger_client.h@101
PS1, Line 101: this daemon
> nit: to reduce terminology we have, maybe just call this "the Ranger subpro
Done


http://gerrit.cloudera.org:8080/#/c/15416/1/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/1/src/kudu/ranger/ranger_client.cc@354
PS1, Line 354: ignore_result
> Usually ignore_result() signifies that we don't care about the result of th
In case that Kerberos is not enabled in the cluster, I don't see this is a sign that have to fail the Java subprocess. Although added a log here to indicate something maybe wrong.



-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 1
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 12 Mar 2020 06:08:35 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hao Hao has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 11:

Unrelated flaky test failure.


-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 11
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Comment-Date: Thu, 19 Mar 2020 20:57:18 +0000
Gerrit-HasComments: No

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 2:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/15416/1/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/1/src/kudu/ranger/ranger_client.cc@354
PS1, Line 354: string config
> In case that Kerberos is not enabled in the cluster, I don't see this is a 
The specific case I'm worried about is if the keytab is specified by we can't resolve the principal. IIUC that would mean '-k' is non-empty and '-i' is empty, and we'd hit an exception here:

https://gerrit.cloudera.org/c/15414/2/java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/ranger/authorization/RangerKuduAuthorizer.java#81


http://gerrit.cloudera.org:8080/#/c/15416/2/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/2/src/kudu/ranger/ranger_client.cc@150
PS2, Line 150: { FLAGS_java_path, "-cp", GetJavaClasspath(), kMainClass,
             :                 "-i", GetKuduPrincipal(), "-k", FLAGS_keytab_file }
nit: It feels kind of weird to be passing -i and -k unconditionally.

Maybe define some BuildArgs() function or something that returns the correct arguments here? E.g. maybe we don't pass anything for -i or -k if we can't evaluate the principal or keytab?

Or make the subprocess heap-allocated and evaluate the arguments at Start()?
Or pass the principal and keytab as environment variables before Start()?



-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 2
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 12 Mar 2020 17:39:33 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hello Tidy Bot, Attila Bukor, Kudu Jenkins, Andrew Wong, Adar Dembo, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/15416

to look at the new patch set (#10).

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................

[ranger] pass 'principal' and 'keytab' to the subprocess

This patch adds the C++ side change to pass the Kudu principal and
keytab to the Java Ranger subprocess.

Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
---
M src/kudu/ranger/CMakeLists.txt
M src/kudu/ranger/ranger_client.cc
M src/kudu/ranger/ranger_client.h
M src/kudu/security/init.cc
M src/kudu/security/init.h
M src/kudu/server/server_base.cc
6 files changed, 104 insertions(+), 69 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/16/15416/10
-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 10
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 7:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/15416/7/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/7/src/kudu/ranger/ranger_client.cc@42
PS7, Line 42: 
            : DEFINE_string(ranger_java_path, "java",
            :               "The path where the Java binary was installed. If "
            :               "the value isn't an absolute path, it will be evaluated "
            :               "using the Kudu user's PATH.");
            : TAG_FLAG(ranger_java_path, experimental);
We'll probably want to centralize this, if it'll be reused for other JVM-based subprocesses (like Atlas).

Doesn't have to happen now, but keep in mind.


http://gerrit.cloudera.org:8080/#/c/15416/7/src/kudu/ranger/ranger_client.cc@203
PS7, Line 203:     argv->emplace_back(configured_principal);
Can std::move()


http://gerrit.cloudera.org:8080/#/c/15416/7/src/kudu/ranger/ranger_client.cc@222
PS7, Line 222:   subprocess_.reset(new RangerSubprocess(argv, metric_entity_));
Can std::move(argv).



-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 7
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Mon, 16 Mar 2020 06:45:07 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Andrew Wong, Adar Dembo, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/15416

to look at the new patch set (#2).

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................

[ranger] pass 'principal' and 'keytab' to the subprocess

This patch adds the C++ side change to pass the Kudu principal and
keytab to the Java Ranger subprocess.

Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
---
M src/kudu/ranger/CMakeLists.txt
M src/kudu/ranger/ranger_client.cc
M src/kudu/ranger/ranger_client.h
M src/kudu/security/init.cc
M src/kudu/security/init.h
M src/kudu/server/server_base.cc
6 files changed, 61 insertions(+), 45 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/16/15416/2
-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 2
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hao Hao has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 3:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/15416/2/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/2/src/kudu/ranger/ranger_client.cc@150
PS2, Line 150: outbound_queue_time_ms, ranger_subprocess_outbound_queue_time_ms);
             :   HISTINIT(sp_execution_time_ms, ranger_subprocess_execution_time_m
> +1; at the very least, shouldn't we NOT pass these args if Kudu isn't Kerbe
Done


http://gerrit.cloudera.org:8080/#/c/15416/2/src/kudu/security/init.cc
File src/kudu/security/init.cc:

http://gerrit.cloudera.org:8080/#/c/15416/2/src/kudu/security/init.cc@441
PS2, Line 441:   static const auto& kHostToken = "_HOST";
> This can be made static.
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 3
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Sat, 14 Mar 2020 18:50:15 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 7:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/15416/7/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/7/src/kudu/ranger/ranger_client.cc@200
PS7, Line 200: ($0)
nit: parentheses usually denote something that is optional, which doesn't seem to be the case here (e.g. if I were to read this without the parens, it would be "unable to get the configured principal from for the Ranger subprocess").


http://gerrit.cloudera.org:8080/#/c/15416/7/src/kudu/ranger/ranger_client.cc@202
PS7, Line 202: argv->emplace_back("-i");
             :     argv->emplace_back(configured_principal);
             :     argv->emplace_back("-k");
             :     argv->emplace_back(FLAGS_keytab_file);
These should be 'ret'.



-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 7
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Sun, 15 Mar 2020 06:29:55 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hello Tidy Bot, Attila Bukor, Kudu Jenkins, Andrew Wong, Adar Dembo, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/15416

to look at the new patch set (#11).

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................

[ranger] pass 'principal' and 'keytab' to the subprocess

This patch adds the C++ side change to pass the Kudu principal and
keytab to the Java Ranger subprocess.

Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
---
M src/kudu/ranger/CMakeLists.txt
M src/kudu/ranger/ranger_client.cc
M src/kudu/ranger/ranger_client.h
M src/kudu/security/init.cc
M src/kudu/security/init.h
M src/kudu/server/server_base.cc
6 files changed, 113 insertions(+), 76 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/16/15416/11
-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 11
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hello Attila Bukor, Kudu Jenkins, Andrew Wong, Adar Dembo, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/15416

to look at the new patch set (#4).

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................

[ranger] pass 'principal' and 'keytab' to the subprocess

This patch adds the C++ side change to pass the Kudu principal and
keytab to the Java Ranger subprocess.

Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
---
M src/kudu/ranger/CMakeLists.txt
M src/kudu/ranger/ranger_client.cc
M src/kudu/ranger/ranger_client.h
M src/kudu/security/init.cc
M src/kudu/security/init.h
M src/kudu/server/server_base.cc
6 files changed, 106 insertions(+), 70 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/16/15416/4
-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 4
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hao Hao has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................

[ranger] pass 'principal' and 'keytab' to the subprocess

This patch adds the C++ side change to pass the Kudu principal and
keytab to the Java Ranger subprocess.

Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Reviewed-on: http://gerrit.cloudera.org:8080/15416
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Reviewed-by: Andrew Wong <aw...@cloudera.com>
Tested-by: Hao Hao <ha...@cloudera.com>
---
M src/kudu/ranger/CMakeLists.txt
M src/kudu/ranger/ranger_client.cc
M src/kudu/ranger/ranger_client.h
M src/kudu/security/init.cc
M src/kudu/security/init.h
M src/kudu/server/server_base.cc
6 files changed, 113 insertions(+), 76 deletions(-)

Approvals:
  Adar Dembo: Looks good to me, approved
  Andrew Wong: Looks good to me, approved
  Hao Hao: Verified

-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 12
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hao Hao has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 5:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/15416/4/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/4/src/kudu/ranger/ranger_client.cc@130
PS4, Line 130: 
             : static bool ValidateRangerJavaPath() {
             :   if (!FLAGS_ranger_config_path.empty() &&
             :       !Env::Default()->FileExists(FLAGS_ranger_java_path)) {
             :     LOG(ERROR) << Substitute("FLAGS_ranger_java_path has invalid java binary path: $0",
             :                              FLAGS_ranger_java_path);
             :     return false;
             :   }
             :   return true;
             : }
             : GROUP_FLAG_VALIDATOR(ranger_java_path_flags, ValidateRangerJavaPath);
             : 
             : static bool ValidateRangerJarPath() {
             :   if (!FLAGS_ranger_config_path.empty() &&
             :       !Env::Default()->FileExists(FLAGS_ranger_jar_path)) {
             :     LOG(ERROR) << Substitute("FLAGS_ranger_jar_path has invalid JAR file path for the "
             :                              "Ranger subprocess: $0", FLAGS_ranger_jar_path);
             :     return false;
             :   }
             :   return true;
             : }
             : GROUP_FLAG_VALIDATOR(ranger_jar_path_flags, ValidateRangerJarPath);
> Not sure if we do this elsewhere, but would it make sense to do all this va
Yeah, makes sense, will update it in the other patch where this validation is introduced.



-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 5
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Sun, 15 Mar 2020 04:19:19 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 11: Code-Review+2


-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 11
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Comment-Date: Thu, 19 Mar 2020 19:02:20 +0000
Gerrit-HasComments: No

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 1:

(4 comments)

http://gerrit.cloudera.org:8080/#/c/15416/1/src/kudu/ranger/CMakeLists.txt
File src/kudu/ranger/CMakeLists.txt:

http://gerrit.cloudera.org:8080/#/c/15416/1/src/kudu/ranger/CMakeLists.txt@45
PS1, Line 45: server_process
Kind of surprised to see this instead of just 'security'?

Upon looking around though it seems like this is needed for the --keytab_file flag and validation. Would it work to define them in the security module and then declare them in server_base.cc as needed?


http://gerrit.cloudera.org:8080/#/c/15416/1/src/kudu/ranger/ranger_client.h
File src/kudu/ranger/ranger_client.h:

http://gerrit.cloudera.org:8080/#/c/15416/1/src/kudu/ranger/ranger_client.h@101
PS1, Line 101: Kerberos
nit: "the Kerberos principal"


http://gerrit.cloudera.org:8080/#/c/15416/1/src/kudu/ranger/ranger_client.h@101
PS1, Line 101: this daemon
nit: to reduce terminology we have, maybe just call this "the Ranger subprocess"


http://gerrit.cloudera.org:8080/#/c/15416/1/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/1/src/kudu/ranger/ranger_client.cc@354
PS1, Line 354: ignore_result
Usually ignore_result() signifies that we don't care about the result of the call. In this case, we _should_ care about the result, right? Otherwise the first sign of failure would be the Java process crashing, unable to login with the principal, which seems much more troublesome to debug than failing here.



-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 1
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 12 Mar 2020 01:41:45 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 3:

(4 comments)

http://gerrit.cloudera.org:8080/#/c/15416/3/src/kudu/ranger/ranger_client.h
File src/kudu/ranger/ranger_client.h:

http://gerrit.cloudera.org:8080/#/c/15416/3/src/kudu/ranger/ranger_client.h@101
PS3, Line 101:   // Builds the arguments for the Ranger subprocess. Specifically pass
             :   // the principal and keytab file that the Ranger subprocess will log in with
             :   // if Kerberos is enabled. 'args' has the final arguments.
             :   // Returns 'OK' if arguments successfully created, error otherwise.
             :   static Status BuildArgs(std::vector<std::string>* args);
Maybe just put this in an anonymous namespace in the .cc file? Then we don't need to include <vector>. Unless there's a good reason for keeping it in the header.


http://gerrit.cloudera.org:8080/#/c/15416/3/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/3/src/kudu/ranger/ranger_client.cc@371
PS3, Line 371: std::vector<std::string>
nit: Remove std.


http://gerrit.cloudera.org:8080/#/c/15416/3/src/kudu/ranger/ranger_client.cc@385
PS3, Line 385: Status s = security::GetConfiguredPrincipal(FLAGS_principal, &configured_principal);
             :     if (!s.ok()) {
             :       LOG(WARNING) << Substitute("unable to get the configured principal from ($0) for "
             :                                  "the Ranger subprocess", FLAGS_principal);
             :       return s;
             :     }
nit: Why not just RETURN_NOT_OK_PREPEND?


http://gerrit.cloudera.org:8080/#/c/15416/3/src/kudu/ranger/ranger_client.cc@372
PS3, Line 372:   DCHECK(args);
             : 
             :   // Pass the required arguments to run the Ranger subprocess.
             :   args->emplace_back(FLAGS_ranger_java_path);
             :   args->emplace_back("-cp");
             :   args->emplace_back(GetJavaClasspath());
             :   args->emplace_back(kMainClass);
             : 
             :   // When Kerberos is enabled in Kudu, pass both Kudu principal and keytab file
             :   // to the Ranger subprocess.
             :   const bool has_keytab = !FLAGS_keytab_file.empty();
             :   if (has_keytab) {
             :     string configured_principal;
             :     Status s = security::GetConfiguredPrincipal(FLAGS_principal, &configured_principal);
             :     if (!s.ok()) {
             :       LOG(WARNING) << Substitute("unable to get the configured principal from ($0) for "
             :                                  "the Ranger subprocess", FLAGS_principal);
             :       return s;
             :     }
             :     args->emplace_back("-i");
             :     args->emplace_back(configured_principal);
             :     args->emplace_back("-k");
             :     args->emplace_back(FLAGS_keytab_file);
             :   }
nit: It's generally less error-prone to only mutate an outparam if this succeeds. Consider creating a local vector<string> and std::move()ing it before returning OK.

Also such a local variable can be initialized with an initializer list instead of emplace_back.



-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 3
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Sat, 14 Mar 2020 19:34:45 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 5:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/15416/4/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/4/src/kudu/ranger/ranger_client.cc@130
PS4, Line 130: 
             : static bool ValidateRangerJavaPath() {
             :   if (!FLAGS_ranger_config_path.empty() &&
             :       !Env::Default()->FileExists(FLAGS_ranger_java_path)) {
             :     LOG(ERROR) << Substitute("FLAGS_ranger_java_path has invalid java binary path: $0",
             :                              FLAGS_ranger_java_path);
             :     return false;
             :   }
             :   return true;
             : }
             : GROUP_FLAG_VALIDATOR(ranger_java_path_flags, ValidateRangerJavaPath);
             : 
             : static bool ValidateRangerJarPath() {
             :   if (!FLAGS_ranger_config_path.empty() &&
             :       !Env::Default()->FileExists(FLAGS_ranger_jar_path)) {
             :     LOG(ERROR) << Substitute("FLAGS_ranger_jar_path has invalid JAR file path for the "
             :                              "Ranger subprocess: $0", FLAGS_ranger_jar_path);
             :     return false;
             :   }
             :   return true;
             : }
             : GROUP_FLAG_VALIDATOR(ranger_jar_path_flags, ValidateRangerJarPath);
Not sure if we do this elsewhere, but would it make sense to do all this validation as a single validator predicated on FLAGS_ranger_config_path?

Also should we ensure the config is a file too?


http://gerrit.cloudera.org:8080/#/c/15416/4/src/kudu/ranger/ranger_client.cc@191
PS4, Line 191: Status BuildArgv(vector<string>* argv) {
             :   DCHECK(argv);
             :   // When Kerberos is enabled in Kudu, pass both Kudu principal and keytab file
             :   // to the Ranger subprocess.
             :   if (!FLAGS_keytab_file.empty()) {
             :     string configured_principal;
             :     RETURN_NOT_OK_PREPEND(security::GetConfiguredPrincipal(FLAGS_principal, &configured_principal),
             :                           Substitute("unable to get the configured principal from ($0) for "
             :                                      "the Ranger subprocess", FLAGS_principal));
             :     *argv = std::move(vector<string>({ FLAGS_ranger_java_path, "-cp", GetJavaClasspath(),
             :                                        kMainClass, "-i", configured_principal,
             :                                        "-k", FLAGS_keytab_file }));
             :   } else {
             :     // Pass the required arguments to run the Ranger subprocess.
             :     argv->emplace_back(FLAGS_ranger_java_path);
             :     argv->emplace_back("-cp");
             :     argv->emplace_back(GetJavaClasspath());
             :     argv->emplace_back(kMainClass);
             :   };
             :   return Status::OK();
nit: this would be cleaner as:

vector<string> ret = { FLAGS_ranger_java_path, -cp, GetJavaClasspath(), kMainClass };
if (!FLAGS_keytab_file.empty()) {
  RETURN_NOT_OK(evaluate principal);
  ret.emplace_back(-i);
  ret.emplace_back(principal);
  ret.emplace_back(-k);
  ret.emplace_back(FLAGS_keytab_file);
}
*argv = std::move(ret);
return Status::OK();



-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 5
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Sun, 15 Mar 2020 01:50:44 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hello Attila Bukor, Kudu Jenkins, Andrew Wong, Adar Dembo, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/15416

to look at the new patch set (#8).

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................

[ranger] pass 'principal' and 'keytab' to the subprocess

This patch adds the C++ side change to pass the Kudu principal and
keytab to the Java Ranger subprocess.

Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
---
M src/kudu/ranger/CMakeLists.txt
M src/kudu/ranger/ranger_client.cc
M src/kudu/ranger/ranger_client.h
M src/kudu/security/init.cc
M src/kudu/security/init.h
M src/kudu/server/server_base.cc
6 files changed, 104 insertions(+), 69 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/16/15416/8
-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 8
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hello Attila Bukor, Kudu Jenkins, Andrew Wong, Adar Dembo, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/15416

to look at the new patch set (#5).

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................

[ranger] pass 'principal' and 'keytab' to the subprocess

This patch adds the C++ side change to pass the Kudu principal and
keytab to the Java Ranger subprocess.

Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
---
M src/kudu/ranger/CMakeLists.txt
M src/kudu/ranger/ranger_client.cc
M src/kudu/ranger/ranger_client.h
M src/kudu/security/init.cc
M src/kudu/security/init.h
M src/kudu/server/server_base.cc
6 files changed, 110 insertions(+), 70 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/16/15416/5
-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 5
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hao Hao has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 11: Verified+1


-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 11
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Comment-Date: Thu, 19 Mar 2020 20:57:25 +0000
Gerrit-HasComments: No

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hao Hao has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 6:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/15416/4/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/4/src/kudu/ranger/ranger_client.cc@191
PS4, Line 191: Status BuildArgv(vector<string>* argv) {
             :   DCHECK(argv);
             :   // Pass the required arguments to run the Ranger subprocess.
             :   vector<string> ret = { FLAGS_ranger_java_path, "-cp", GetJavaClasspath(), kMainClass };
             :   // When Kerberos is enabled in Kudu, pass both Kudu principal and keytab file
             :   // to the Ranger subprocess.
             :   if (!FLAGS_keytab_file.empty()) {
             :     string configured_principal;
             :     RETURN_NOT_OK_PREPEND(security::GetConfiguredPrincipal(FLAGS_principal, &configured_principal),
             :                           Substitute("unable to get the configured principal from ($0) for "
             :                                      "the Ranger subprocess", FLAGS_principal));
             :     argv->emplace_back("-i");
             :     argv->emplace_back(configured_principal);
             :     argv->emplace_back("-k");
             :     argv->emplace_back(FLAGS_keytab_file);
             :   };
             : 
             :   *argv = std::move(ret);
             :   return Status::OK();
             : }
> nit: this would be cleaner as:
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 6
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Sun, 15 Mar 2020 04:44:34 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hello Kudu Jenkins, Andrew Wong, Adar Dembo, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/15416

to look at the new patch set (#3).

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................

[ranger] pass 'principal' and 'keytab' to the subprocess

This patch adds the C++ side change to pass the Kudu principal and
keytab to the Java Ranger subprocess.

Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
---
M src/kudu/ranger/CMakeLists.txt
M src/kudu/ranger/ranger_client.cc
M src/kudu/ranger/ranger_client.h
M src/kudu/security/init.cc
M src/kudu/security/init.h
M src/kudu/server/server_base.cc
6 files changed, 100 insertions(+), 55 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/16/15416/3
-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 3
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hello Attila Bukor, Kudu Jenkins, Andrew Wong, Adar Dembo, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/15416

to look at the new patch set (#6).

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................

[ranger] pass 'principal' and 'keytab' to the subprocess

This patch adds the C++ side change to pass the Kudu principal and
keytab to the Java Ranger subprocess.

Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
---
M src/kudu/ranger/CMakeLists.txt
M src/kudu/ranger/ranger_client.cc
M src/kudu/ranger/ranger_client.h
M src/kudu/security/init.cc
M src/kudu/security/init.h
M src/kudu/server/server_base.cc
6 files changed, 109 insertions(+), 70 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/16/15416/6
-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 6
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 10:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/15416/10/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/10/src/kudu/ranger/ranger_client.cc@138
PS10, Line 138: const char* kMainClass = "org.apache.kudu.subprocess.ranger.RangerSubprocessMain";
Can also be declared static?


http://gerrit.cloudera.org:8080/#/c/15416/10/src/kudu/ranger/ranger_client.cc@142
PS10, Line 142:   string exe;
              :   CHECK_OK(Env::Default()->GetExecutablePath(&exe));
              :   const string bin_dir = DirName(exe);
              :   return FLAGS_ranger_jar_path.empty() ? JoinPathSegments(bin_dir, "kudu-subprocess.jar") :
              :          FLAGS_ranger_jar_path;
Could restructure this to early-out if !FLAGS_ranger_path.empty() without executing the rest.


http://gerrit.cloudera.org:8080/#/c/15416/10/src/kudu/ranger/ranger_client.cc@187
PS10, Line 187: FLAGS_ranger_java_path
Should probably call it --ranger_java_path as that's how users will be interacting with it.



-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 10
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Comment-Date: Thu, 19 Mar 2020 05:47:00 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 11: Code-Review+2


-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 11
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Comment-Date: Thu, 19 Mar 2020 19:47:32 +0000
Gerrit-HasComments: No

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 9:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/15416/9/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/9/src/kudu/ranger/ranger_client.cc@172
PS9, Line 172: std::move(FLAGS_keytab_file)
This is static and we shouldn't move it, given it'll be used elsewhere.


http://gerrit.cloudera.org:8080/#/c/15416/9/src/kudu/ranger/ranger_client.cc@173
PS9, Line 173: ;
nit: remove



-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 9
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Comment-Date: Thu, 19 Mar 2020 02:48:15 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hao Hao has removed a vote on this change.

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Removed Verified-1 by Kudu Jenkins (120)
-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 11
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hao Hao has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 11:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/15416/10/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/10/src/kudu/ranger/ranger_client.cc@138
PS10, Line 138: static const char* kMainClass = "org.apache.kudu.subprocess.ranger.RangerSubprocessMain";
> Can also be declared static?
Done


http://gerrit.cloudera.org:8080/#/c/15416/10/src/kudu/ranger/ranger_client.cc@142
PS10, Line 142:   if (FLAGS_ranger_jar_path.empty()) {
              :     string exe;
              :     CHECK_OK(Env::Default()->GetExecutablePath(&exe));
              :     const string bin_dir = DirName(exe);
              :     return JoinPathSegments(bin
> Could restructure this to early-out if !FLAGS_ranger_path.empty() without e
Done


http://gerrit.cloudera.org:8080/#/c/15416/10/src/kudu/ranger/ranger_client.cc@187
PS10, Line 187: { "which", FLAGS_range
> Should probably call it --ranger_java_path as that's how users will be inte
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 11
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Comment-Date: Thu, 19 Mar 2020 19:00:08 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hello Tidy Bot, Attila Bukor, Kudu Jenkins, Andrew Wong, Adar Dembo, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/15416

to look at the new patch set (#9).

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................

[ranger] pass 'principal' and 'keytab' to the subprocess

This patch adds the C++ side change to pass the Kudu principal and
keytab to the Java Ranger subprocess.

Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
---
M src/kudu/ranger/CMakeLists.txt
M src/kudu/ranger/ranger_client.cc
M src/kudu/ranger/ranger_client.h
M src/kudu/security/init.cc
M src/kudu/security/init.h
M src/kudu/server/server_base.cc
6 files changed, 104 insertions(+), 69 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/16/15416/9
-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 9
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Hao Hao (Code Review)" <ge...@cloudera.org>.
Hao Hao has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 9:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/15416/9/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/9/src/kudu/ranger/ranger_client.cc@172
PS9, Line 172: std::move(FLAGS_keytab_file)
> This is static and we shouldn't move it, given it'll be used elsewhere.
Done


http://gerrit.cloudera.org:8080/#/c/15416/9/src/kudu/ranger/ranger_client.cc@173
PS9, Line 173: ;
> nit: remove
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 9
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <ab...@apache.org>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Comment-Date: Thu, 19 Mar 2020 05:30:09 +0000
Gerrit-HasComments: Yes

[kudu-CR] [ranger] pass 'principal' and 'keytab' to the subprocess

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/15416 )

Change subject: [ranger] pass 'principal' and 'keytab' to the subprocess
......................................................................


Patch Set 2:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/15416/2/src/kudu/ranger/ranger_client.cc
File src/kudu/ranger/ranger_client.cc:

http://gerrit.cloudera.org:8080/#/c/15416/2/src/kudu/ranger/ranger_client.cc@150
PS2, Line 150: { FLAGS_java_path, "-cp", GetJavaClasspath(), kMainClass,
             :                 "-i", GetKuduPrincipal(), "-k", FLAGS_keytab_file }
> nit: It feels kind of weird to be passing -i and -k unconditionally.
+1; at the very least, shouldn't we NOT pass these args if Kudu isn't Kerberized?


http://gerrit.cloudera.org:8080/#/c/15416/2/src/kudu/security/init.cc
File src/kudu/security/init.cc:

http://gerrit.cloudera.org:8080/#/c/15416/2/src/kudu/security/init.cc@441
PS2, Line 441:   const auto& kHostToken = "_HOST";
This can be made static.



-- 
To view, visit http://gerrit.cloudera.org:8080/15416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie30b835b6d44ddb51d95c587f1329bfefebeb37c
Gerrit-Change-Number: 15416
Gerrit-PatchSet: 2
Gerrit-Owner: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Hao Hao <ha...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 12 Mar 2020 22:45:25 +0000
Gerrit-HasComments: Yes