Public bug reported:

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@host % lxc exec canonical -- sudo.ws -i -u ubuntu
ubuntu@canonical ~ % pwd
/home/ubuntu
ubuntu@canonical ~ % echo $HOME
/home/ubuntu
ubuntu@canonical ~ % tty
/dev/pts/4
ubuntu@canonical ~ % ls -la /dev/pts/4
crw--w---- 1 ubuntu tty  136, 4 Nov 12 15:37 4

sudo-rs:

jj@host % lxc exec canonical -- sudo-rs -i -u ubuntu
canonical% pwd
/home/ubuntu
canonical% echo $HOME
/root
canonical% tty
/dev/pts/4
ubuntu@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!

** Affects: rust-sudo-rs (Ubuntu)
     Importance: Undecided
         Status: New

** Description changed:

- sudo-rs doesn't set a login shells PTY ownser correctly and doesn't set
+ sudo-rs doesn't set a login shells PTY owner correctly and doesn't set
  its $HOME, while sudo.ws does.
  
  sudo.ws:
  
  jj@host % lxc exec canonical -- sudo.ws -i -u ubuntu
  ubuntu@canonical ~ % pwd
  /home/ubuntu
  ubuntu@canonical ~ % echo $HOME
  /home/ubuntu
  ubuntu@canonical ~ % tty
  /dev/pts/4
- ubuntu@canonical ~ % ls -la /dev/pts/4                                        
                                                                                
                                                                                
                                                                       
+ ubuntu@canonical ~ % ls -la /dev/pts/4
  crw--w---- 1 ubuntu tty  136, 4 Nov 12 15:37 4
- 
  
  sudo-rs:
  
  jj@host % lxc exec canonical -- sudo-rs -i -u ubuntu
  canonical% pwd
  /home/ubuntu
  canonical% echo $HOME
  /root
  canonical% tty
  /dev/pts/4
  ubuntu@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!
+ correct pty owning is important, otherwise e.g. gpg-agent can't show
+ pinentry on the terminal where gpg was invoked on!

** Summary changed:

- login shell doesn't own pts and set homedir
+ wrong /dev/pty owner for login shell (and $HOME)

** Summary changed:

- wrong /dev/pty owner for login shell (and $HOME)
+ wrong /dev/pts owner for login shell (and $HOME)

** Description changed:

- sudo-rs doesn't set a login shells PTY owner correctly and doesn't set
- its $HOME, while sudo.ws does.
+ 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@host % lxc exec canonical -- sudo.ws -i -u ubuntu
  ubuntu@canonical ~ % pwd
  /home/ubuntu
  ubuntu@canonical ~ % echo $HOME
  /home/ubuntu
  ubuntu@canonical ~ % tty
  /dev/pts/4
  ubuntu@canonical ~ % ls -la /dev/pts/4
  crw--w---- 1 ubuntu tty  136, 4 Nov 12 15:37 4
  
  sudo-rs:
  
  jj@host % lxc exec canonical -- sudo-rs -i -u ubuntu
  canonical% pwd
  /home/ubuntu
  canonical% echo $HOME
  /root
  canonical% tty
  /dev/pts/4
  ubuntu@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!

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2131153

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

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


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to