[Bug 2138761] Re: sudo-rs --prompt prints the wrong thing

Simon Johnsson 2138761 at bugs.launchpad.net
Wed Jan 21 08:34:16 UTC 2026


Hi b00n! Thanks for submitting the bug report and helping make Ubuntu
better. I have verified the behavior in sudo-rs and can confirm that it
deviates from sudo.ws which uses the expected behavior you presented.

If I understand correctly, the behavior you see in sudo-rs is actually
intended for security purposes (see
https://github.com/trifectatechfoundation/sudo-rs/issues/842), as
overwriting the entire prompt can obfuscate the type of expected input.

My current recommendation would be to file a bug report for emacs-rs, as
I believe it should be possible to add the observed prompt result to the
regex matching for its password prompt.

I understand your confusion regarding not finding "sudo-rs". Many
packages written in Rust use the prefix "rust-" due to how they are
handled in packaging.

I will mark this as "Won't Fix" for now since I interpret the behavior
as intended by upstream. Let me know if you think otherwise based on the
information I have provided.

Have a great day!

** Bug watch added: github.com/trifectatechfoundation/sudo-rs/issues #842
   https://github.com/trifectatechfoundation/sudo-rs/issues/842

** Changed in: rust-sudo-rs (Ubuntu)
       Status: New => Won't Fix

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to rust-sudo-rs in Ubuntu.
https://bugs.launchpad.net/bugs/2138761

Title:
  sudo-rs --prompt  prints the wrong thing

Status in rust-sudo-rs package in Ubuntu:
  Won't Fix

Bug description:
  Observed behavior:
  $ sudo --prompt "XXX" echo
  [sudo: XXX] Password: 

  Expected behavior:
  $ sudo --prompt "XXX" echo
  XXX Password: 

  Discussion:

  My reading of the manual is it should print "XXX" instead of "[sudo:
  XXX]".

  Environment SUDO_PROMPT has the same bug.

  Emacs and some other tools try to hide the password you type, and rely
  on the prompt being a recognizable form.  From:

  https://emacs.stackexchange.com/questions/76023/at-the-time-of-prompting-for-a-password-from-a-subordinate-shell-sometimes-em
  ...
  ;; Ubuntu's sudo prompts like `[sudo] password for user:'
  ...

  Current Emacs (from the 25.10 Ubuntu repo) does not hide the password
  because the emacs-rs prompt is different than sudo.  The current
  --prompt behavior cannot reproduce the expected prompt.  For example,

  $ sudo --prompt '[sudo] password for user:' echo
  [sudo: [sudo] password for user:] Password: 

  So there may be a second bug, that sudo-rs is using a different prompt
  than standard Ubuntu "sudo".  I tripped on the issue with Emacs, but
  other tools may also fail due to the default prompt.

  
  $ lsb_release -rd
  Description:	Ubuntu 25.10
  Release:	25.10
  $ which sudo
  /usr/bin/sudo
  $ sudo --version
  sudo-rs 0.2.8
  $ apt-cache policy sudo-rs
  sudo-rs:
    Installed: 0.2.8-1ubuntu5.2
    Candidate: 0.2.8-1ubuntu5.2
    Version table:
   *** 0.2.8-1ubuntu5.2 500
          500 http://us.archive.ubuntu.com/ubuntu questing-updates/main amd64 Packages
          500 http://security.ubuntu.com/ubuntu questing-security/main amd64 Packages
          100 /var/lib/dpkg/status
       0.2.8-1ubuntu5 500
          500 http://us.archive.ubuntu.com/ubuntu questing/main amd64 Packages

  I tried submitting this bug as "sudo-rs" but the tool says "sudo-rs"
  does not exist in Ubuntu, even though apt uses sudo-rs.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rust-sudo-rs/+bug/2138761/+subscriptions




More information about the foundations-bugs mailing list