lmi
[Top][All Lists]
Advanced

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

Re: [lmi] vim as root: "No protocol specified"


From: Vadim Zeitlin
Subject: Re: [lmi] vim as root: "No protocol specified"
Date: Tue, 1 Oct 2019 20:17:14 +0200

On Tue, 1 Oct 2019 16:57:15 +0000 Greg Chicares <address@hidden> wrote:

GC> Vadim--Now that I'm using the wayland compositor, whenever I edit
GC> a file as root, I see a "No protocol specified" message on the
GC> screen when vim exits:
GC> 
GC> #vim /srv/chroot/centos-7/tmp/setup0.sh 
GC> No protocol specified
...
GC> The best I can come up with is this:
GC> 
GC> XAUTHORITY=/home/greg/.Xauthority vim /srv/chroot/centos-7/tmp/setup0.sh
GC> 
GC> from which I could create an alias in a shell startup file
GC> (on my own computer, I'm sure 'greg' is a normal X user).
GC> Is that good, or am I missing a simpler approach?

 I've never seen this problem, possibly because I don't use Wayland yet,
but probably because I actually tend to use "su -m" or "sudo -E", i.e.
inherit all the environment variables, including XAUTHORITY, from my
non-privileged account. This might well open some extra ways to attack root
account if my normal account is compromised, but OTOH if the latter
happens, it would already be such a huge problem, that I'd rather prevent
it from happening in the first place.

 And security problems aside, I haven't had any problems with doing this,
i.e. reusing the users XAUTHORITY in a root session, so I think it should
be fine to just "export XAUTHORITY=~greg/.Xauthority" in your case.

 BTW, I wonder how does DISPLAY end up being set for you but not
XAUTHORITY?

VZ

Attachment: pgpMAmK53k77F.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]