cloudstack-setup-databases doesn't parse password input properly
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 72/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Domínio
- databases, infrastructure
Direção de pesquisa
Start at the cloudstack-setup-databases entry point and trace how the password is assembled for EncryptionCLI and passed through /bin/sh. Reproduce with the provided password containing $, then verify that the decrypted value remains intact and that other special characters mentioned in the issue are handled correctly.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
problem
While running cloudstack-setup-databases, if it is called with any password containing a $, the password gets truncated at the $ before being passed to EncryptionCLI, thus storing an incorrect encrypted password in db.properties.
versions
This was discovered while executing cloudstack-setup-databases on a clean install of 4.23.
The steps to reproduce the bug
- Call
cloudstack-setup-databases cloud:'pa$sword'@localhost --deploy-as=root:'pa$sword' - Decrypt what was stored in db.properties and note the output is only
pa:
# java -classpath /usr/share/cloudstack-common/lib/cloudstack-utils.jar com.cloud.utils.crypt.EncryptionCLI -d -i "4dfIlH8M/ydVp+mYjIBr7S1plQDzsOzmKt2jAeGW" -p "password"
pa
What to do about it?
This seems to be a parsing issue in cloudstack-setup-databases. The password is getting to the script correctly because it is able to us it in mysql with mysqlCmds.append('--password=\'%s\''%kwargs['passwd']) and this part of the script succeeds.
But then when it assembles the encrypt command to go to the CLI, it wraps that password in double quotes:
cmd = ['java','-classpath','"' + self.encryptionJarPath + '"','com.cloud.utils.crypt.EncryptionCLI','-i','"' + value + '"', '-p', '"' + self.mgmtsecretkey + '"', self.encryptorVersion]
and then sends it through /bin/sh here (shell=True):
subprocess.Popen(' '.join(cmds), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
In doing so, sh will expand the variable $sword to nothing. I haven't tested, but presumably things like \, ", and ' might also be a problem.
- Linguagem predominante
- Java
- Estrelas
- 3.1k
- Forks
- 1.4k
- Merge médio
- 6d 3h
- PRs com merge (30d)
- 16
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de apache/cloudstack
-
listPublicIpAddresses NullPointerException on shared networks with a VR (4.22)Talvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 80/100
apache/cloudstack#14248 ·
Mantenedores costumam responder em até 1 dia
-
CKS: upgradeKubernetesCluster fails on control node when binaries ISO ships headlamp.yaml instead of dashboard.yamlTalvez já em andamento @mw-0 assumiu há 9 dias. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
apache/cloudstack#14244 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Resize volume API validation errors are not displayed in the UITalvez já em andamento @sathvikaragi assumiu há 12 dias. Abertabug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
apache/cloudstack#14222 ·
Mantenedores costumam responder em até 1 dia
-
create-kubernetes-binaries-iso.sh builds the ISO without setting a volume ID on EL8 based os'sAbertabug component:kubernetes
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
apache/cloudstack#14180 ·
Mantenedores costumam responder em até 1 dia
-
bug component:projects component:UI
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
apache/cloudstack#14070 · 5 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de apache/cloudstack
Issues semelhantes
-
[Bug] The shared instance selector's placeholder and no-match text ignore the display languageTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 90/100
apache/rocketmq-dashboard#5561 ·
Mantenedores costumam responder em até 3 dias
-
test(setup): GitHub configuration tests fail when the temp path is long enough for YAML foldingAbertabug good first issue help wanted priority medium size S
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
martin-francois/symphony-trello#776 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Console.printHexAbertagood first issue kernel
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
JackFurton/who-would-build-a-kernel-in-java#33 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
flutter/flutter-intellij#9137 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia