Skip to content

Commit d1178b7

Browse files
committed
MB-53550 [BP] Don't leak cookie in master-password
Instead set it as an enviornment variable and use `-eval` to set it from the variable. Change-Id: I453dcc7d62995cc4dd91792e69eda68c100a9b53 Reviewed-on: https://review.couchbase.org/c/couchbase-cli/+/172295 Tested-by: Build Bot <build@couchbase.com> Reviewed-by: James Lee <james.lee@couchbase.com> Well-Formed: Restriction Checker Reviewed-on: https://review.couchbase.org/c/couchbase-cli/+/182192 Reviewed-by: Maksimiljans Januska <maks.januska@couchbase.com>
1 parent a74d9a0 commit d1178b7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cbmgr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,11 +1509,11 @@ def prompt_for_master_pwd(self, node, cookie, password, cb_cfg_path):
15091509
'-proto_dist', 'cb',
15101510
'-epmd_module', 'cb_epmd',
15111511
'-kernel', 'inetrc', f'"{inetrc_file}"', 'dist_config_file', f'"{dist_cfg_file}"',
1512-
'-setcookie', cookie,
1512+
'-eval' 'erlang:set_cookie(list_to_atom(os:getenv("CB_COOKIE"))).',
15131513
'-run', 'encryption_service', 'remote_set_password', node,
15141514
]
15151515

1516-
rc, out, err = self.run_process("erl", args, extra_env={'SETPASSWORD': password})
1516+
rc, out, err = self.run_process("erl", args, extra_env={'SETPASSWORD': password, 'CB_COOKIE': cookie})
15171517
if rc == 0:
15181518
print("SUCCESS: Password accepted. Node started booting.")
15191519
elif rc == 101:

0 commit comments

Comments
 (0)