Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!psuvax1!brutus.cs.uiuc.edu!grunwald
From: grunwald@foobar.colorado.edu (Dirk Grunwald)
Newsgroups: comp.unix.ultrix
Subject: getgrnam(3) busted on RISC Ultrix 3.1
Message-ID: 
Date: 25 Sep 89 16:53:41 GMT
Sender: news@brutus.cs.uiuc.edu
Reply-To: grunwald@foobar.colorado.edu
Distribution: comp
Organization: University of Colorado at Boulder
Lines: 26


The following program illustrates a problem with getgrnam under ultrix 3.1

compile it as ``foo''. If you simply run `foo' (execute getgrnam with a
null string once), it works. If you run `foo bar' (execute the getgrnam twice)
it gets a segmentation fault in getgrnam.

This raises its head in `tar' (I was unpacking gcc 1.36 when it
happened to me.) Unpacking the tar on a Sun didn't raise problems.
Using the Gnu version of TAR also caused the segmentation violation.
This led me to the following test case.

How does one file bug reports electronically?

-----foo.c------
#include 
main(argc,argv)
int argc;
char **argv;
{
  struct group *foo;

  foo = getgrnam("");
  if (argc > 1)
    foo = getgrnam("");
}