Skip to content

Conversation

nickva
Copy link
Contributor

@nickva nickva commented Mar 26, 2025

Previously, values which were parsed from vm.args retained their single quotes when db_set. Later on, in the postinst script, when we replace values in vm.args they got another layer of single quotes.

Fix: #178

@nickva nickva requested a review from rnewson March 26, 2025 03:55
@rnewson
Copy link
Member

rnewson commented Mar 26, 2025

do you mean alias stripquote="sed -e 's/^\x27*//' -e 's/\x27*$//'" to remove all the single quotes front and back? currently it just removes one set.

@nickva nickva force-pushed the fix-repeated-single-quoting branch from e7148ec to dba0a2d Compare March 26, 2025 15:34
@nickva
Copy link
Contributor Author

nickva commented Mar 26, 2025

do you mean alias stripquote="sed -e 's/^\x27*//' -e 's/\x27*$//'" to remove all the single quotes front and back? currently it just removes one set.

Yes! Good catch, updated the PR

@rnewson
Copy link
Member

rnewson commented Mar 26, 2025

and change sed -i "/^-name/c\-name ${nodename}" /opt/couchdb/etc/vm.args in couchdb.postinst to sed -i "/^-name/c\-name '${nodename}'" /opt/couchdb/etc/vm.args, I think?

that is, ensure $nodename has no single quotes before/after and then set a single pair when we rewrite the -name line.

@nickva nickva force-pushed the fix-repeated-single-quoting branch from dba0a2d to 4b17f08 Compare March 26, 2025 16:03
@nickva
Copy link
Contributor Author

nickva commented Mar 26, 2025

and change sed -i "/^-name/c-name ${nodename}" /opt/couchdb/etc/vm.args in couchdb.postinst to sed -i "/^-name/c-name '${nodename}'" /opt/couchdb/etc/vm.args, I think?

Good idea, updated

Previously, values which were parsed from vm.args retained their
single quotes when db_set. Later on, in the postinst script, when we
replace values in vm.args they got another layer of single quotes.

Also update nodename vm.args write to have single quotes

Fix: #178
@nickva nickva force-pushed the fix-repeated-single-quoting branch from 4b17f08 to d4cdabe Compare March 27, 2025 07:12
@nickva nickva merged commit 14a2c5f into main Mar 27, 2025
@nickva nickva deleted the fix-repeated-single-quoting branch March 27, 2025 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Erlang cookie get quoted multiple times
2 participants