Adar Dembo has posted comments on this change.

Change subject: KUDU-1898: /varz page doesn't HTML-escape flag values
......................................................................


Patch Set 1:

(5 comments)

http://gerrit.cloudera.org:8080/#/c/6173/1//COMMIT_MSG
Commit Message:

PS1, Line 9: fix
Nit: fixes


http://gerrit.cloudera.org:8080/#/c/6173/1/src/kudu/util/flag_tags-test.cc
File src/kudu/util/flag_tags-test.cc:

Line 120: TEST_F(FlagTagsTest, TestSensitiveFlags) {
Maybe we can augment this to also call CommandLineFlagsIntoString(true) and 
verify that the redaction brackets are escaped?


http://gerrit.cloudera.org:8080/#/c/6173/1/src/kudu/util/flags.cc
File src/kudu/util/flags.cc:

PS1, Line 420: // Redact the flag tagged as 'sensitive', if --redact is set
             : // with 'flag'. Otherwise, return its value as-is. If 
should_escape_html
             : // is true, return html escaped string.
Nit: we don't typically write function-level comments like these in the .cc 
file for "public" functions; we only put them in the .h file.


Line 424:   string ret_value;
FWIW, 'retval' is a fine variable name (you can grep for it and see it used all 
over); it's just retVal that's no good.


http://gerrit.cloudera.org:8080/#/c/6173/1/src/kudu/util/flags.h
File src/kudu/util/flags.h:

Line 56: std::string CommandlineFlagsIntoString(bool should_escape_html);
Nit: the problem with boolean command line arguments is that it's tough to 
understand what they mean when you're just looking at a call-site. In such 
cases, we like to use enums. Take a look at util/env.h for some examples of 
two-state enums.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I64ebb0befe6bacb0fc90d50a1e34870656041a01
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Hao Hao <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-HasComments: Yes

Reply via email to