You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] occ wrapper does not preserve arguments containing spaces #552
Beyond spaces, this affects any argument containing shell characters. The inner bash -c re-parses everything, so:
--value='p@ss$word!' is stored as p@ss! ($word expands to nothing)
;, | and backticks inside values are executed as shell code (as abc)
Proposed fix: drop the inner shell and pass arguments as mentioned by unknown-error-maker through directly:
sudo -u abc -- php /app/www/public/occ "$@"
What changes:
Call
Before
After
occ config:system:set k --value="hello world"
stores hello
stores hello world
occ config:system:set k --value='p@ss$word!'
stores p@ss!
stores p@ss$word!
occ "maintenance:mode --on" (one string)
works
no longer works
occ maintenance:mode --on
works
works (unchanged)
In my opinion this is the best approach. It's the standard way for a wrapper to pass arguments, it makes occ behave like any other CLI tool, and it removes a whole class of quoting and expansion bugs instead of patching around them. The one-string form only worked as a side effect of the bug, so I'd suggest a changelog note rather than keeping it.
Activity
zaniixx commentedon Nov 22, 2026
Beyond spaces, this affects any argument containing shell characters. The inner
bash -cre-parses everything, so:--value='p@ss$word!'is stored asp@ss!($wordexpands to nothing);,|and backticks inside values are executed as shell code (asabc)Proposed fix: drop the inner shell and pass arguments as mentioned by unknown-error-maker through directly:
sudo -u abc -- php /app/www/public/occ "$@"What changes:
occ config:system:set k --value="hello world"hellohello worldocc config:system:set k --value='p@ss$word!'p@ss!p@ss$word!occ "maintenance:mode --on"(one string)occ maintenance:mode --onIn my opinion this is the best approach. It's the standard way for a wrapper to pass arguments, it makes
occbehave like any other CLI tool, and it removes a whole class of quoting and expansion bugs instead of patching around them. The one-string form only worked as a side effect of the bug, so I'd suggest a changelog note rather than keeping it.