Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#129 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
shell

調査の方向性

現在のスクリプトで変数 _brew_cmds と su の呼び出しを特定し、PR #128 で議論されている変更と比較します。非 POSIX のログインシェルと POSIX シェルでコマンドパスを検証します。権限を放棄するコマンドが、両方のユーザー設定に対して POSIX シェル構文を明示的かつ確実に実行できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Shell
スター
5
フォーク
1
平均マージ
25分
マージ済み PR(30日)
7

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

gvatsal60/Linux-All-In-One-Update-Script のほかの issue

gvatsal60/Linux-All-In-One-Update-Script の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。