[BUG] occ wrapper does not preserve arguments containing spaces
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- bash, docker
- Domain
- cli
Research direction
Find the occ wrapper that runs php /app/www/public/occ through bash -c and inspect how it passes its arguments. The report identifies $* as the source of argument splitting and suggests preserving the original boundaries while invoking OCC. Done means a command with a value containing spaces reaches OCC as one argument; the issue does not name a test or file.
Written by the indexing model from the issue text.
Description
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
- Run the LinuxServer Nextcloud container.
- Execute an OCC command with an argument containing spaces:
occ config:app:set myapp setting --value="hello world"
- Observe that the argument is split into multiple arguments when passed to the underlying OCC command.
- 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
- Dominant language
- Dockerfile
- Stars
- 899
- Forks
- 143
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from linuxserver/docker-nextcloud
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
linuxserver/docker-nextcloud#551 · 4 comments ·
-
[BUG] High CPU usage at random momentsPossibly taken @mauro2306 claimed this 91 days ago. Openno-issue-activity
Difficulty 5/5 Over a week Newbie friendliness 30/100
linuxserver/docker-nextcloud#539 · 43 comments · 4 reactions ·
All issues in linuxserver/docker-nextcloud
Similar issues
-
Needs Triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Support FORCE_COLOROpenenhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
bug release-blocker
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
tonydzi/sqlite-graph-memory#133 · 1 comment ·
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100