Article View: comp.soft-sys.andrew
Article #2054Re: Simple fix to core dump bug in AMS
From: Craig Everhart
Date: Mon, 12 Feb 1990 17:20
Date: Mon, 12 Feb 1990 17:20
42 lines
1869 bytes
1869 bytes
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
Technical Details
Message-ID:
<wZpj16r0BwwOEzFUcS@transarc.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!TRANSARC.COM!cfeReferences:
<cZphB=q0M2Yt0U4XE=@thumper.bellcore.com>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!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: <wZpj16r0BwwOEzFUcS@transarc.com> Date: 12 Feb 90 17:20:06 GMT References: <cZphB=q0M2Yt0U4XE=@thumper.bellcore.com> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 42