[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bullseye: setting and using $DISPLAY after su -



On Thu, 31 Dec 2020 17:15:40 -0500
Greg Wooledge <wooledg@eeg.ccf.org> wrote:

> It's worth pointing out that even on buster, "su -" does in fact clear
> the value of DISPLAY, which is not really a surprise, since you
> explicitly requested a "clean" login session as the new user.
> Perhaps you are mis-remembering what you used to do.  Perhaps you
> used to use regular "su" without the infernal Red Hat "-" option.

I still have a small herd of buster boxen available, and 'su -' is
exactly what I have been doing for at least a decade.

Also, if I want to run as root, I want access to all the rootty system
administrator things like fdisk and fsck. Plain vanilla su leaves one
with the unprivileged user's PATH.

> 
> unicorn:~$ su
> Password: 
> root@unicorn:/home/greg# env | grep DISPLAY=
> HOSTDISPLAY=unicorn:0
> DISPLAY=:0
> root@unicorn:/home/greg# exit
> unicorn:~$ su -
> Password: 
> root@unicorn:~# env | grep DISPLAY=
> root@unicorn:~# 

Also on buster:

charles@hawk:~$ su
Password: 
root@hawk:/home/charles# env | grep DISPLAY
DISPLAY=:0.0
root@hawk:/home/charles# exit
exit
charles@hawk:~$ su -
Password: 

Today is Setting Orange, the 73rd of The Aftermath, 3186. All Hail Discordia! 
root@hawk:~# env | grep DISPLAY
DISPLAY=:0
root@hawk:~# xclock &
[1] 3550
root@hawk:~# 

(xclock ran successfully.)

> 
> Quite a difference, eh?  Almost certainly this is not a thing that
> has changed during bullseye's run as testing.

Yup, quite a difference. But something has changed.


-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/


Reply to: