Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Potential compatibility issue: Removing explicit `-s /bin/sh` from su command may break for users with non-POSIX login shells

Đang mở Phù hợp với người mới
#129 0 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
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 AND
  • printf with 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

Mở trong Codespaces

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.

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 gvatsal60/Linux-All-In-One-Update-Script

Tất cả issue của gvatsal60/Linux-All-In-One-Update-Script

Issue tương tự

Thêm issue về Shell/Bash

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.