🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #98764

segmentation fault if USER and LOGNAME are not in the environment

#98764
From: Andrew Wilcox
Date: Mon, 08 Apr 1991 20:47
30 lines
1582 bytes
Using Emacs version 18.56 on a Sparcstation running Sun OS 4.0.3,
Emacs dies inside of getpwnam() if neither USER or LOGNAME are defined
in the environment:

     $ unset USER
     $ unset LOGNAME
     $ emacs
     Fatal error (11).Memory fault - core dumped

The problem in appears to be in editfns.c, which does not check if
LOGNAME is not defined:

  user_name = (char *) getenv ("USER");
  if (!user_name)
    user_name = (char *) getenv ("LOGNAME"); /* USG equivalent */
  if (user_name)
    Vuser_name = build_string (user_name);
  else
    Vuser_name = Vuser_real_name;

  tem = Fstring_equal (Vuser_name, Vuser_real_name);
  if (!NULL (tem))
    pw = (struct passwd *) getpwnam (user_name);


Regards,

Andrew Wilcox
Department of Astronomy & Astrophysics, Pennsylvania State University
(andrew@astro.psu.edu)
Technical Details
Message-ID: <9104082047.AA20438@multiwave.astro.psu.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!fauern!ira.uka.de!sol.ctr.columbia.edu!spool.mu.edu!samsung!usc!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!ucsd!ucbvax!tut.cis.ohio-state.edu!unreplyable!garbage

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,3498fe49ef605d31,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1991-04-08 20:21:49 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!fauern!ira.uka.de!sol.ctr.columbia.edu!spool.mu.edu!samsung!usc!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!ucsd!ucbvax!tut.cis.ohio-state.edu!unreplyable!garbage
From: andrew@astro.psu.edu (Andrew Wilcox)
Newsgroups: gnu.emacs.bug
Subject: segmentation fault if USER and LOGNAME are not in the environment
Message-ID: <9104082047.AA20438@multiwave.astro.psu.edu>
Date: 8 Apr 91 20:47:46 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 30
Approved: bug-gnu-emacs@prep.ai.mit.edu