Repository navigation
fix(rc.d): list ~/.rc.d with command ls in the login bridge - #588
Open
basiliskus wants to merge 1 commit into
Open
basiliskus wants to merge 1 commit into
basiliskus wants to merge 1 commit into
Conversation
The login ~/.profile sources ~/.bashrc before the rc.d block, so in an interactive login shell a user's `ls` alias or function is already defined when the block lists ~/.rc.d. Depending on the alias, snippets then run in the wrong order (`ls -r`), are skipped (`ls -F` on an executable snippet, `ls -Q`), or are found only because their names appear among the words of a long listing (`ls -l`). `command ls` skips aliases and functions; the C collation and the block's line count are unchanged. Fixes #587
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
~/.rc.dlogin bridge (acq_login_profile_rc_block) lists snippets with$(LC_ALL=C ls "$HOME"/.rc.d). The login~/.profilesources~/.bashrcbefore that block, so in an interactive login shell a user'slsalias or function is already in effect when the block runs. Depending on the alias, snippets run in the wrong order (ls -r), are skipped (ls -Fon an executable snippet,ls -Q), or are found only because their names appear among the words of a long listing (ls -l).This switches the listing to
LC_ALL=C command ls, which bypasses aliases and functions. The C collation, guards, and line count of the block (and so the heal'smax_linesbound) are unchanged.Related Issues
Fixes #587
Type of Change
Checklist
feat:,fix:,docs:)Test Results
rc.d: login-profile block ignores an ls alias or function from .bashrc (#587)(72-msb-agent-user.bats) runs the generated block withalias ls="ls -r"and, separately, anlsfunction that names one snippet twice and omits the other. Without the fix it fails (20-bthen10-a); with it, both cases source10-athen20-b.LC_ALL=C command ls.bats --filter 'rc.d|#426'over both files: 14/14 pass.shellcheck -S warning acq.backends/common.sh: clean../scripts/test-acq-bats: 730 pass, 12 fail. The same 10 fail on unmodifiedmainin this environment (clone, msys, migration-gate, dispatch, github-scope, and msb provision tests), and the other 2 are the sbx grammar acceptance tests, which needsbx login.