Potential compatibility issue: Removing explicit `-s /bin/sh` from su command may break for users with non-POSIX login shells
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
- 78/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ệ
- shell
- Lĩnh vực
- operating-systems
Hướng nghiên cứu
Xác định biến _brew_cmds và lời gọi su trong script hiện tại, sau đó so sánh chúng với thay đổi được thảo luận trong PR #128. Xác minh đường dẫn lệnh bằng một shell đăng nhập không POSIX và một shell POSIX; được xem là hoàn tất khi lệnh hạ quyền chạy rõ ràng và đáng tin cậy cú pháp shell POSIX cho cả hai cấu hình người dùng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Issue Description
In PR #128, the su command used to drop privileges for running Homebrew commands was simplified by removing the explicit shell specification (-s /bin/sh). This change may break compatibility for users with non-POSIX login shells (e.g., fish, nushell, csh, tcsh).
Technical Details
The _brew_cmds variable contains POSIX shell syntax including:
eval- $() command substitution
&&logical ANDprintfwith format strings
When su - ${NON_ROOT_USER} -c ${_brew_cmds} is used without -s /bin/sh, it invokes the user's login shell. If that shell is non-POSIX (like fish or nushell), the POSIX syntax in _brew_cmds will fail.
Original Code (with explicit shell)
su - ${NON_ROOT_USER} -s /bin/sh -c ${_brew_cmds}
Current Code (without explicit shell)
su - ${NON_ROOT_USER} -c ${_brew_cmds}
Recommended Fix
Restore -s /bin/sh to guarantee POSIX compliance, or use sh -c explicitly.
Context
This was flagged in the code review for PR #128 by the Kilo Code bot. The review comment can be found at: https://github.com/gvatsal60/Linux-All-In-One-Update-Script/pull/128#discussion_r4118722195
Labels: bug, compatibility, shell
PR Signature to include in the PR description:
If you create a pull request or merge request, include the following signature at the end of the PR/MR description:
Built for gvatsal60 by Kilo
- Ngôn ngữ chính
- Shell
- Star
- 5
- Fork
- 1
- Merge trung bình
- 25 phút
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của gvatsal60/Linux-All-In-One-Update-Script
-
Support for opensuse linuxĐang mởenhancement good first issue
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
gvatsal60/Linux-All-In-One-Update-Script#30 · 1 người được giao ·
Tất cả issue của gvatsal60/Linux-All-In-One-Update-Script
Issue tương tự
-
Update cliamp to 2.3.0Đang mởpackage-update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
oSoWoSo/vOid_Community_repOsitory#203 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] v-quick-install-app install crashes with ValueError if no supported PHP version is installedĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
chore
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
alunduil/alunduil-chezmoi#809 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
catppuccin/kde#152 ·