Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
mariadb/skysql-enterprise-columnstore-handoff sky-1.5.4-1
Description
Custom cmapi keys that contain the '&' character might not be parsed correctly by sed in scripts/columnstore-init (line 57) causing the ColumnStore cluster to not be initializable.
Failure example:
jens@ubuntu18:~/hi$ CMAPI_KEY='Uuq!=6NZ.x?&6RlS!YsU=0mo=g6g-144'
|
jens@ubuntu18:~/hi$ cat <<EOF > cmapi_server.conf
|
> [global]
|
> server.socket_host = '0.0.0.0'
|
> server.socket_port = 8640
|
> server.ssl_module = 'builtin'
|
> server.ssl_certificate = './cmapi_server/self-signed.crt'
|
> server.ssl_private_key = './cmapi_server/self-signed.key'
|
> engine.autoreload.on = False
|
> log.access_file = ''
|
> log.error_file = ''
|
>
|
> [Authentication]
|
> x-api-key =
|
>
|
> #[Privileges]
|
> #use_sudo = True
|
>
|
> [Dispatcher]
|
> name = 'container'
|
> path = '/opt/cmapi/mcs_node_control/custom_dispatchers/container.sh'
|
> EOF
|
jens@ubuntu18:~/hi$ sed -i "s|^x-api-key.*|x-api-key = '$CMAPI_KEY'|" cmapi_server.conf
|
jens@ubuntu18:~/hi$ cat cmapi_server.conf | grep x-api-key
|
x-api-key = 'Uuq!=6NZ.x?x-api-key =6RlS!YsU=0mo=g6g-144'
|
jens@ubuntu18:~/hi$
|
#!/bin/bash
|
CMAPI_KEY='Uuq!=6NZ.x?&6RlS!YsU=0mo=g6g-144' |
cat <<EOF > cmapi_server.conf |
[global]
|
server.socket_host = '0.0.0.0' |
server.socket_port = 8640
|
server.ssl_module = 'builtin' |
server.ssl_certificate = './cmapi_server/self-signed.crt' |
server.ssl_private_key = './cmapi_server/self-signed.key' |
engine.autoreload.on = False
|
log.access_file = '' |
log.error_file = '' |
|
[Authentication]
|
x-api-key =
|
|
#[Privileges]
|
#use_sudo = True
|
|
[Dispatcher]
|
name = 'container' |
path = '/opt/cmapi/mcs_node_control/custom_dispatchers/container.sh' |
EOF
|
sed -i "s|^x-api-key.*|x-api-key = '$CMAPI_KEY'|" cmapi_server.conf |
cat cmapi_server.conf | grep x-api-key |
Proposed fix:
Use
sed -i "s|^x-api-key.*|x-api-key = '${CMAPI_KEY//&/\\&}'|" /etc/columnstore/cmapi_server.conf
|
instead.
Success example:
jens@ubuntu18:~/hi$ CMAPI_KEY='Uuq!=6NZ.x?&6RlS!YsU=0mo=g6g-144'
|
jens@ubuntu18:~/hi$ cat <<EOF > cmapi_server.conf
|
> [global]
|
> server.socket_host = '0.0.0.0'
|
> server.socket_port = 8640
|
> server.ssl_module = 'builtin'
|
> server.ssl_certificate = './cmapi_server/self-signed.crt'
|
> server.ssl_private_key = './cmapi_server/self-signed.key'
|
> engine.autoreload.on = False
|
> log.access_file = ''
|
> log.error_file = ''
|
>
|
> [Authentication]
|
> x-api-key =
|
>
|
> #[Privileges]
|
> #use_sudo = True
|
>
|
> [Dispatcher]
|
> name = 'container'
|
> path = '/opt/cmapi/mcs_node_control/custom_dispatchers/container.sh'
|
> EOF
|
jens@ubuntu18:~/hi$ sed -i "s|^x-api-key.*|x-api-key = '${CMAPI_KEY//&/\\&}'|" cmapi_server.conf
|
jens@ubuntu18:~/hi$ cat cmapi_server.conf | grep x-api-key
|
x-api-key = 'Uuq!=6NZ.x?&6RlS!YsU=0mo=g6g-144'
|
jens@ubuntu18:~/hi$
|
#!/bin/bash
|
CMAPI_KEY='Uuq!=6NZ.x?&6RlS!YsU=0mo=g6g-144' |
cat <<EOF > cmapi_server.conf |
[global]
|
server.socket_host = '0.0.0.0' |
server.socket_port = 8640
|
server.ssl_module = 'builtin' |
server.ssl_certificate = './cmapi_server/self-signed.crt' |
server.ssl_private_key = './cmapi_server/self-signed.key' |
engine.autoreload.on = False
|
log.access_file = '' |
log.error_file = '' |
|
[Authentication]
|
x-api-key =
|
|
#[Privileges]
|
#use_sudo = True
|
|
[Dispatcher]
|
name = 'container' |
path = '/opt/cmapi/mcs_node_control/custom_dispatchers/container.sh' |
EOF
|
sed -i "s|^x-api-key.*|x-api-key = '${CMAPI_KEY//&/\\&}'|" cmapi_server.conf |
cat cmapi_server.conf | grep x-api-key |