[comp.unix.ultrix] getgrnam

grunwald@foobar.colorado.edu (Dirk Grunwald) (09/25/89)

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 <grp.h>
main(argc,argv)
int argc;
char **argv;
{
  struct group *foo;

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