From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-user+bounces-115762-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1P7VyY-0005eE-9N
	for garchives@archives.gentoo.org; Sun, 17 Oct 2010 16:20:46 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 00A89E09C1
	for <garchives@archives.gentoo.org>; Sun, 17 Oct 2010 16:20:45 +0000 (UTC)
Received: from mail-ew0-f53.google.com (mail-ew0-f53.google.com [209.85.215.53])
	by pigeon.gentoo.org (Postfix) with ESMTP id 1AE22E084D
	for <gentoo-user@lists.gentoo.org>; Sun, 17 Oct 2010 15:36:45 +0000 (UTC)
Received: by ewy8 with SMTP id 8so25212ewy.40
        for <gentoo-user@lists.gentoo.org>; Sun, 17 Oct 2010 08:36:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:received:received:from:to:subject:date
         :user-agent:references:in-reply-to:mime-version:content-type
         :content-transfer-encoding:message-id;
        bh=sQDrsTErW+cI+1G8CZDRIoL8Akd6YXCtMogZH4+bBDg=;
        b=J11tP3OJ3uY67W1KVFffjGr3Gk6q6yO9f7ey5Ed3vuDglPjbsdl9aeBxyWEe0rTFsA
         n/OGxq0ymTQVUvOqaCZJOdKjGH+p2x/izYvwK3oJ+62boEeroWVGvJ4UkTbcszeHr3gf
         cBZupBMuYWHFbSrLkqim2ZqyIxWH0ph4/Vydg=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=from:to:subject:date:user-agent:references:in-reply-to:mime-version
         :content-type:content-transfer-encoding:message-id;
        b=Xgj8oRtRlqq2wU7UeZLP/jNKMF5lV8xDg9ZJ0bBWygyjGwXHEbs6Fk058ftwNQ8Gg0
         Wopy5RUJCKbK00T3/pZIdd6gxJybQ6YiboxArMA8VhRkyq3UEBFzUfb8OTSg99g8ETOo
         o+RHMlVTsUax2S+uz+jvPN32EVgI40Poxx2cY=
Received: by 10.213.108.74 with SMTP id e10mr2976599ebp.91.1287329804437;
        Sun, 17 Oct 2010 08:36:44 -0700 (PDT)
Received: from nazgul.localnet (196-215-2-42.dynamic.isadsl.co.za [196.215.2.42])
        by mx.google.com with ESMTPS id q54sm17403696eeh.0.2010.10.17.08.36.41
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Sun, 17 Oct 2010 08:36:43 -0700 (PDT)
From: Alan McKinnon <alan.mckinnon@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Re: X programs as root
Date: Sun, 17 Oct 2010 17:37:14 +0200
User-Agent: KMail/1.13.5 (Linux/2.6.35-ck-r4; KDE/4.5.2; x86_64; ; )
References: <AANLkTinBaqD3JSdRveng96=htC=P_NCbgX85O2fr6LLi@mail.gmail.com> <i9es0k$9ug$1@dough.gmane.org> <i9es75$9ug$2@dough.gmane.org>
In-Reply-To: <i9es75$9ug$2@dough.gmane.org>
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@lists.gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201010171737.14503.alan.mckinnon@gmail.com>
X-Archives-Salt: 271c444d-bcd9-44ed-b9a2-ba9084edcd70
X-Archives-Hash: 31dc0702582ae2fceca54204ca2cac75

Apparently, though unproven, at 15:03 on Sunday 17 October 2010, Nikos 
Chantziaras did opine thusly:

> On 10/17/2010 04:00 PM, Nikos Chantziaras wrote:
> > On 09/22/2010 09:48 PM, Andrey Vul wrote:
> >> When I launch X programs via sudo, I get the following:
> >> 
> >> $sudo gui-admin
> >> No protocol specified
> >> gui-admin: cannot connect to X server :0
> >> 
> >> ( Assume gui-admin is an X program )
> >> 
> >> But (gk|kde)su(do)? works. This is somewhat confusing.
> > 
> > I just discovered something. Keeping HOME is not really recommended,
> > because the programs that run as root will then use your user's
> > configuration files and sometimes will set 'root' as their owner. As you
> > can imagine, this is not a good thing.
> > 
> > It seems what X programs really need is the .Xauthority file of the
> > current X session. All you have to do is add this line to your ~/.bashrc:
> > 
> > export XAUTHORITY="$HOME/.Xauthority"
> > 
> > Then you don't have to configure sudoers to keep the HOME env var.
> 
> (I have the tendency to press the "Send" button too soon...)
> 
> Setting XAUTHORITY in the user's .bashrc also means that you don't have
> to modify /etc/sudoers *in any way*, not even DISPLAY needs to be kept.
>   Setting XAUTHORITY is *all* what is needed.


I owe you a beer :-)

One little export and this annoying thingy has now gone away:

$ sudo vi /etc/fstab 
Password: 
No protocol specified


You have NO IDEA how long that has annoyed me and how long I've been searching 
for a solution. Make that two beers!


-- 
alan dot mckinnon at gmail dot com