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

Re: sudo in X-environment



On Sat, 2014-05-03 at 02:15 -0400, Tom H wrote:
> On Sat, May 3, 2014 at 1:35 AM, Ralf Mardorf <ralf.mardorf@alice-dsl.net> wrote:
> > On Sat, 2014-05-03 at 07:24 +0200, Slavko wrote:
> >>
> >> sux was removed from testing and unstable, then it is not a solution to
> >> future.
> >
> > It's just a short script everybody could copy & paste from any other
> > distro or from upstream, http://sourceforge.net/projects/sux/ .
> 
> A change in su has broken sux:
> 
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=659832

Oops, the same on Arch Linux.

https://bugs.archlinux.org/task/40197

I didn't notice it since I use xhost.

Btw. xhost is needed when using gksudo:

$ chuser firefox
No protocol specified
No protocol specified
Error: cannot open display: :0
size == 0' failed
$ cat /usr/local/bin/chuser
#!/bin/sh

# /usr/local/bin/chuser -> /.chuser/bin/chuser

#xhost +
gksudo -u chuser "$*"
#xhost -
exit

$ sudo nano /usr/local/bin/chuser 
$ chuser firefox
access control disabled, clients can connect from any host
access control enabled, only authorized clients can connect
$ cat /usr/local/bin/chuser
#!/bin/sh

# /usr/local/bin/chuser -> /.chuser/bin/chuser

xhost +
gksudo -u chuser "$*"
xhost -
exit


Reply to: