I encountered problems with the autoconf script when I tried to compile
3.11pre4 on our DEC Alpha OSF/1 3.x machines. (I've tried OSF/1 3.0 and OSF/1
3.2. We don't have any of the recent Digital Unix versions installed.) I had
previously installed 3.10 on these same machines without problems.
The problem appears to be that autoconf dies about two-thirds of the way
through the auto configuation process, right after it says "Benchmarking your
strstr() implementation..." (or words to that effect). So I modified the
script to not delete the "_autotst" binary and ran it from the command line.
Here's what happened when I ran it:
% _autotst
/* Your system's strstr() is 1.89 times SLOWER than my C-routine */
#define SLOWstrstr /* using my substitute instead */
#define UDP_protocolno 17
#define BIFF_serviceport "512"
#define IP_localhost {127,0,0,1,}
Segmentation fault
The offending source code appears to be in the else block of the following
snippet:
#ifndef NOinitgroups
if(geteuid()==ROOT_uid)
{ setgid(2);
if(!setrgid(3)&&(getgid()!=3||getegid()!=2))
puts("#define setrgid_BRAIN_DAMAGE");
else
{ setuid(2);
if(!setgid(3)&&!setgid(2))
puts("#define TOGGLE_SGID_OK");
}
}
else
{ gid_t groups[3];unsigned i;
for(i=getgroups(3,groups);i--&&groups[i]==getgid(););
if(i<3)
{ setegid(groups[i]);
if(!setrgid(groups[i])&&getgid()!=groups[i])
puts("#define setrgid_BRAIN_DAMAGE");
}
else
puts("#define setrgid_RUNTIME_CHECK");
}
#endif
Specifically, I believe the problem is with the for loop. Perhaps getgroups() is
returning -1 instead of 3?
My workaround: If I comment out the code inside the else block, it no longer
gives a segmentation fault. The autoconf script then proceeds normally, and I
was able to successfully install procmail. I haven't done a great deal of
testing with the resulting procmail binary, but it appears to be working
normally.
I'm using gcc 2.7.0 and gmake 3.74, and I'm installing it under my own userid
(not root). I'm fairly sure that the same thing happens if I use DEC's cc and
make.
Later,
Ed