Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!sdcsvax!ucsdhub!hp-sdd!hplabs!hplabsc!daemon From: daemon@hplabsc.UUCP Newsgroups: comp.mail.elm Subject: Wnewmail core dumps Message-ID: <1853@hplabsc.HP.COM> Date: Tue, 19-May-87 21:12:15 EDT Article-I.D.: hplabsc.1853 Posted: Tue May 19 21:12:15 1987 Date-Received: Thu, 21-May-87 06:04:34 EDT Sender: daemon@hplabsc.HP.COM Reply-To: @RELAY.CS.NET:sch%sequent@tektronix.tek.com (Steve Hemminger) Organization: Sequent Computer Systems, Beaverton, OR Lines: 102 Approved: taylor@hplabs (with 'postmail') The emulation of cuserid() for BSD systems in file "src/opts_utils.c" is buggy. It does not emulate all the nuances of System V version and wnewmail depends on it. *** opt_utils.c.orig Tue May 19 16:58:11 1987 --- opt_utils.c Tue May 19 17:00:34 1987 *************** *** 43,48 #ifdef NEED_CUSERID cuserid(uname) char *uname; { --- 43,49 ----- #ifdef NEED_CUSERID + char * cuserid(uname) char *uname; { *************** *** 46,54 cuserid(uname) char *uname; { ! /** Added for compatibility with Bell systems, this is the last-ditch ! attempt to get the users login name, after getlogin() fails. It ! instantiates "uname" to the name of the user... **/ struct passwd *password_entry, *getpwuid(); --- 47,54 ----- cuserid(uname) char *uname; { ! /** Added for compatibility with Bell systems, ! Check getlogin(), then the passwd file. **/ char *name, *getlogin() *************** *** 51,56 instantiates "uname" to the name of the user... **/ struct passwd *password_entry, *getpwuid(); static char buf[10]; --- 51,57 ----- Check getlogin(), then the passwd file. **/ + char *name, *getlogin() struct passwd *password_entry, *getpwuid(); static char buf[10]; *************** *** 54,60 struct passwd *password_entry, *getpwuid(); static char buf[10]; ! password_entry = getpwuid(getuid()); strcpy(uname, password_entry->pw_name); } --- 55,61 ----- struct passwd *password_entry, *getpwuid(); static char buf[10]; ! if(uname == NULL) uname = buf; if( (name = getlogin() != NULL) return strcpy(uname, name); *************** *** 56,62 password_entry = getpwuid(getuid()); ! strcpy(uname, password_entry->pw_name); } #endif --- 57,67 ----- if(uname == NULL) uname = buf; ! if( (name = getlogin() != NULL) ! return strcpy(uname, name); ! else if( (password_entry = getpwuid(getuid())) != NULL) ! return strcpy(uname, password_entry->pw_name); ! return NULL; } #endif