rabbitmq / rabbitmq-common

Common library used by rabbitmq-server and rabbitmq-erlang-client
Other
66 stars 112 forks source link

rabbit_env: Fix parsing of $CONF_ENV_FILE output #417

Closed dumbbell closed 4 years ago

dumbbell commented 4 years ago

The set command in the implementation of /bin/sh included in the official RabbitMQ Docker image returns multi-line variable values differently than the tested Bourne shell implementation (GNU Bash, dash and FreeBSD sh).

I don't know what implementation is used by that Docker image, but here is the output of set, for a variable set to "\n'test'":

TEST_VAR='
'"'"'test'"'"

The problem was reported in the following discussion: https://github.com/rabbitmq/rabbitmq-server/discussions/2458

While here, add a small testcase to check a couple outputs.

lukebakken commented 4 years ago

Since you have Docker up and running, can you see what shell and version is being used for /bin/sh? I just set /bin/sh to dash on my workstation but I don't see the funky output :man_shrugging:

dumbbell commented 4 years ago

Since you have Docker up and running, can you see what shell and version is being used for /bin/sh? I just set /bin/sh to dash on my workstation but I don't see the funky output man_shrugging

I just verified and it's dash indeed, from some version of Ubuntu I guess. I never saw that output on the different versions of Debian I tested.

lukebakken commented 4 years ago

Interesting. It must be fixed in the version I'm using.