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

Re: [SOLUTION] Re: Bullseye: setting and using $DISPLAY after su -



On Wed 06 Jan 2021 at 07:35:08 (-0500), Greg Wooledge wrote:
> On Tue, Jan 05, 2021 at 10:38:39PM -0600, David Wright wrote:
> > But here on debian-user, I was really more interested in why the value
> > of DISPLAY was apparently changed by one su and not the other (or
> > perhaps by both). The explanation, "probably with an alias for su",
> > alias su="su -w DISPLAY", doesn't make any sense to me. Explanations?
> 
> "su" will leave the DISPLAY variable intact, and "su -" will remove it.
> I can see no evidence to the contrary, regardless of whether I'm using
> the ALWAYS_SET_PATH config variable.
> 
> The behavior is simple and consistent for me.

And for me. The only difference from the output you posted is

  $ cat /etc/default/su
  cat: /etc/default/su: No such file or directory
  $ 

but that only affects PATH anyway.

> If someone is seeing DIFFERENT behavior than this, they have yet to
> demonstrate it for us.

I thought the OP already had demonstrated it, in
https://lists.debian.org/debian-user/2021/01/msg00000.html
where we have:

User's DISPLAY   not revealed

After su         DISPLAY=:0.0

(exit)

User's DISPLAY   not revealed

After su -       DISPLAY=:0

As I pointed out, these values will both succeed in pointing to the
same actual display (though I only tested that they both work on my
own display, called ":0"). But they are textually "DIFFERENT", so
they can't both be copied from the user's (unrevealed) value.

So what I sought was an explanation of the OP's transcript, not
that of yours and mine.

Cheers,
David.


Reply to: