[BUG] occ wrapper does not preserve arguments containing spaces

Đang mở Phù hợp với người mới
#552 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
75/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
bash, docker
Lĩnh vực
cli

Hướng nghiên cứu

Tìm wrapper occ chạy php /app/www/public/occ thông qua bash -c và kiểm tra cách nó truyền các đối số. Báo cáo xác định $* là nguyên nhân khiến các đối số bị tách và đề xuất giữ nguyên ranh giới ban đầu khi gọi OCC. Công việc hoàn tất khi một lệnh có giá trị chứa khoảng trắng đến được OCC dưới dạng một đối số duy nhất; issue không nêu tên bài kiểm thử hay tệp nào.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Dockerfile
Star
898
Fork
143
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của linuxserver/docker-nextcloud

Tất cả issue của linuxserver/docker-nextcloud

Issue tương tự

Thêm issue về CLI

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.