Re: [gentoo-user] Ever since a recent update, vim misbehaves when run as root

2010-07-30 Thread Steffen Loos

Am 30.07.2010 05:58, schrieb Walter Dnes:

On Thu, Jul 29, 2010 at 01:35:46PM -0700, Kevin O'Gorman wrote

I'm not exactly sure when, but starting a month or so ago, vim has been
acting weird when
I run it as root.  For one thing, there are messages
 Xlib: connection to :0.0 refused by server


   General rule... by default X apps cannot be run by any user other than
the one who started the X session.  This bites you when you launch X as
regular user, and then su -.  Is vim considered an X app?  Yes, if
you've emerged vim with the X USE flag enabled.  You have two options.

1) Get rid of the X-integration by going into /etc/portage/package.use
and adding the line...

app-editors/vim -X

You'll have to re-emerge vim after making that change.  This gets rid
of X-integration for vim.


... or you start with:
~# vim -X

regards,
Steffen



Re: [gentoo-user] Ever since a recent update, vim misbehaves when run as root

2010-07-30 Thread Neil Bothwick
On Thu, 29 Jul 2010 23:58:38 -0400, Walter Dnes wrote:

 1) Get rid of the X-integration by going into /etc/portage/package.use
 and adding the line...
 
 app-editors/vim -X
 
 You'll have to re-emerge vim after making that change.  This gets rid
 of X-integration for vim.
 
 2) If you really really need the X-integration features, you can use the
 xhost command to enable all users on your machine to run X apps on
 your X session.

3) emerge x11-misc/sux and us that instead of su.


-- 
Neil Bothwick

Never argue with an idiot. First, they bring you down to their level.
Then they beat you with experience.


signature.asc
Description: PGP signature


Re: [gentoo-user] Ever since a recent update, vim misbehaves when run as root

2010-07-30 Thread Bill Longman
On 07/29/2010 08:58 PM, Walter Dnes wrote:

 2) If you really really need the X-integration features, you can use the
 xhost command to enable all users on your machine to run X apps on
 your X session.  E.g. my machine is 192.168.123.249 so I ran...
 
   xhost +192.168.123.249
 
 ...to allow a 32-bit QEMU-KVM guest to run an X program on the 64-bit
 host's Xwindows session.

What you probably want here instead is:

xhost +local:

then the X app is not limited to using only IP but can choose whichever
transport it deems best. Of course the usual safety caveats apply. If
others are on your host, they'll have X access. If you're concerned
about that, then just give root permission:

xhost SI:localuser:root



Re: [gentoo-user] Ever since a recent update, vim misbehaves when run as root

2010-07-30 Thread Kevin O'Gorman
On Fri, Jul 30, 2010 at 6:43 AM, Bill Longman bill.long...@gmail.comwrote:

 On 07/29/2010 08:58 PM, Walter Dnes wrote:

  2) If you really really need the X-integration features, you can use the
  xhost command to enable all users on your machine to run X apps on
  your X session.  E.g. my machine is 192.168.123.249 so I ran...
 
xhost +192.168.123.249
 
  ...to allow a 32-bit QEMU-KVM guest to run an X program on the 64-bit
  host's Xwindows session.

 What you probably want here instead is:

 xhost +local:

 then the X app is not limited to using only IP but can choose whichever
 transport it deems best. Of course the usual safety caveats apply. If
 others are on your host, they'll have X access. If you're concerned
 about that, then just give root permission:

 xhost SI:localuser:root

 Thanks -- that was what I was trying to remember, so I just emerged it.

Looks like something I should be able to do in my .bashrc and just forget
about.


-- 
Kevin O'Gorman, PhD


Re: [gentoo-user] Ever since a recent update, vim misbehaves when run as root

2010-07-30 Thread Kevin O'Gorman
On Fri, Jul 30, 2010 at 7:59 AM, Kevin O'Gorman kogor...@gmail.com wrote:



 then the X app is not limited to using only IP but can choose whichever
 transport it deems best. Of course the usual safety caveats apply. If
 others are on your host, they'll have X access. If you're concerned
 about that, then just give root permission:

 xhost SI:localuser:root

 xhost +local:
 Thanks -- that was what I was trying to remember, so I just emerged it.

 Looks like something I should be able to do in my .bashrc and just forget
 about.

 Actually, it doesn't work.

ke...@treat ~ $ xhost si:localhost:root
localhost:root being added to access control list
X Error of failed request:  BadValue (integer parameter out of range for
operation)
  Major opcode of failed request:  109 (X_ChangeHosts)
  Value in failed request:  0xe
  Serial number of failed request:  7
  Current serial number in output stream:  9

ke...@treat ~ $ xhost SI:localhost:root
localhost:root being added to access control list
X Error of failed request:  BadValue (integer parameter out of range for
operation)
  Major opcode of failed request:  109 (X_ChangeHosts)
  Value in failed request:  0xe
  Serial number of failed request:  7
  Current serial number in output stream:  9
ke...@treat ~ $

What's worse, the xhost man page refers me to Xauthority(7) which does not
exist, and I did
not find it with a quick check by eix.

What did work was
  xhost +r...@localhost


-- 
Kevin O'Gorman, PhD


[gentoo-user] Ever since a recent update, vim misbehaves when run as root

2010-07-29 Thread Kevin O'Gorman
I'm not exactly sure when, but starting a month or so ago, vim has been
acting weird when
I run it as root.  For one thing, there are messages
Xlib: connection to :0.0 refused by server
on the console.  I presume this is an X authority thing, but I'm not sure
why it became an
issue when it wasn't before, and I've completely forgotten what to do about
it.  I'm generally
running a gnome-terminal 2.26.3.1 under KDE on plain Gento.

It's weird, I know, but I've been doing this for ages. Moreover, in spite of
weirdness, the editing session works.

Except that there are messages
   Xlib: No protocol specified
overlaid on the document scattered more or less randomly.  They can be
cleaned off by
control-L.

This is barely workable, and leaves me with a WTF sort of feeling.
Fortunately, I don't do a whole lot of editing as root, but there's always
something...

Any clues out there?

-- 
Kevin O'Gorman, PhD


Re: [gentoo-user] Ever since a recent update, vim misbehaves when run as root

2010-07-29 Thread Walter Dnes
On Thu, Jul 29, 2010 at 01:35:46PM -0700, Kevin O'Gorman wrote
 I'm not exactly sure when, but starting a month or so ago, vim has been
 acting weird when
 I run it as root.  For one thing, there are messages
 Xlib: connection to :0.0 refused by server

  General rule... by default X apps cannot be run by any user other than
the one who started the X session.  This bites you when you launch X as
regular user, and then su -.  Is vim considered an X app?  Yes, if
you've emerged vim with the X USE flag enabled.  You have two options.

1) Get rid of the X-integration by going into /etc/portage/package.use
and adding the line...

app-editors/vim -X

You'll have to re-emerge vim after making that change.  This gets rid
of X-integration for vim.

2) If you really really need the X-integration features, you can use the
xhost command to enable all users on your machine to run X apps on
your X session.  E.g. my machine is 192.168.123.249 so I ran...

  xhost +192.168.123.249

...to allow a 32-bit QEMU-KVM guest to run an X program on the 64-bit
host's Xwindows session.

-- 
Walter Dnes waltd...@waltdnes.org