summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorILYA Khlopotov <iilyak@apache.org>2020-07-29 07:11:06 -0700
committerILYA Khlopotov <iilyak@apache.org>2021-03-24 05:58:45 -0700
commite630c44e890280d865bf45f80a5fca12ac7f7326 (patch)
treeeba1ff575e648d3282645d065a5cf86e78c4d097
parente9f5cc6229890b8231e1261a694eaa6305c69d3f (diff)
downloadcouchdb-e630c44e890280d865bf45f80a5fca12ac7f7326.tar.gz
Do not log admin credentials
-rw-r--r--rebar.config.script2
-rw-r--r--src/chttpd/src/chttpd_node.erl4
-rw-r--r--src/setup/src/setup.erl2
3 files changed, 5 insertions, 3 deletions
diff --git a/rebar.config.script b/rebar.config.script
index e37a43257..f12ef3842 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -144,7 +144,7 @@ SubDirs = [
DepDescs = [
%% Independent Apps
-{config, "config", {tag, "2.1.7"}},
+{config, "config", {tag, "2.1.8"}},
{b64url, "b64url", {tag, "1.0.2"}},
{ets_lru, "ets-lru", {tag, "1.1.0"}},
{khash, "khash", {tag, "1.1.0"}},
diff --git a/src/chttpd/src/chttpd_node.erl b/src/chttpd/src/chttpd_node.erl
index 734c49bd7..c48dfc09a 100644
--- a/src/chttpd/src/chttpd_node.erl
+++ b/src/chttpd/src/chttpd_node.erl
@@ -71,7 +71,9 @@ handle_node_req(#httpd{method='PUT', path_parts=[_, Node, <<"_config">>, Section
Value = couch_util:trim(chttpd:json_body(Req)),
Persist = chttpd:header_value(Req, "X-Couch-Persist") /= "false",
OldValue = call_node(Node, config, get, [Section, Key, ""]),
- case call_node(Node, config, set, [Section, Key, ?b2l(Value), Persist]) of
+ IsSensitive = Section == <<"admins">>,
+ Opts = #{persist => Persist, sensitive => IsSensitive},
+ case call_node(Node, config, set, [Section, Key, ?b2l(Value), Opts]) of
ok ->
send_json(Req, 200, list_to_binary(OldValue));
{error, Reason} ->
diff --git a/src/setup/src/setup.erl b/src/setup/src/setup.erl
index e681864c7..5129765da 100644
--- a/src/setup/src/setup.erl
+++ b/src/setup/src/setup.erl
@@ -165,7 +165,7 @@ enable_cluster_int(Options, false) ->
couch_log:debug("Enable Cluster: ~p~n", [Options]).
set_admin(Username, Password) ->
- config:set("admins", binary_to_list(Username), binary_to_list(Password)).
+ config:set("admins", binary_to_list(Username), binary_to_list(Password), #{sensitive => true}).
setup_node(NewCredentials, NewBindAddress, NodeCount, Port) ->
case NewCredentials of