From 7a7fd27350397e12f8d54ab89e65e8b8dd9f9b92 Mon Sep 17 00:00:00 2001 From: Spaceman1984 <49917670+Spaceman1984@users.noreply.github.com> Date: Tue, 4 May 2021 19:39:19 +0200 Subject: [PATCH] setup: Fixed error when passing shell reserved characters to setup databases (#4995) * Fixed error when passing shell reserved charaters to setup databases script for dbsecret * Moved quote to encrypt method --- setup/bindir/cloud-setup-databases.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/bindir/cloud-setup-databases.in b/setup/bindir/cloud-setup-databases.in index bd23c2ba6ad..b2ed74ade9f 100755 --- a/setup/bindir/cloud-setup-databases.in +++ b/setup/bindir/cloud-setup-databases.in @@ -26,6 +26,7 @@ import string from optparse import OptionParser import subprocess import shutil +import shlex import socket # squelch mysqldb spurious warnings @@ -399,7 +400,7 @@ for example: return 'ENC(%s)'%value def encryptDBSecretKey(): - self.putDbProperty('db.cloud.encrypt.secret', formatEncryptResult(encrypt(self.dbsecretkey))) + self.putDbProperty('db.cloud.encrypt.secret', formatEncryptResult(encrypt(shlex.quote(self.dbsecretkey)))) def encryptDBPassword(): dbPassword = self.getDbProperty('db.cloud.password')