Skip to content

validate sudo become plugin against sudo-rs #85837

Description

@sivel

Summary

Ubuntu 25.10 will drop sudo.ws in favor of sudo-rs. sudo-rs does not aim to be a 100% compatible replacement, and only aims to cover some of the common behaviors in sudo.

Until 0.2.5 sudo-rs did not support the -p/--prompt arg that we use for matching the prompt. Ubuntu 25.10 appears to be including 0.2.8. sudo implemented this by capturing the pam password prompt, and rewriting it, which the sudo-rs maintainers did not implement.

Instead sudo-rs seems to print an additional string before delegating to pam, which seems to create a prompt like the following that our sudo become plugin does not support:

[sudo: [sudo via ansible, key=spnnznrgscgdxdontsjkwrlyghiiglxk] password:] Password:

There may be other incompatibilities, but since Ubuntu 25.10 switches to sudo-rs to provide sudo, we should ensure compatibility.

Issue Type

Bug Report

Component Name

lib/ansible/plugins/become/sudo.py

Ansible Version

$ ansible --version

Configuration

# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all

OS / Environment

Ubuntu 25.05

Steps to Reproduce

Expected Results

sudo become plugin to work

Actual Results

Doesn't work?

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Metadata

Metadata

Assignees

Labels

bugThis issue/PR relates to a bug.has_prThis issue has an associated PR.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions