Potential compatibility issue: Removing explicit `-s /bin/sh` from su command may break for users with non-POSIX login shells
まだ誰も着手していません。
評価
- 難易度
- 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 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
- 主要言語
- Shell
- スター
- 5
- フォーク
- 1
- 平均マージ
- 25分
- マージ済み PR(30日)
- 7
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
gvatsal60/Linux-All-In-One-Update-Script のほかの issue
-
enhancement good first issue
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
gvatsal60/Linux-All-In-One-Update-Script#30 · 担当者 1 名 ·
gvatsal60/Linux-All-In-One-Update-Script の issue をすべて見る
似ている issue
-
package-update
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
oSoWoSo/vOid_Community_repOsitory#203 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] v-quick-install-app install crashes with ValueError if no supported PHP version is installedオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
chore
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
alunduil/alunduil-chezmoi#809 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
catppuccin/kde#152 ·