Feature option values are changed before install.sh sees them: quotes are stripped, and `$…` is expanded or executed
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- Meio dia
- Facilidade para iniciantes
- 45/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- shell, typescript
- Domínio
- cli, developer-experience
Direção de pesquisa
Start in getFeatureEnvVariables in src/spec-node/containerFeatures.ts, which writes each option as NAME="value" without escaping, and compare it with escapeQuotesForShell, which the issue says already handles the wrapper's Options echo. Reproduce with the local ./echo-opt Feature from the issue, where the value contains quotes, $HOME and $(id -un). Done means the printed value matches the configured string exactly, values with spaces still work, and the behaviour change for $ expansion is either accepted or handled, which needs a maintainer decision first.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Problem
A Feature can receive a different string option value from the one configured in
devcontainer.json. Quotes are removed, $VAR is expanded, $(…) and backticks are executed, and backslashes are consumed. The build still succeeds, so nothing
signals that the value changed.
Repro (devcontainer CLI 0.89.0)
A local Feature with one string option, value, whose install.sh prints it:
#!/bin/sh
printf '%s\n' "$VALUE"
"features": { "./echo-opt": { "value": "say \"hi\" to $HOME as $(id -un)" } }
- Expected:
say "hi" to $HOME as $(id -un) - Actual:
say hi to /root as root
A value with a space inside quotes, such as A="two words", fails the build instead,
with devcontainer-features.env: line 1: words: not found.
Cause
getFeatureEnvVariables (src/spec-node/containerFeatures.ts) writes each option as
NAME="value" without escaping. The install wrapper then sources the file
(set -a; . ./devcontainer-features.env), so the shell interprets the value. Issue #148
and PR #149 fixed this for spaces, but not for ", $, backticks or \.
Suggested fix
Write each value in single quotes, with ' escaped as '\''. That's what
escapeQuotesForShell already does for the wrapper's Options echo. This changes
behaviour for anyone relying on $ being expanded in option values today.
- Linguagem predominante
- TypeScript
- Estrelas
- 3k
- Forks
- 462
- Merge médio
- 13h 28min
- PRs com merge (30d)
- 2
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Sem 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 devcontainers/cli
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
devcontainers/cli#1325 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
devcontainers/cli#1203 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 68/100
devcontainers/cli#1178 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
`devcontainer build` fails on Buildx 0.37.2 because the generated Dockerfile is outside the Compose bake contextTalvez já em andamento @v-Kaniska244 assumiu há 4 dias. Aberta
devcontainers/cli#1320 · 2 reações · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
devcontainers/cli#1319 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de devcontainers/cli
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Agenta-AI/agenta#7542 · 1 comentário · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
code quality security
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
enhancement good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 90/100
-
feat(icons): add [solidping]Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
homarr-labs/dashboard-icons#2939 ·
Mantenedores costumam responder em até 1 dia