Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #230184

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

From David Wright <deblis@lionunicorn.co.uk>
Newsgroups linux.debian.user
Subject Re: Bullseye: setting and using $DISPLAY after su -
Date 2021-01-01 05:40 +0100
Message-ID <Bskoi-17u-5@gated-at.bofh.it> (permalink)
References <Bse9c-5EE-3@gated-at.bofh.it> <BseiS-5Xc-7@gated-at.bofh.it> <Bsesx-60A-1@gated-at.bofh.it> <BsgNI-7hJ-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu 31 Dec 2020 at 17:49:02 (-0700), Charles Curley wrote:
> On Thu, 31 Dec 2020 17:15:40 -0500 Greg Wooledge 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.

Same here, since the 1990s. In fact, I posted this dialogue on the
Corel mailing list in March 2000:

  ahost!auser 14:13 ~
  $ echo $DISPLAY
  :0.0                                 <---- the name of the display
  ahost!auser 14:13 ~
  $ xeyes -display :0.0                <---- now I close the new window
  ahost!auser 14:13 ~
  $ /bin/su -
  Password:
  ahost ~# xeyes -display :0.0
  Xlib: connection to ":0.0" refused by server
  Xlib: Client is not authorized to connect to Server
  Error: Can't open display: :0.0
  ahost ~# ln -s ~auser/.Xauthority .Xauthority
  ahost ~# xeyes -display :0.0         <---- now I close the new window
  ahost ~# logout
  ahost!auser 14:14 ~
  $ 

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

Well, for a start, the value of DISPLAY changes for you—that's never
happened to me (though I realise they both point to the same place).

Whitelisting with -w should do nothing for you—knowing the display's
location doesn't authorise you to use it.

The only suggestions I can come up with are:

Look at these files on buster (has PAM been modified?):

$ TZ=America/Phoenix ls --full-time /etc/pam.d/su*
-rw-r--r-- 1 root root 2257 2019-01-10 01:30:43.000000000 -0700 /etc/pam.d/su
-rw-r--r-- 1 root root  137 2019-01-10 01:30:43.000000000 -0700 /etc/pam.d/su-l
-rw-r--r-- 1 root root   95 2020-02-02 00:41:42.000000000 -0700 /etc/pam.d/sudo
$ apt-cache policy util-linux
util-linux:
  Installed: 2.33.1-0.1
  Candidate: 2.33.1-0.1
  Version table:
 *** 2.33.1-0.1 990
        990 http://deb.debian.org/debian buster/main amd64 Packages
        100 /var/lib/dpkg/status
$ 

Is wayland involved? (I have no idea what you're able to do with
PAM, wayland, or with XFCE either.)

Cheers,
David.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Bullseye: setting and using $DISPLAY after su - Charles Curley <charlescurley@charlescurley.com> - 2020-12-31 23:00 +0100
  Re: Bullseye: setting and using $DISPLAY after su - <tomas@tuxteam.de> - 2020-12-31 23:10 +0100
    Re: Bullseye: setting and using $DISPLAY after su - Greg Wooledge <wooledg@eeg.ccf.org> - 2020-12-31 23:20 +0100
      Re: Bullseye: setting and using $DISPLAY after su - Charles Curley <charlescurley@charlescurley.com> - 2021-01-01 01:50 +0100
        Re: Bullseye: setting and using $DISPLAY after su - David Wright <deblis@lionunicorn.co.uk> - 2021-01-01 05:40 +0100
          [SOLUTION] Re: Bullseye: setting and using $DISPLAY after su - Charles Curley <charlescurley@charlescurley.com> - 2021-01-01 18:50 +0100
            Re: [SOLUTION] Re: Bullseye: setting and using $DISPLAY after su - <tomas@tuxteam.de> - 2021-01-01 20:00 +0100
              Re: [SOLUTION] Re: Bullseye: setting and using $DISPLAY after su - Charles Curley <charlescurley@charlescurley.com> - 2021-01-01 22:30 +0100
              Re: [SOLUTION] Re: Bullseye: setting and using $DISPLAY after su - Greg Wooledge <wooledg@eeg.ccf.org> - 2021-01-04 13:40 +0100
                Re: [SOLUTION] Re: Bullseye: setting and using $DISPLAY after su  - The Wanderer <wanderer@fastmail.fm> - 2021-01-04 13:50 +0100
                Re: [SOLUTION] Re: Bullseye: setting and using $DISPLAY after su - Greg Wooledge <wooledg@eeg.ccf.org> - 2021-01-04 14:40 +0100
                Re: [SOLUTION] Re: Bullseye: setting and using $DISPLAY after su - <tomas@tuxteam.de> - 2021-01-04 15:50 +0100
                Re: [SOLUTION] Re: Bullseye: setting and using $DISPLAY after su - David Wright <deblis@lionunicorn.co.uk> - 2021-01-06 05:40 +0100
                Re: [SOLUTION] Re: Bullseye: setting and using $DISPLAY after su - Greg Wooledge <wooledg@eeg.ccf.org> - 2021-01-06 13:40 +0100
                Re: [SOLUTION] Re: Bullseye: setting and using $DISPLAY after su - David Wright <deblis@lionunicorn.co.uk> - 2021-01-06 17:30 +0100
                Re: [SOLUTION] Re: Bullseye: setting and using $DISPLAY after su - Greg Wooledge <wooledg@eeg.ccf.org> - 2021-01-06 19:50 +0100
        Re: Bullseye: setting and using $DISPLAY after su - Greg Wooledge <wooledg@eeg.ccf.org> - 2021-01-04 13:30 +0100
          Re: Bullseye: setting and using $DISPLAY after su - Charles Curley <charlescurley@charlescurley.com> - 2021-01-04 19:20 +0100
      Re: Bullseye: setting and using $DISPLAY after su - <tomas@tuxteam.de> - 2021-01-01 10:20 +0100
    Re: Bullseye: setting and using $DISPLAY after su - Charles Curley <charlescurley@charlescurley.com> - 2021-01-01 02:00 +0100
  Re: Bullseye: setting and using $DISPLAY after su - Mark Neyhart <Mark.Neyhart@akleg.gov> - 2021-01-01 04:10 +0100

csiph-web