After some research it seems that the `-i` flag has special behaviour
for PAM environment variables in sudo.ws:

(From https://www.sudo.ws/docs/man/1.8.15/sudoers.man/#Command_environment)
> As a special case, if the -i option (initial login) is specified, sudoers 
> will initialize the environment regardless of the value of env_reset. The 
> DISPLAY, PATH and TERM variables remain unchanged; HOME, MAIL, SHELL, USER, 
> and LOGNAME are set based on the target user. On AIX (and Linux systems 
> without PAM), the contents of /etc/environment are also included. On BSD 
> systems, if the use_loginclass flag is enabled, the path and setenv variables 
> in /etc/login.conf are also applied. All other environment variables are 
> removed unless permitted by env_keep or env_check, described above.

I have filed a bug report upstream to get input on whether this aligns
with their opinions regarding sudo-rs:
https://github.com/trifectatechfoundation/sudo-rs/issues/1335

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

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