GNU bug report logs - #1540
emacsclient -t fails under su

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Glenn Morris <rgm@HIDDEN>; dated Thu, 11 Dec 2008 20:20:05 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.0000 Tokens: new, 7; hammy, 108; neutral, 36; spammy, 1.
	spammytokens:0.930-3--forth hammytokens:0.000-+--emacs, 0.000-+--Emacs,
	0.000-+--H*M:fsf, 0.000-+--H*UA:Emacs, 0.000-+--H*u:Emacs
X-Spam-Status: No, score=-6.6 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER
	autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1540) by emacsbugs.donarmstrong.com; 12 Dec 2008 19:02:38 +0000
Received: from chene.dit.umontreal.ca (chene.dit.umontreal.ca [132.204.246.20])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBCJ2X7f003622
	for <1540@HIDDEN>; Fri, 12 Dec 2008 11:02:35 -0800
Received: from alfajor.home (vpn-132-204-232-87.acd.umontreal.ca [132.204.232.87])
	by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id mBCJ2WGE001173;
	Fri, 12 Dec 2008 14:02:32 -0500
Received: by alfajor.home (Postfix, from userid 20848)
	id D13B51C13C; Fri, 12 Dec 2008 14:02:31 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Dan Nicolaescu <dann@HIDDEN>
Cc: 1540 <at> debbugs.gnu.org, Glenn Morris <rgm@HIDDEN>
Subject: Re: bug#1540: emacsclient -t fails under su
Message-ID: <jwv4p19te0y.fsf-monnier+emacsbugreports@HIDDEN>
References: <uqoczi8o6x.fsf@HIDDEN>
	<200812112119.mBBLJwj7001473@HIDDEN>
	<iswse6fexz.fsf@HIDDEN>
	<200812120118.mBC1IOvm002208@HIDDEN>
Date: Fri, 12 Dec 2008 14:02:31 -0500
In-Reply-To: <200812120118.mBC1IOvm002208@HIDDEN> (Dan
	Nicolaescu's message of "Thu, 11 Dec 2008 17:18:24 -0800 (PST)")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 1 Rules triggered
	RV3167=0

> emacs tries to open the tty of the emacsclient process, which 
> ttyname (fileno (stdout)) says it's /dev/pts/12
> /dev/pts/12 is owned by user1, and user2 has no access to it

Indeed.  You can make it work by letting user2 create another pts for
Emacs to use and then transfer back&forth the commands on one pts to
the other.  E.g. user2 runs scren and then emacsclient -t in screen.
Or user2 does "ssh localhost" and then runs emacsclient -t in that
ssh session.  Or ...






Acknowledgement sent to Stefan Monnier <monnier@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1540; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.0000 Tokens: new, 20; hammy, 151; neutral, 63; spammy,
	0. spammytokens: hammytokens:0.000-+--emacs, 0.000-+--H*M:fsf,
	0.000-+--H*UA:Emacs, 0.000-+--H*u:Emacs, 0.000-+--H*MI:fsf
X-Spam-Status: No, score=-13.1 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER,
	RCVD_IN_DNSWL_HI autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1540) by emacsbugs.donarmstrong.com; 12 Dec 2008 15:11:32 +0000
Received: from mx1.suse.de (mail.suse.de [195.135.220.2])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBCFBS8p002969
	for <1540@HIDDEN>; Fri, 12 Dec 2008 07:11:30 -0800
Received: from Relay1.suse.de (relay-ext.suse.de [195.135.221.8])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.suse.de (Postfix) with ESMTP id C0FBD453D9;
	Fri, 12 Dec 2008 16:11:27 +0100 (CET)
From: Andreas Schwab <schwab@HIDDEN>
To: Dan Nicolaescu <dann@HIDDEN>
Cc: 1540 <at> debbugs.gnu.org, Glenn Morris <rgm@HIDDEN>
Subject: Re: bug#1540: emacsclient -t fails under su
References: <uqoczi8o6x.fsf@HIDDEN>
	<200812112119.mBBLJwj7001473@HIDDEN>
	<iswse6fexz.fsf@HIDDEN>
	<200812120102.mBC12jZT002044@HIDDEN>
X-Yow: NOW, I'm supposed to SCRAMBLE two, and HOLD th' MAYO!!
Date: Fri, 12 Dec 2008 16:11:27 +0100
In-Reply-To: <200812120102.mBC12jZT002044@HIDDEN> (Dan
	Nicolaescu's message of "Thu, 11 Dec 2008 17:02:45 -0800 (PST)")
Message-ID: <jeljulpgww.fsf@HIDDEN>
User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Dan Nicolaescu <dann@HIDDEN> writes:

> Glenn Morris <rgm@HIDDEN> writes:
>
>   > I know nothing about how this all works, but my naive expectation was
>   > that since emacs -nw works, emacsclient -t should too. But if that's
>   > not possible, fine. If it's possible but difficult, just stopping the
>   > crash and leaving the rest open as a wishlist is fine too.
>
> Not sure about the underlying problem. 

Doing it right would require passing a file descriptor instead of the
terminal name from emacsclient to emacs.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@HIDDEN
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Acknowledgement sent to Andreas Schwab <schwab@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1540; Package emacs. Full text available.
Severity set to `wishlist' from `normal' Request was from Glenn Morris <rgm@HIDDEN> to control@HIDDEN. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.0000 Tokens: new, 20; hammy, 71; neutral, 48; spammy, 0.
	spammytokens: hammytokens:0.000-+--H*M:fsf, 0.000-+--H*UA:Emacs,
	0.000-+--H*u:Emacs, 0.000-+--H*MI:fsf, 0.000-+--H*UA:Gnus
X-Spam-Status: No, score=-13.4 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER,
	RCVD_IN_DNSWL_MED,VALID_BTS_CONTROL,X_DEBBUGS_NO_ACK autolearn=ham
	version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1540) by emacsbugs.donarmstrong.com; 12 Dec 2008 01:32:39 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBC1WTEU002983;
	Thu, 11 Dec 2008 17:32:31 -0800
Received: from rgm by fencepost.gnu.org with local (Exim 4.67)
	(envelope-from <rgm@HIDDEN>)
	id 1LAwsg-0000oJ-Pw; Thu, 11 Dec 2008 20:31:50 -0500
From: Glenn Morris <rgm@HIDDEN>
To: Dan Nicolaescu <dann@HIDDEN>
Cc: 1540 <at> debbugs.gnu.org,
        control <control <at> debbugs.gnu.org>
Subject: Re: bug#1540: emacsclient -t fails under su
References: <uqoczi8o6x.fsf@HIDDEN>
	<200812112119.mBBLJwj7001473@HIDDEN>
	<iswse6fexz.fsf@HIDDEN>
	<200812120102.mBC12jZT002044@HIDDEN>
X-Spook: Elvis explosion encryption Sundevil Commecen Hamas Mossad
X-Ran: w>Pe*ZWZo[Z{Y(G6A;'Az6(~vu<8^o\E[o`q..w-gAsyxYqT^0Vz)y7o)$kQh;*)4(:O,D
X-Hue: red
X-Debbugs-No-Ack: yes
X-Attribution: GM
Date: Thu, 11 Dec 2008 20:31:50 -0500
In-Reply-To: <200812120102.mBC12jZT002044@HIDDEN> (Dan
	Nicolaescu's message of "Thu, 11 Dec 2008 17:02:45 -0800 (PST)")
Message-ID: <cwtz9ab2m1.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

severity 1540 wishlist
stop

Dan Nicolaescu wrote:

> The crash should be gone now.

Yes, thanks.

> Not sure about the underlying problem. 

I changed dealing with that to a wishlist item. If it turns out to be
insoluble, feel free to close or tag as wontfix




Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1540; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.0000 Tokens: new, 10; hammy, 99; neutral, 46; spammy, 0.
	spammytokens: hammytokens:0.000-+--emacs, 0.000-+--H*i:message,
	0.000-+--H*i:2008, 0.000-+--HX-Debbugs-No-Ack:yes, 0.000-+--H*MI:message
X-Spam-Status: No, score=-9.2 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER,
	X_DEBBUGS_NO_ACK autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1540) by emacsbugs.donarmstrong.com; 12 Dec 2008 01:18:38 +0000
Received: from barrelv2.ics.uci.edu (barrelv2.ics.uci.edu [128.195.1.114])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBC1IZ47031416
	for <1540@HIDDEN>; Thu, 11 Dec 2008 17:18:36 -0800
Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93])
	by barrelv2.ics.uci.edu (8.13.8+Sun/8.13.8) with ESMTP id mBC1IOPZ024970;
	Thu, 11 Dec 2008 17:18:24 -0800 (PST)
Received: (from dann@localhost)
	by mothra.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id mBC1IOvm002208;
	Thu, 11 Dec 2008 17:18:24 -0800 (PST)
Date: Thu, 11 Dec 2008 17:18:24 -0800 (PST)
Message-Id: <200812120118.mBC1IOvm002208@HIDDEN>
From: Dan Nicolaescu <dann@HIDDEN>
To: Glenn Morris <rgm@HIDDEN>
Cc: 1540 <at> debbugs.gnu.org
Subject: Re: bug#1540: emacsclient -t fails under su
References: <uqoczi8o6x.fsf@HIDDEN>
	<200812112119.mBBLJwj7001473@HIDDEN>
	<iswse6fexz.fsf@HIDDEN>
X-Debbugs-No-Ack: yes
In-Reply-To: <iswse6fexz.fsf@HIDDEN> (Glenn Morris's message of
	"Thu, 11 Dec 2008 18:51:52 -0500")
Lines: 20
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-ICS-MailScanner-Information: Please contact the ISP for more information
X-ICS-MailScanner-ID: mBC1IOPZ024970
X-ICS-MailScanner: Found to be clean
X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5,
	autolearn=disabled, ALL_TRUSTED -1.44)
X-ICS-MailScanner-From: dann@HIDDEN

Glenn Morris <rgm@HIDDEN> writes:

  > I know nothing about how this all works, but my naive expectation was
  > that since emacs -nw works, emacsclient -t should too.


A little explanation what is going on.  Given this example:

  > user1> su - user2
  > user2> emacs -Q -nw
  > user2> emacs -Q -f server-start &    # works fine
  > user2> emacsclient -c                # works fine
  > user2> emacsclient -t
  > *ERROR*: Could not open file: /dev/pts/12
  > 
  > (and indeed user2 does not have permissions for this file)

emacs tries to open the tty of the emacsclient process, which 
ttyname (fileno (stdout)) says it's /dev/pts/12
/dev/pts/12 is owned by user1, and user2 has no access to it




Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1540; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.0000 Tokens: new, 12; hammy, 96; neutral, 55; spammy, 1.
	spammytokens:0.987-1--Anything hammytokens:0.000-+--emacs,
	0.000-+--H*i:message, 0.000-+--H*i:2008, 0.000-+--HX-Debbugs-No-Ack:yes,
	0.000-+--H*MI:message
X-Spam-Status: No, score=-9.1 required=4.0 tests=AWL,BAYES_00,FOURLA,
	HAS_BUG_NUMBER,X_DEBBUGS_NO_ACK autolearn=ham
	version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1540) by emacsbugs.donarmstrong.com; 12 Dec 2008 01:03:08 +0000
Received: from barrelv2.ics.uci.edu (barrelv2.ics.uci.edu [128.195.1.114])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBC135ZS026588
	for <1540@HIDDEN>; Thu, 11 Dec 2008 17:03:06 -0800
Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93])
	by barrelv2.ics.uci.edu (8.13.8+Sun/8.13.8) with ESMTP id mBC12k8u022598;
	Thu, 11 Dec 2008 17:02:50 -0800 (PST)
Received: (from dann@localhost)
	by mothra.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id mBC12jZT002044;
	Thu, 11 Dec 2008 17:02:45 -0800 (PST)
Date: Thu, 11 Dec 2008 17:02:45 -0800 (PST)
Message-Id: <200812120102.mBC12jZT002044@HIDDEN>
From: Dan Nicolaescu <dann@HIDDEN>
To: Glenn Morris <rgm@HIDDEN>
Cc: 1540 <at> debbugs.gnu.org
Subject: Re: bug#1540: emacsclient -t fails under su
References: <uqoczi8o6x.fsf@HIDDEN>
	<200812112119.mBBLJwj7001473@HIDDEN>
	<iswse6fexz.fsf@HIDDEN>
X-Debbugs-No-Ack: yes
In-Reply-To: <iswse6fexz.fsf@HIDDEN> (Glenn Morris's message of
	"Thu, 11 Dec 2008 18:51:52 -0500")
Lines: 19
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-ICS-MailScanner-Information: Please contact the ISP for more information
X-ICS-MailScanner-ID: mBC12k8u022598
X-ICS-MailScanner: Found to be clean
X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5,
	autolearn=disabled, ALL_TRUSTED -1.44)
X-ICS-MailScanner-From: dann@HIDDEN

Glenn Morris <rgm@HIDDEN> writes:

  > Dan Nicolaescu wrote:
  > 
  > > Not sure what to do.  The quick way out would be for emacsclient to
  > > check if the tty is writable, and refuse to try to connect in case it is
  > > not.  But is that TRTD?
  > 
  > Anything that stops the crash has to be an improvement.

The crash should be gone now.

  > I know nothing about how this all works, but my naive expectation was
  > that since emacs -nw works, emacsclient -t should too. But if that's
  > not possible, fine. If it's possible but difficult, just stopping the
  > crash and leaving the rest open as a wishlist is fine too.

Not sure about the underlying problem. 
It would be interesting to know if this happens on all OSes.




Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1540; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.0000 Tokens: new, 18; hammy, 65; neutral, 61; spammy, 0.
	spammytokens: hammytokens:0.000-+--emacs, 0.000-+--H*M:fsf,
	0.000-+--H*UA:Emacs, 0.000-+--H*u:Emacs, 0.000-+--H*MI:fsf
X-Spam-Status: No, score=-12.3 required=4.0 tests=AWL,BAYES_00,FOURLA,
	HAS_BUG_NUMBER,RCVD_IN_DNSWL_MED,X_DEBBUGS_NO_ACK autolearn=ham
	version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1540) by emacsbugs.donarmstrong.com; 11 Dec 2008 23:52:33 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBBNqUqH006836
	for <1540@HIDDEN>; Thu, 11 Dec 2008 15:52:32 -0800
Received: from rgm by fencepost.gnu.org with local (Exim 4.67)
	(envelope-from <rgm@HIDDEN>)
	id 1LAvJw-0005Kk-Ck; Thu, 11 Dec 2008 18:51:52 -0500
From: Glenn Morris <rgm@HIDDEN>
To: Dan Nicolaescu <dann@HIDDEN>
Cc: 1540 <at> debbugs.gnu.org
Subject: Re: bug#1540: emacsclient -t fails under su
References: <uqoczi8o6x.fsf@HIDDEN>
	<200812112119.mBBLJwj7001473@HIDDEN>
