[Bug 2131153] Re: wrong /dev/pts owner for login shell (and $HOME)

Launchpad Bug Tracker 2131153 at bugs.launchpad.net
Fri Feb 20 00:16:54 UTC 2026


This bug was fixed in the package rust-sudo-rs - 0.2.12-0ubuntu1

---------------
rust-sudo-rs (0.2.12-0ubuntu1) resolute; urgency=medium

  * New upstream version (LP: #2141927)
  * Fixes:
    - Cockpit cannot escalate privileges with sudo-rs [--askpass unsupported]
      (LP: #2122048)
    - wrong /dev/pts owner for login shell (and $HOME) (LP: #2131153)
    - The visudo command fails to read files passed via stdin (LP: #2136942)
    - renable test `test_build_run_context` (LP: #2120544)
  * New patches:
    - enable-pwfeedback-by-default.patch: Cherry-pick enable pwfeedback by
      default, thanks Tim Hutt.
    - correct-backspace-for-multibyte-characters.patch: Cherry-pick correct
      backspace for multibyte characters, thanks Marc Schoolderman.
  * Changes:
    - d/control: Add python3:any as dependency for apport package hook.
    - d/sudo-rs.manpages: Sort entry order alphabetically.

 -- Simon Johnsson <simon.johnsson at canonical.com>  Mon, 16 Feb 2026
14:24:39 +0100

** Changed in: rust-sudo-rs (Ubuntu Resolute)
       Status: Fix Committed => Fix Released

-- 
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/2131153

Title:
  wrong /dev/pts owner for login shell (and $HOME)

Status in rust-sudo-rs package in Ubuntu:
  Fix Released
Status in rust-sudo-rs source package in Questing:
  Triaged
Status in rust-sudo-rs source package in Resolute:
  Fix Released

Bug description:
  sudo-rs doesn't set a login shells /dev/pts owner correctly and
  doesn't set its $HOME, while sudo.ws does.

  sudo.ws:

  jj at host % lxc exec canonical -- sudo.ws -i -u ubuntu
  ubuntu at canonical ~ % pwd
  /home/ubuntu
  ubuntu at canonical ~ % echo $HOME
  /home/ubuntu
  ubuntu at canonical ~ % tty
  /dev/pts/4
  ubuntu at canonical ~ % ls -la /dev/pts/4
  crw--w---- 1 ubuntu tty  136, 4 Nov 12 15:37 4

  sudo-rs:

  jj at host % lxc exec canonical -- sudo-rs -i -u ubuntu
  canonical% pwd
  /home/ubuntu
  canonical% echo $HOME
  /root
  canonical% tty
  /dev/pts/4
  ubuntu at canonical ~ % ls -l /dev/pts/4
  crw--w---- 1 root tty  136, 4 Nov 12 15:28 4

  two bugs in sudo-rs:
  - pty owner is wrong (should be the login user, not root)
  - HOME is not set (it is in env_keep) (and it works with: lxc exec canonical -- sudo-rs HOME=/home/ubuntu -i -u ubuntu)

  correct pty owning is important, otherwise e.g. gpg-agent can't show
  pinentry on the terminal where gpg was invoked on!

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




More information about the foundations-bugs mailing list