🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #1840

bug in get-real-user-name/startup.el

#1840
From: Jonathan Shapiro
Date: Tue, 09 Jan 1990 21:30
29 lines
1346 bytes
Symptom:  "error in init file" diagnostic when starting up,
but no init file.

Repeat by:  In an environment where yellow pages is running, create a
yellow pages passwd entry of the form:

	+user:::user-name:user-directory:

invoke emacs.

What's happening:

Since there is no uid in the passwd entry, the call to getpwuid() in
USER-REAL-LOGIN-NAME in editfns.c fails, resulting in a real-user-name
of "unknown".  startup.el in turn fails if the real-user-id and the
user-id don't match.

Easy workaround: edit startup.el to special case a
USER-REAL-LOGIN-NAME of "unknown" and go with the USER-LOGIN-NAME.

Moral: Don't rely on getpwuid() returning the right answer.  If it
returns NULL and the real uid is the same as the effective uid, the
best you can do is to believe whatever you find in the LOGNAME or USER
environment variables.

I will also post an SGI bug on this.

Jon Shapiro
Silicon Graphics
Technical Details
Message-ID: <9001092130.AA04162@delrey.wpd.sgi.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!SGI.COM!shap%delrey.wpd

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!SGI.COM!shap%delrey.wpd
From: shap%delrey.wpd@SGI.COM (Jonathan Shapiro)
Newsgroups: gnu.emacs.bug
Subject: bug in get-real-user-name/startup.el
Message-ID: <9001092130.AA04162@delrey.wpd.sgi.com>
Date: 9 Jan 90 21:30:20 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 29