Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!ucbvax!ANDREW.CMU.EDU!cfe+
From: cfe+@ANDREW.CMU.EDU ("Craig F. Everhart")
Newsgroups: comp.soft-sys.andrew
Subject: Re: AMS, CUI, VUI problems
Message-ID: 
Date: 8 Aug 89 19:22:40 GMT
References: <6927@cloud9.Stratus.COM>
Sender: daemon@ucbvax.BERKELEY.EDU
Distribution: inet
Organization: The Internet
Lines: 61

> Excerpts from internet.info-andrew: 8-Aug-89 AMS, CUI, VUI problems John
> Oleynick@bu-cs.bu.e (1556)

> Last week I rebuilt Andrew, this time with AMS.  Messages seems to work
> OK (except for 1 small problem) , but I can't read my mail with either 
> CUI or VUI.  Whenever I run either of them, they say:

> 	ELI-PRIMITIVE [READ (error opening file)]
> 	INTERNAL [eviEvalList (functionless symbol at list car)]

> And tell me that I have no mail.  Messages finds my mail fine, though.
This seems real weird: Messages, CUI, and VUI all use exactly the same
code to read and handle your mail.

> I also have a small problem with SendMessage.  Whenever I send a
> message, it says the message is from:
> 	"John Oleynick9bww:706:53" 
> My uid is 706, my gid is 53, and 9bww are the last 4 characters
> of my encrypted password, so it looks like it isn't copying something
> quite right from the password file.  Also, even though I can't read
> anything in vui, I sent a message from it, and it didn't do this.

I believe that this problem is one I fixed a couple of weeks ago in
andrew/ams/libs/ms/init.c, the GetNameFromGecos... procedure. 
Naturally, there have been other changes to this procedure, not the
least of which was renaming it from GetNameFromGecosField to
GetNameFromGecos and changing its arguments), but I bet that you could
change the code at line 563 of andrew/ams/libs/ms/init.c from:
 	if (*newname) {
 	    strncpy(*newname, start, prefixlen);
 	    if (ampersand) {
 		char *uname = (*newname) + prefixlen;
 		strcpy(uname, p->pw_name);
 		if (islower(*uname)) *uname = toupper(*uname);
 		strcat(*newname, ampersand+1);
 	    }
 	}
to:
 	if (*newname) {
 	    strncpy(*newname, start, prefixlen);
 	    if (ampersand) {
 		char *uname = (*newname) + prefixlen;
 		strcpy(uname, p->pw_name);
 		if (islower(*uname)) *uname = toupper(*uname);
 		strcat(*newname, ampersand+1);
 	    } else {
		char *uname = (*newname) + prefixlen;
		*uname = '\0';
	    }
 	}
and it would work better.  That is, in the case where there wasn't a
``&'' in your pw_gecos field, the name wasn't null-terminated, and this
causes the route-phrase in a validated address to have random garbage
after it.
All this was in the version with this RCS header:
$Header: /afs/andrew.cmu.edu/usr13/cfe/src/ams/libs/ms/test/RCS/init.c,v
2.2 88/10/02 15:42:19 ghoti Exp $
Your mileage and line numbers may vary.

		Thanks,
		Craig Everhart