Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!TRANSARC.COM!cfe From: cfe@TRANSARC.COM (Craig Everhart) Newsgroups: comp.soft-sys.andrew Subject: Re: Simple fix to core dump bug in AMS Message-ID: Date: 12 Feb 90 17:20:06 GMT References: Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 42 I'd make a better fix to the problem that Nathaniel discusses. Yes, the changes he suggests will prevent a core dump. I would argue that they don't necessarily do the right thing in the cases that would have dumped core. There are several callers of this code, not just the place in rawfile.c where zero-length files are handled. All other callers, however, always ensure that the ``domain'' argument is non-null, and the call in rawfile.c at present will always pass a ``domain'' argument when the file in question is being read from AFS. Nathaniel's fix is fine as a point of defense, but I'd suggest the following to get correct semantics. In ams/libs/ms/rawfile.c, line 132 in my copy, is a block of code that looks like the following: if (IsOnVice(fdtemp) && NewMessage->AuthCell) { p = getcpwuid(statbuf.st_uid, NewMessage->AuthCell); } else { p = getpwuid(statbuf.st_uid); } if (p) { GetNameFromGecos(p->pw_gecos, p->pw_name, NewMessage->AuthCell, &uname); } The fix I'd suggest is to replace that with: if (IsOnVice(fdtemp) && NewMessage->AuthCell) { p = getcpwuid(statbuf.st_uid, NewMessage->AuthCell); if (p) { GetNameFromGecos(p->pw_gecos, p->pw_name, NewMessage->AuthCell, &uname); } } else { p = getpwuid(statbuf.st_uid); if (p) { GetNameFromGecos(p->pw_gecos, p->pw_name, MyMailDomain, &uname); } } Craig