[BUG] occ wrapper does not preserve arguments containing spaces

Aberta Para iniciantes
#552 1 comentário 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
75/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
bash, docker
Domínio
cli

Direção de pesquisa

Encontre o wrapper do occ que executa php /app/www/public/occ por meio de bash -c e inspecione como ele passa os argumentos. O relatório identifica $* como a origem da divisão dos argumentos e sugere preservar os limites originais ao invocar o OCC. O trabalho estará concluído quando um comando com um valor que contém espaços chegar ao OCC como um único argumento; a issue não indica nenhum teste nem arquivo.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Is there an existing issue for this?
  • I have searched the existing issues
Current Behavior

The occ wrapper uses $* when passing arguments to php occ through bash -c:

sudo -u abc -s /bin/bash -c "php /app/www/public/occ $*"

This causes arguments containing spaces to lose their original argument boundaries when expanded and interpreted by the inner shell.

As a result, commands that pass a single argument containing spaces may behave incorrectly because the argument gets split into multiple arguments.

Expected Behavior

The wrapper should preserve the original argument boundaries, including arguments containing spaces, quotes, and special characters.

Using "$@" instead of $* would preserve the individual arguments. Ideally, the additional bash -c invocation should also be avoided.

For example:

sudo -u abc -- php /app/www/public/occ "$@"
Steps To Reproduce
  1. Run the LinuxServer Nextcloud container.
  2. Execute an OCC command with an argument containing spaces:
occ config:app:set myapp setting --value="hello world"
  1. Observe that the argument is split into multiple arguments when passed to the underlying OCC command.
  2. Compare with the expected behaviour, where hello world should be passed as a single argument.
Environment
- OS: debian trixie
- How docker service was installed: https://get.docker.com
CPU architecture

arm64

Docker creation
not relevant
Container logs
not relevant
Linguagem predominante
Dockerfile
Estrelas
898
Forks
143
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de linuxserver/docker-nextcloud

Todas as issues de linuxserver/docker-nextcloud

Issues semelhantes

Mais issues de CLI

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.