fix(recipes): probe the escalation tool before python-dev uses it - #92
Merged
Conversation
Alpine ships a sudoers file that grants root nothing. sudo is on PATH and refuses every command, so as_user picked it, the runcmd failed, and cloud-init ended in error. The readiness wait then failed stoat up. as_user now runs each candidate once and keeps the first that works. The su fake in the test harness matched -c against its -* case, so the fallback branch could never pass. The fake now parses -c first and forwards the remaining arguments. Signed-off-by: NovusEdge <novusedge0@gmail.com>
|
Warning Review limit reachedNext included review available in 45 seconds. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ments busybox su recognises options anywhere on its command line. The -p in "as_user mkdir -p /home/stoat" became su's own preserve-environment flag, so mkdir ran without it and failed on an existing directory. The runcmd failed and cloud-init ended in error on Alpine. su_user now shell-quotes the argument list into -c and passes nothing positional. The su fake in the test harness kept trailing arguments, which busybox does not. It now drops dash arguments anywhere and passes no positional arguments. Signed-off-by: NovusEdge <novusedge0@gmail.com>
This was referenced Sep 6, 2026
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.
Two defects stopped
stoat upon Alpine, both in thepython-devrecipe'sas_userhelper.sudo is present and refuses everything. Alpine 3.24 ships
/etc/sudoerswith no rule for root:
sudo 1.9.17p2 is installed, so
command -v sudosucceeded andas_userchoseit. Every call then failed with
root is not in the sudoers file.as_usernow runs each candidate once and keeps the first that works.
busybox su eats options from the trailing arguments. Alpine's su is
/bin/bbsuid, which recognises options anywhere on its command line. Probed inthe guest:
The
-pbecame su's own preserve-environment flag, soas_user mkdir -p /home/stoatran without-pand failed on the existing directory.su_usernow shell-quotes the argument list into
-cand passes nothing positional.Either failure ends cloud-init in error, which fails the readiness wait added
by #86:
The four python-dev installers carry the same helper and all four change.
The
sufake in the test harness matched-cagainst its-*case and kepttrailing arguments, so it modelled neither failure and the fallback branch
could never have passed a test. It now parses
-canywhere, drops dasharguments the way busybox does, and passes nothing positional.
Live evidence
The five-guest recipe gate on this commit, one attempt per row:
Retained under
common-recipes/live/c4. Earlier rows stay where they are:c2failed at alpine
upon the sudo defect,c3failed at alpineupon thebusybox su defect.
The gate itself also required
cloud-init statusto exit 0. cloud-init exits 2for a recoverable warning, and Alpine's image has no
write-ssh-key-fingerprintshelper, sokeys_to_consolealways warns. Thegate now accepts exit 2 when the status is
donewith no hard errors, which isthe contract
internal/sshxalready implements.