nickva commented on PR #106:
URL: https://github.com/apache/couchdb-pkg/pull/106#issuecomment-1403154163

   Testing with 
[1b18b7c](https://github.com/apache/couchdb-pkg/commit/1b18b7cc18daf160c1618c203de0e6dfc616ccdf)
   
   RPM on CentOS 7 works as expected:
   
   Random new cookie:
   ```
   [root@nvcentos7 ~]# rpm -i couchdb-3.3.1.1.1-1.el7.x86_64.rpm 
   Generating random cookie value.
   [root@nvcentos7 ~]# grep setcookie /opt/couchdb/etc/vm.args 
   -setcookie '2MJoDeihWIblBBbSjiHAP5efEr5t8UoTCoiNLNBgf5Ju3Ry8'
   ```
   
   Custom cookie:
   ```
   [root@nvcentos7 ~]# export COUCHDB_COOKIE='a 
b\n\t\xd#{}()[]$&^!-=+?|//c\\d\\\e\\\\f'
   [root@nvcentos7 ~]# rpm -i couchdb-3.3.1.1.1-1.el7.x86_64.rpm 
   Using defined COUCHDB_COOKIE value.
   [root@nvcentos7 ~]# grep setcookie /opt/couchdb/etc/vm.args 
   -setcookie 'a b\n\t\xd#{}()[]$&^!-=+?|//c\\d\\\e\\\\f'
   ```
   
   remsh didn't work but that's expected, I re-wrote bin/remsh to use a similar 
vm.args file with just the `-setcookie` to be able to log in to verify that the 
cookie was set instead of being silently replaced with a weak default one:
   
   ```
   > erlang:get_cookie().
   'a b\\n\\t\\xd#{}()[]$&^!-=+?|//c\\\\d\\\\\\e\\\\\\\\f'
   
   > io:format("~s~n", [erlang:get_cookie()]).
   a b\n\t\xd#{}()[]$&^!-=+?|//c\\d\\\e\\\\f
   ok
   ```
   
   Works on Debian Buster
   
   Install dialog: `a b\n\t\xd#{}()[]$&^!-=+?|//c\\d\\\e\\\\f`
   
   ```
   sudo grep setcookie /opt/couchdb/etc/vm.args
   -setcookie 'a b\n\t\xd#{}()[]$&^!-=+?|//c\\d\\\e\\\\f'
   ```
   
   We'll have to fix remsh cookie parsing in the main repo before the next 
release. But cookie prompt and replacement in this repo works well. Thanks for 
the fix!
   
   +1
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to