From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Dan Jacobson Newsgroups: gmane.emacs.bugs Subject: emacs to run as root from su, in its own X window? Date: 15 Jun 2002 05:49:06 +0800 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: Reply-To: kindly_remove_this_part_first_jidanni@ms46.hinet.net NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1024093275 23611 127.0.0.1 (14 Jun 2002 22:21:15 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 14 Jun 2002 22:21:15 +0000 (UTC) Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17IzRS-00068a-00 for ; Sat, 15 Jun 2002 00:21:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17IzRP-0004qo-00; Fri, 14 Jun 2002 18:21:11 -0400 Original-Received: from mailbox3.ucsd.edu ([132.239.1.55]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 17IzQ6-0004kM-00 for ; Fri, 14 Jun 2002 18:19:50 -0400 Original-Received: from mail.fu-berlin.de (mail.fu-berlin.de [160.45.11.165]) by mailbox3.ucsd.edu (8.12.1/8.12.1) with ESMTP id g5EMJhrk015938 for ; Fri, 14 Jun 2002 15:19:49 -0700 (PDT) Original-Received: by mail.fu-berlin.de (Smail3.2.0.98) from Curry.ZEDAT.FU-Berlin.DE (160.45.10.36) with esmtp id ; Sat, 15 Jun 2002 00:19:43 +0200 (MEST) Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.fu-berlin.de with bsmtp id ; Sat, 15 Jun 2002 00:19:43 +0200 (MEST) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: 61-227-47-231.hinet-ip.hinet.NET!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 45 X-Orig-NNTP-Posting-Host: 61-227-47-231.hinet-ip.hinet.net (61.227.47.231) X-Orig-X-Trace: fu-berlin.de 1024093182 6386977 61.227.47.231 (16 [99749]) X-Orig-Path: localhost.localdomain!nobody User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:2047 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:2047 This may be a debian specific problem, hence the CC. It may be "user lack of understanding". If so, "then beef up the FAQs". Or maybe I didn't look. Anyways, I solved the problem. I put xhost local:root #dangerous? else root can't open an emacs window in ~/.xsession. Anyways, the problem was: How do I get emacs to run as root when I do su, in its own X window? $ su # emacs Xlib: connection to ":0.0" refused by server Xlib: Client is not authorized to connect to Server emacs: Cannot connect to X server :0.0. Check the DISPLAY environment variable or use `-d'. Also use the `xhost' program to verify that it is set to permit connections from your machine. # xhost Xlib: connection to ":0.0" refused by server Xlib: Client is not authorized to connect to Server xhost: unable to open display ":0.0" # suspend $ xhost local:root non-network local connections being added to access control list OK, that fixed it. But gee, don't you see some silly actions above, like root doing a local command that doesn't need a DISPLAY to get its job done being denied, etc. Better be nice to root or he will remove you. By the way, apt-cache show xbase-clients says xhost, a very dangerous program that you should never use; Well, the man page didn't warn me. So I used it. Will my system be ruined now? By the way, on the xhost man page it says FILES /etc/X*.hosts But like hey, ls: /etc/X*.hosts: No such file or directory So it's a mystery where it wrote whatever it wrote. P.S. oh, it probably didn't write anywhere, so I do the writing, in .xsession. -- http://jidanni.org/ Taiwan(04)25854780