← Back to issue list

cli: improve sudo detection with euid check for warnings/errors

View original Github issue

Metadata

Project
snapcraft
Number
#3159
Type
pull request
State
merged
Author
cjp256
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #3159 (commit a68a23f0e) added an effective-UID check to sudo detection, avoiding warnings/errors when sudo switches to a non-root user.

Resolution: closed resolved

Reason: PR #3159 was approved and merged as commit a68a23f0e. The CLI now checks the effective user ID is root before emitting sudo-related warnings or errors.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Some environments will `sudo` to another user. To avoid unnecessary warnings/errors, additionally check that the effective user is root. Signed-off-by: Chris Patterson <chris.patterson@canonical.com> - [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] Have you successfully run `./runtests.sh static`? - [ ] Have you successfully run `./runtests.sh tests/unit`? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #3159 (commit a68a23f0e) added an effective-UID check to sudo detection, avoiding warnings/errors when sudo switches to a non-root user.
stealth/space-bunny-alpha — closed resolved Merged PR #3159 in commit a68a23f0e, improving CLI sudo detection with an effective-UID check.
stealth/space-bunny-alpha — closed resolved Merged PR #3159 (commit a68a23f0e) added an effective-UID check to CLI sudo detection, avoiding unnecessary warnings and errors when sudo switches to a non-root user.
stealth/space-bunny-alpha — closed resolved Merged in snapcraft/snapcraft#3159 (commit a68a23f0e), improving sudo detection with an effective-UID check to prevent unnecessary warnings and errors when users switch accounts.
qwen/qwen3.6-35b-a3b — — Merged improvements to sudo detection that verify the effective user ID, preventing unnecessary warnings when switching users. Approved by a maintainer, passed CI, and updated 4 files.
qwen3.6-35b-a3b-mtp-q6 — — Merged a fix that improves sudo detection by checking the effective user ID is root, preventing unnecessary warnings and errors when sudo switches users.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.