[MCOL-4773] columnstoreAlias script breaks on x-api-key containing '=' characters Created: 2021-06-23  Updated: 2021-12-10  Resolved: 2021-08-09

Status: Closed
Project: MariaDB ColumnStore
Component/s: cmapi, installation
Affects Version/s: 5.6.1
Fix Version/s: 5.6.3, 6.2.1

Type: Bug Priority: Minor
Reporter: Ben Thompson (Inactive) Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: None


 Description   

mcsapikey=$(grep -r 'x-api-key' /etc/columnstore/cmapi_server.conf | cut -d= -f2 | xargs)

The cut -d= is meant to seperate the key/value to store as variable in script
This line does not handle if the x-api-key value contains an actual '=' characters and will break the commands giving 401 errors.

Command should be modified to the following

mcsapikey=$(grep -r 'x-api-key' /etc/columnstore/cmapi_server.conf | cut -d= -f2- | xargs)



 Comments   
Comment by Daniel Lee (Inactive) [ 2021-08-09 ]

Build verified: 6.2.1-1 (#2924)

Reproduced the issue in 5.6.1-1

[centos8:root~]# mcsapikey=$(grep -r 'x-api-key' /etc/columnstore/cmapi_server.conf | cut -d= -f2 | xargs)
xargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option

In 6.2.1-1

With a 3pm installation, manually inserted an '=' character into the x-api-key in the /etc/columnstore/cmapi_server.cnf file.

Verified:
1. columnstoreAlias script
2. execution of script

Generated at Thu Feb 08 02:52:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.