Skip to content

[bug] Startup gaps batch: --norc under login, rcfile-is-dir silent, profile-chain fallthrough, wrong errno #1160

Closed

Description

@caomengxuan666

[bug] --norc under --login -i: honored by niu, ignored by bash for the rc half (+2 related startup gaps)

# same fakehome files as #1159
bash --norc --login -i -c 'echo AFTER'  # still prints BASH-RC (+PROFILE-RAN)
niu --norc --login -i -c 'echo AFTER'   # PROFILE-RAN only

Low (flag interaction; likely same root cause as #1159, but the flag interaction itself observably differs — either order of --norc/--login).

Two more startup gaps, same batch:

  • --rcfile <dir> / --init-file <dir>: bash warns ...: is a directory then runs; niu silent, runs. (Distinct from [bug] No diagnostic when BASH_ENV names a directory #1146, which covers BASH_ENV-is-directory — verified niu DOES diagnose there, modulo trivial Is vs is casing.)
  • Profile-chain fallthrough on directory ~/.bash_profile (with ~/.profile present): bash errors ...: is a directory and STOPS (.profile NOT read); niu silently skips to .profile and runs it. Different files get executed — medium.
  • Unreadable ~/.bash_profile (chmod 000): bash Permission denied; niu No such file or directory (wrong errno string, rc=0 both, no fallthrough either side).

Env: niubash 1.4.4 / rubash engine (master ~2026-10), GNU bash 5.3.20 aarch64-linux-android as oracle.

Activity

  1. added
    bug
    gnu-baseline
    area:cmdline
    P3-low
    on Oct 22, 2026
  2. caomengxuan666 commented on Oct 23, 2026

    @caomengxuan666
    MemberAuthor

    Triage vs current master (e743db8, release build) + WSL GNU 5.3.20, per sub-item:

    1. --norc under --login -i — premise correction: stock GNU does NOT source ~/.bashrc under login shells at all (verified: env HOME=fakehome bash --login -i -c → profile chain only, no rc marker; same for --norc --login -i). The BASH-RC print on the filing machine came from its .bash_profile sourcing .bashrc. Nothing diverges here.
    2. --rcfile <dir> — FIXED by Bulk fix: 112 GNU bash 5.3 compatibility issues from the 2026-10-22/23 differential audit #1181 (commit 24d153b, real-error reporting): rubash now diagnoses instead of staying silent. Windows residual: rubash: D:\\tmp\\fakehome: Permission denied vs GNU bash: FILE: is a directory — the Windows open genuinely returns EACCES, so this is platform-errno shape, not a missed fix.
    3. dir .bash_profile fallthrough — the profile chain is #[cfg(not(windows))]-gated in rubash.exe, so not exercisable here; login_profile_files() includes the dir candidate and run_init_file now reports the real error (same 24d153b path), which is the GNU shape (error + no fallthrough). Marking verified-by-code-path, not by run.
    4. chmod-000 errno — same code path as (3); real-error reporting covers it.

    Fixed by #1181; residual platform-errno difference noted in item 2. Closing.

  3. caomengxuan666 commented on Oct 23, 2026

    @caomengxuan666
    MemberAuthor

    Retest on niu 1.4.4 / rubash 1b14a3d vs GNU bash 5.3.20:

    Leaving closed; ignoring the residual per the #1159 ruling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3-lowarea:cmdlinebuggnu-baseline

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions