GNU bug report logs - #19477
24.4; Init script from su terminal

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: minor; Reported by: ibeas@HIDDEN (Álvar Ibeas); Keywords: notabug; merged with #36583, #36604; dated Wed, 31 Dec 2014 16:38:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Forcibly Merged 19477 36583 36604. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Severity set to 'minor' from 'normal' Request was from Glenn Morris <rgm@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs@HIDDEN> to internal_control <at> debbugs.gnu.org. Full text available.
bug No longer marked as fixed in versions 24.4. Request was from Glenn Morris <rgm@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 19477 <at> debbugs.gnu.org:


Received: (at 19477) by debbugs.gnu.org; 2 Jan 2015 19:01:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 02 14:01:48 2015
Received: from localhost ([127.0.0.1]:35279 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Y77To-0004B9-HK
	for submit <at> debbugs.gnu.org; Fri, 02 Jan 2015 14:01:48 -0500
Received: from fencepost.gnu.org ([208.118.235.10]:56476)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rgm@HIDDEN>) id 1Y77Tn-0004B2-B7
 for 19477 <at> debbugs.gnu.org; Fri, 02 Jan 2015 14:01:47 -0500
Received: from rgm by fencepost.gnu.org with local (Exim 4.71)
 (envelope-from <rgm@HIDDEN>)
 id 1Y77Tl-0003ld-3v; Fri, 02 Jan 2015 14:01:45 -0500
From: Glenn Morris <rgm@HIDDEN>
To: 19477 <at> debbugs.gnu.org
Subject: Re: bug#19477: 24.4; Init script from su terminal
References: <87iogrixn9.fsf@HIDDEN>
 <mailman.17015.1420051024.1147.bug-gnu-emacs@HIDDEN>
 <87mw638vgq.fsf_-_@HIDDEN>
X-Spook: Rand Corporation Bush Wired Bruxelles sweep defense
X-Ran: eSp^)kj3;--7;4xOmL1["~}$C4lt36djh2B460FND9/98M5ONvO3?xVN,+tZr*@%:^)N5-
X-Hue: yellow
X-Debbugs-No-Ack: yes
X-Attribution: GM
Date: Fri, 02 Jan 2015 14:01:44 -0500
In-Reply-To: <87mw638vgq.fsf_-_@HIDDEN> (=?utf-8?Q?=22=C3=81lvar?= Ibeas"'s
 message of "Wed, 31 Dec 2014 20:34:13 +0100")
Message-ID: <7cmw61gg6f.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-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 19477
Cc: ibeas@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)


I'm not sure this should be closed.
Perhaps there is a better way for Emacs to do what it wants
(get the name under which you logged in) than consulting LOGNAME.
Eg it could do what `logname' the program does.
Although reading the info page for that, what it does (check
/var/run/utmp etc) doesn't seem that great, or portable.

I'm not sure that what Debian's su does is "correct", but I could not
find a standard for su. In any case, this seems like one of those things
that is impossible to ever get changed, because people come to rely on
it behaving the way it does.

In any case, I think the Emacs documentation could stand to be tweaked a
bit. Eg util-linux/coreutils su only leaves LOGNAME alone if you change
to root, not if you change to a non-root user.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#19477; Package emacs. Full text available.

Message received at 19477-done <at> debbugs.gnu.org:


Received: (at 19477-done) by debbugs.gnu.org; 31 Dec 2014 19:34:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 31 14:34:20 2014
Received: from localhost ([127.0.0.1]:33988 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Y6P2B-0004TI-Un
	for submit <at> debbugs.gnu.org; Wed, 31 Dec 2014 14:34:20 -0500
Received: from mout.gmx.net ([212.227.15.15]:61871)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <ibeas@HIDDEN>) id 1Y6P29-0004T5-JG
 for 19477-done <at> debbugs.gnu.org; Wed, 31 Dec 2014 14:34:18 -0500
Received: from yermo ([79.145.174.54]) by mail.gmx.com (mrgmx001) with ESMTPSA
 (Nemesis) id 0LbuCq-1XNTMS1Vg4-00jJP6 for
 <19477-done <at> debbugs.gnu.org>; Wed, 31 Dec 2014 20:34:16 +0100
From: ibeas@HIDDEN (=?utf-8?Q?=C3=81lvar?= Ibeas)
To: 19477-done <at> debbugs.gnu.org
Subject: 24.4; Init script from su terminal
References: <87iogrixn9.fsf@HIDDEN>
 <mailman.17015.1420051024.1147.bug-gnu-emacs@HIDDEN>
Date: Wed, 31 Dec 2014 20:34:13 +0100
In-Reply-To: <mailman.17015.1420051024.1147.bug-gnu-emacs@HIDDEN> (Glenn
 Morris's message of "Wed, 31 Dec 2014 13:36:26 -0500")
Message-ID: <87mw638vgq.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K0:I6z6z8NPblabCYKKkvU0HXavehnpHYhIf4RpH19muVkVwM7epDJ
 NsTFAWyLmgQz/XjgJQgkVoG8LCdWpIsusCS7xM7DOO8VxKWEVMHFAEtM+cxGoto/UbHvEqj
 Bfw6huzq8oktEGFWbvrzt9vdEp7Fu2N3VzOUWTZOSLC8sBgYSpIfAyNLuw+7oY7vDU+cBwb
 QBANjBEwRlnpcoXGckWOw==
X-UI-Out-Filterresults: notjunk:1;
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 19477-done
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Glenn Morris <rgm@HIDDEN> writes:

> Emacs is behaving as documented.
>
> The `su' programs from coreutils (it's since been removed in favour of
> the util-linux one) and util-linux (as used by eg Red Hat) do not change
> LOGNAME or USER when su'ing to root.
>
> It seems that Debian's `su' comes from the `shadow' package and does
> change them.

Thanks for replying. I see now that most of the environment variables
are kept with the `-p' option.




Notification sent to ibeas@HIDDEN (Álvar Ibeas):
bug acknowledged by developer. Full text available.
Reply sent to ibeas@HIDDEN (Álvar Ibeas):
You have taken responsibility. Full text available.

Message received at 19477 <at> debbugs.gnu.org:


Received: (at 19477) by debbugs.gnu.org; 31 Dec 2014 18:36:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 31 13:36:32 2014
Received: from localhost ([127.0.0.1]:33937 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Y6O8G-0002yQ-6t
	for submit <at> debbugs.gnu.org; Wed, 31 Dec 2014 13:36:32 -0500
Received: from fencepost.gnu.org ([208.118.235.10]:60436)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rgm@HIDDEN>) id 1Y6O8F-0002yJ-2X
 for 19477 <at> debbugs.gnu.org; Wed, 31 Dec 2014 13:36:31 -0500
Received: from rgm by fencepost.gnu.org with local (Exim 4.71)
 (envelope-from <rgm@HIDDEN>)
 id 1Y6O8D-0008I7-DH; Wed, 31 Dec 2014 13:36:29 -0500
From: Glenn Morris <rgm@HIDDEN>
To: ibeas@HIDDEN (=?utf-8?Q?=C3=81lvar?= Ibeas)
Subject: Re: bug#19477: 24.4; Init script from su terminal
References: <87iogrixn9.fsf@HIDDEN>
X-Spook: SWAT weapons of mass destruction CIA emc e-cash target
X-Ran: %T)[Zh!)\JpGDvO|h^nLaFcq|R}-S)PXX+Rqlvfq&S?GcuVMfV/N`M/-d8@u/9=r>>qI2z
X-Hue: blue
X-Debbugs-No-Ack: yes
X-Attribution: GM
Date: Wed, 31 Dec 2014 13:36:26 -0500
In-Reply-To: <87iogrixn9.fsf@HIDDEN> (=?utf-8?Q?=22=C3=81lvar?= Ibeas"'s
 message of "Wed, 31 Dec 2014 17:36:58 +0100")
Message-ID: <gma9238y51.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 19477
Cc: 19477 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

=C3=81lvar Ibeas wrote:

> ``if you run Emacs from a shell started by `su', Emacs tries to find
> your own `.emacs', not that of the user you are currently pretending
> to be [...] It gets your user name from the environment variables
> `LOGNAME' and `USER'.''
>
> The variables LOGNAME and USER have both the value `root'. The command
> `logname' returns instead my own user name.

