/*
** this is extracted from:
**  http://securitydigest.org/tcp-ip/archive/1988/11
*/

/*
 * Copyright (c) 1983 The Regents of the University of California.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms are permitted
 * provided that the above copyright notice and this paragraph are
 * duplicated in all such forms and that any documentation,
 * ...
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

...

main(argc, argv)
int argc;
char *argv[];
{
  register char *sp;
  char line[512];
  struct sockaddr_in sin;
  int i, p[2], pid, status;
  FILE *fp;
  char *av[4];

  i = sizeof (sin);
 if (getpeername(0, &sin, &i) < 0)
   fatal(argv[0], "getpeername");
 if (fgets(line, sizeof(line), stdin) == NULL)
   exit(1);
 sp = line;
 ...
 if ((pid = fork()) == 0) {
   close(p[0]);
   if (p[1] != 1) {
     dup2(p[1], 1);
     close(p[1]);
     }
   execv("/usr/ucb/finger", av);
   _exit(1);
   }
 ...
}

