Skip to content

Commit f997153

Browse files
committed
MB-51835 Fix 'master-password' and 'server-eshell' crashing server
The issue has been introduced as a result of a backport (MB-49557), in later versions we use call 'set_cookie/1', which is not implemented in Erlang OTP-22 that is used in 'cheshire-cat' versions. The solution to this is to call 'set_cookie/2' instead. The incorrect call to 'set_cookie/1' is done for two CLI sub-commands: 'master-password' and 'server-eshell', and this fix addresses both. Change-Id: Iad2317e83a313db68d53fbd0da1f5d93afb42870 Reviewed-on: https://review.couchbase.org/c/couchbase-cli/+/173808 Well-Formed: Restriction Checker Reviewed-by: James Lee <james.lee@couchbase.com> Tested-by: Build Bot <build@couchbase.com>
1 parent 11a4f9f commit f997153

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
@@ -1550,7 +1550,7 @@ def prompt_for_master_pwd(self, node, cookie, password, cb_cfg_path):
15501550

15511551
name = 'executioner@cb.local'
15521552
args = ['-pa', CB_NS_EBIN_PATH, CB_BABYSITTER_EBIN_PATH, '-noinput', '-name', name, '-proto_dist', 'cb',
1553-
'-eval', 'erlang:set_cookie(list_to_atom(os:getenv("CB_COOKIE"))).', '-epmd_module', 'cb_epmd',
1553+
'-eval', 'erlang:set_cookie(node(), list_to_atom(os:getenv("CB_COOKIE"))).', '-epmd_module', 'cb_epmd',
15541554
'-kernel'] + CB_INETRC_OPT + \
15551555
['dist_config_file', f'"{dist_cfg_file}"', '-run', 'encryption_service',
15561556
'remote_set_password', node]
@@ -1944,7 +1944,7 @@ def execute(self, opts):
19441944
env["CB_COOKIE"] = cookie
19451945

19461946
args = [path, '-name', name, '-setcookie', 'nocookie', '-hidden', '-eval',
1947-
'erlang:set_cookie(list_to_atom(os:getenv("CB_COOKIE"))).',
1947+
'erlang:set_cookie(node(), list_to_atom(os:getenv("CB_COOKIE"))).',
19481948
'-remsh', node, '-proto_dist', 'cb', '-epmd_module', 'cb_epmd', '-pa', CB_NS_EBIN_PATH, '-kernel',
19491949
'dist_config_file', f'"{temp_name}"'] + CB_INETRC_OPT
19501950

0 commit comments

Comments
 (0)