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

Re: xhost-command in Debian1



On Sun, Oct 24, 2021 at 04:59:06PM +1100, Keith Bainbridge wrote:
> 
> On 24/10/21 05:31, Charles Curley wrote:
> > alias su="su --whitelist-environment=DISPLAY,XAUTHORITY"
> 
> 
> Doesn't that mean that when you type 'su' at a command prompt, the response
> will be running the command
> --whitelist-environment=DISPLAY,XAUTHORITY
> as root.

No.  It will run the command   su --whitelist-environment=DISPLAY,XAUTHORITY
which has setuid privileges, and therefore will run with effective UID 0.

It's a lot like doing   alias ls='ls --color=auto'

The second ls inside the alias expansion becomes the new command that
gets executed.  Aliases don't recurse into themselves, which is by
design so that people can do things exactly like this.


Reply to: