Merge pull request #7979 from DDDHuang/bad_node_name
fix(conf): check node name, otp regular expression
This commit is contained in:
commit
04b02b7b6f
|
@ -32,6 +32,7 @@ File format:
|
||||||
* Improved resilience against autocluster partitioning during cluster
|
* Improved resilience against autocluster partitioning during cluster
|
||||||
startup. [#7876]
|
startup. [#7876]
|
||||||
[ekka-158](https://github.com/emqx/ekka/pull/158)
|
[ekka-158](https://github.com/emqx/ekka/pull/158)
|
||||||
|
* Add regular expression check ^[0-9A-Za-z_\-]+$ for node name [#7979]
|
||||||
|
|
||||||
## v4.3.14
|
## v4.3.14
|
||||||
|
|
||||||
|
|
4
bin/emqx
4
bin/emqx
|
@ -488,6 +488,10 @@ fi
|
||||||
NAME_TYPE="$(echo "$NAME_ARG" | awk '{print $1}')"
|
NAME_TYPE="$(echo "$NAME_ARG" | awk '{print $1}')"
|
||||||
NAME="$(echo "$NAME_ARG" | awk '{print $2}')"
|
NAME="$(echo "$NAME_ARG" | awk '{print $2}')"
|
||||||
NODENAME="$(echo "$NAME" | awk -F'@' '{print $1}')"
|
NODENAME="$(echo "$NAME" | awk -F'@' '{print $1}')"
|
||||||
|
if ! (echo "$NODENAME" | grep -q '^[0-9A-Za-z_\-]\+$'); then
|
||||||
|
echo "Invalid node name, should be of format '^[0-9A-Za-z_-]+$'."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
export ESCRIPT_NAME="$NODENAME"
|
export ESCRIPT_NAME="$NODENAME"
|
||||||
|
|
||||||
PIPE_DIR="${PIPE_DIR:-/$RUNNER_DATA_DIR/${WHOAMI}_erl_pipes/$NAME/}"
|
PIPE_DIR="${PIPE_DIR:-/$RUNNER_DATA_DIR/${WHOAMI}_erl_pipes/$NAME/}"
|
||||||
|
|
Loading…
Reference in New Issue