[BUG] occ wrapper does not preserve arguments containing spaces

未关闭 适合新手
#552 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
75/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
bash, docker
领域
cli

调研方向

找到通过 bash -c 运行 php /app/www/public/occ 的 occ 包装器,并检查它如何传递参数。报告指出 $* 是参数拆分的原因,并建议在调用 OCC 时保留原始参数边界。当包含空格的值作为一个参数传递到 OCC 时,即为完成;该 issue 没有指定测试或文件。

由索引模型根据 Issue 内容生成。

描述

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
主要语言
Dockerfile
星标
898
派生
143
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

linuxserver/docker-nextcloud 的其他 Issue

查看 linuxserver/docker-nextcloud 的全部 Issue

相似的 Issue

更多 CLI Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。