Emacs is behaving as documented.

The `su' programs from coreutils (it's since been removed in favour of
the util-linux one) and util-linux (as used by eg Red Hat) do not change
LOGNAME or USER when su'ing to root.

It seems that Debian's `su' comes from the `shadow' package and does
change them.

But all the `su' programs are behaving as documented too.
It's a shame they don't agree with each other...




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#19477; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 31 Dec 2014 16:37:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 31 11:37:11 2014
Received: from localhost ([127.0.0.1]:33853 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Y6MGl-00005P-Bp
	for submit <at> debbugs.gnu.org; Wed, 31 Dec 2014 11:37:11 -0500
Received: from eggs.gnu.org ([208.118.235.92]:60271)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <ibeas@HIDDEN>) id 1Y6MGj-00005G-M6
 for submit <at> debbugs.gnu.org; Wed, 31 Dec 2014 11:37:10 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ibeas@HIDDEN>) id 1Y6MGi-0005nH-K0
 for submit <at> debbugs.gnu.org; Wed, 31 Dec 2014 11:37:09 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:54737)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <ibeas@HIDDEN>) id 1Y6MGi-0005nD-HL
 for submit <at> debbugs.gnu.org; Wed, 31 Dec 2014 11:37:08 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:33760)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <ibeas@HIDDEN>) id 1Y6MGh-0001yb-EQ
 for bug-gnu-emacs@HIDDEN; Wed, 31 Dec 2014 11:37:08 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ibeas@HIDDEN>) id 1Y6MGe-0005mm-6T
 for bug-gnu-emacs@HIDDEN; Wed, 31 Dec 2014 11:37:07 -0500
Received: from mout.gmx.net ([212.227.15.18]:56138)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <ibeas@HIDDEN>) id 1Y6MGd-0005mZ-UF
 for bug-gnu-emacs@HIDDEN; Wed, 31 Dec 2014 11:37:04 -0500
Received: from yermo ([81.38.184.122]) by mail.gmx.com (mrgmx002) with ESMTPSA
 (Nemesis) id 0M08ia-1Xq4Qq0LMa-00uIKS for <bug-gnu-emacs@HIDDEN>;
 Wed, 31 Dec 2014 17:37:00 +0100
From: ibeas@HIDDEN (=?utf-8?Q?=C3=81lvar?= Ibeas)
To: bug-gnu-emacs@HIDDEN
Subject: 24.4; Init script from su terminal
Date: Wed, 31 Dec 2014 17:36:58 +0100
Message-ID: <87iogrixn9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K0:y0k1vlJQn/M9SDTXPf8q69LjKyj1QzWhljPc++HPIgOgxovX5/z
 gzuCZiGa54UPkshkD33Fjj7k1r89v3Ez7TfZ4zvgxbCwbQNRC8nN0tkJ19zJzplVkNVdTp+
 r/po3sEPcrHm7u6Ib/TV6ZmAJGbBBsRvRg0Pbwr91KHXzYMZ0yvAvMhVIkcAao8bafpihtF
 OOdbpgT4FuvFUG2cFwnqw==
X-UI-Out-Filterresults: notjunk:1;
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic]
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.1 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.1 (----)

Hello,

Working under Debian, when I switch to root using `su', Emacs doesn't
load the init script located in my user's home folder, as the manual
says:

``if you run Emacs from a shell started by `su', Emacs tries to find
your own `.emacs', not that of the user you are currently pretending
to be [...] It gets your user name from the environment variables
`LOGNAME' and `USER'.''

The variables LOGNAME and USER have both the value `root'. The command
`logname' returns instead my own user name.

Is this an Emacs bug?





Acknowledgement sent to ibeas@HIDDEN (Álvar Ibeas):
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#19477; 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: Tue, 25 Jan 2022 13:45:01 UTC

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