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
This commit is contained in:
Spaceman1984 2021-05-04 19:39:19 +02:00 committed by GitHub
parent 4df8d7ade3
commit 7a7fd27350
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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')