Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open Beginner friendly
#129 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
shell

Research direction

Locate the _brew_cmds variable and the su invocation in the current script, then compare them with the change discussed in PR #128. Verify the command path with a non-POSIX login shell and a POSIX shell; done means the privilege-drop command explicitly runs the POSIX shell syntax reliably for both user configurations.

Written by the indexing model from the issue text.

Description

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

Dominant language
Shell
Stars
5
Forks
1
Avg merge
25m
Merged PRs (30d)
7

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from gvatsal60/Linux-All-In-One-Update-Script

All issues in gvatsal60/Linux-All-In-One-Update-Script

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.