X-Spook: Telex Fortezza Ceridian Audiotel South Africa president
X-Ran: o:6-riU(plF,wKHBZ[lU}|-j3?mr/bip`56.)g14*z|^.dG<$U:MnYgB@i-Kj3f9}%R\fB
X-Hue: white
X-Debbugs-No-Ack: yes
X-Attribution: GM
Date: Thu, 11 Dec 2008 18:51:52 -0500
Message-ID: <iswse6fexz.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

Dan Nicolaescu wrote:

> Not sure what to do.  The quick way out would be for emacsclient to
> check if the tty is writable, and refuse to try to connect in case it is
> not.  But is that TRTD?

Anything that stops the crash has to be an improvement.

I know nothing about how this all works, but my naive expectation was
that since emacs -nw works, emacsclient -t should too. But if that's
not possible, fine. If it's possible but difficult, just stopping the
crash and leaving the rest open as a wishlist is fine too.




Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1540; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.0000 Tokens: new, 18; hammy, 104; neutral, 50; spammy,
	2. spammytokens:0.987-1--analyzed, 0.863-+--here hammytokens:0.000-+--emacs,
	0.000-+--Emacs, 0.000-+--H*i:message, 0.000-+--H*i:2008,
	0.000-+--HX-Debbugs-No-Ack:yes
X-Spam-Status: No, score=-9.1 required=4.0 tests=AWL,BAYES_00,FOURLA,
	HAS_BUG_NUMBER,X_DEBBUGS_NO_ACK autolearn=ham
	version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 1540) by emacsbugs.donarmstrong.com; 11 Dec 2008 21:20:17 +0000
Received: from sallyv2.ics.uci.edu (sallyv2.ics.uci.edu [128.195.1.120])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBBLKEKS023435
	for <1540@HIDDEN>; Thu, 11 Dec 2008 13:20:15 -0800
Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93])
	by sallyv2.ics.uci.edu (8.13.7+Sun/8.13.7) with ESMTP id mBBLJw6E022050;
	Thu, 11 Dec 2008 13:19:58 -0800 (PST)
Received: (from dann@localhost)
	by mothra.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id mBBLJwj7001473;
	Thu, 11 Dec 2008 13:19:58 -0800 (PST)
Date: Thu, 11 Dec 2008 13:19:58 -0800 (PST)
Message-Id: <200812112119.mBBLJwj7001473@HIDDEN>
From: Dan Nicolaescu <dann@HIDDEN>
To: Glenn Morris <rgm@HIDDEN>
Cc: 1540 <at> debbugs.gnu.org
Subject: Re: bug#1540: emacsclient -t fails under su
References: <uqoczi8o6x.fsf@HIDDEN>
X-Debbugs-No-Ack: yes
In-Reply-To: <uqoczi8o6x.fsf@HIDDEN> (Glenn Morris's message of
	"Thu, 11 Dec 2008 15:13:58 -0500")
Lines: 32
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-ICS-MailScanner-Information: Please contact the ISP for more information
X-ICS-MailScanner-ID: mBBLJw6E022050
X-ICS-MailScanner: Found to be clean
X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5,
	autolearn=disabled, ALL_TRUSTED -1.44)
X-ICS-MailScanner-From: dann@HIDDEN

Glenn Morris <rgm@HIDDEN> writes:

  > I'm logged into an X session as user1.
  > From the xterm associated with /dev/pts/12, I do:
  > 
  > user1> su - user2
  > user2> emacs -Q -nw
  > 
  > That works fine. Then I exit that Emacs and do:

I analyzed this about a year ago, but forgot about it :-(

  > user2> emacs -Q -f server-start &    # works fine
  > user2> emacsclient -c                # works fine
  > user2> emacsclient -t
  > *ERROR*: Could not open file: /dev/pts/12
  > 
  > (and indeed user2 does not have permissions for this file)

One problem is here: when this happens the terminal data structure is
half created, so not complete, because of that when accessing the second
time...

  > user2> emacsclient -t
  > 
  > This second attempt kills Emacs with a segfault.

... we get a crash here.

Not sure what to do.  The quick way out would be for emacsclient to
check if the tty is writable, and refuse to try to connect in case it is
not.  But is that TRTD?




Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1540; Package emacs. Full text available.

Message received at (unknown):


Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.0000 Tokens: new, 31; hammy, 50; neutral, 61; spammy, 0.
	spammytokens: hammytokens:0.000-+--emacs, 0.000-+--Emacs, 0.000-+--H*M:fsf,
	0.000-+--H*UA:Emacs, 0.000-+--H*u:Emacs
X-Spam-Status: No, score=-10.9 required=4.0 tests=AWL,BAYES_00,
	RCVD_IN_DNSWL_MED,X_DEBBUGS_NO_ACK autolearn=ham
	version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 11 Dec 2008 20:14:41 +0000
Received: from lists.gnu.org (lists.gnu.org [199.232.76.165])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBBKEcS2000344
	for <submit@HIDDEN>; Thu, 11 Dec 2008 12:14:39 -0800
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LArvi-0003PJ-2I
	for bug-gnu-emacs@HIDDEN; Thu, 11 Dec 2008 15:14:38 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LArvg-0003OU-ED
	for bug-gnu-emacs@HIDDEN; Thu, 11 Dec 2008 15:14:37 -0500
Received: from [199.232.76.173] (port=35997 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43)
	id 1LArvg-0003ON-A9
	for bug-gnu-emacs@HIDDEN; Thu, 11 Dec 2008 15:14:36 -0500
Received: from fencepost.gnu.org ([140.186.70.10]:45068)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <rgm@HIDDEN>)
	id 1LArvg-0007aj-3k
	for bug-gnu-emacs@HIDDEN; Thu, 11 Dec 2008 15:14:36 -0500
Received: from rgm by fencepost.gnu.org with local (Exim 4.67)
	(envelope-from <rgm@HIDDEN>)
	id 1LArv4-0000p4-6j; Thu, 11 Dec 2008 15:13:58 -0500
From: Glenn Morris <rgm@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: emacsclient -t fails under su
X-Spook: national information infrastructure credit card digicash
X-Ran: -wBW.]b<5kd7xdPaaM<2P6{Gia!!QFb^bH1IHs2UPK1K3cz9N\;Ae(QsuSkiproJm}.kTj
X-Hue: red
X-Debbugs-No-Ack: yes
X-Attribution: GM
Date: Thu, 11 Dec 2008 15:13:58 -0500
Message-ID: <uqoczi8o6x.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4)


I'm logged into an X session as user1.
From the xterm associated with /dev/pts/12, I do:

user1> su - user2
user2> emacs -Q -nw

That works fine. Then I exit that Emacs and do:

user2> emacs -Q -f server-start &    # works fine
user2> emacsclient -c                # works fine
user2> emacsclient -t
*ERROR*: Could not open file: /dev/pts/12

(and indeed user2 does not have permissions for this file)

user2> emacsclient -t

This second attempt kills Emacs with a segfault.





Report forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#1540; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.