-setup (void)
-{
- int fd, pd[2];
-
- if (out)
- return;
-
- if (mail) {
- if (pipe (pd) == NOTOK)
- adios ("pipe", "unable to");
-
- switch (fork ()) {
- case NOTOK:
- adios ("fork", "unable to");
-
- case OK:
- close (pd[1]);
- if (pd[0] != 0) {
- dup2 (pd[0], 0);
- close (pd[0]);
- }
- if ((fd = open ("/dev/null", O_WRONLY)) != NOTOK)
- if (fd != 1) {
- dup2 (fd, 1);
- close (fd);
- }
- execlp (mailproc, r1bindex (mailproc, '/'),
- mail, "-subject", invo_name, NULL);
- adios (mailproc, "unable to exec ");
-
- default:
- close (pd[0]);
- out = fdopen (pd[1], "w");
- fprintf (out, "%s: the following is suspicious\n\n",
- invo_name);
- }
- }
-}
-
-#ifdef UCI
-/*
- * UCI specific stuff for conflict
- */
-
-/* taken from <grpldr.h> */
-
-#define GLDRS "/admin/etc/GroupLeaders"
-
-struct grpldr {
- char *gl_name;
- char **gl_ldr;
-};
-
-int setglent (), endglent ();
-struct grpldr *getglent (), *getglnam ();
-
-
-/* taken from the getglent() routines */
-
-#define MAXGLS 100
-
-static FILE *glp = NULL;
-static char line[BUFSIZ+1];
-static struct grpldr grpldr;
-static char *gl_ldr[MAXGLS + 1];
-
-
-setglent() {
- if (glp == NULL)
- glp = fopen (GLDRS, "r");
- else
- rewind (glp);
-
- return (glp != NULL);
-}
-
-
-endglent() {
- if (glp != NULL) {
- fclose (glp);
- glp = NULL;
- }
-
- return 1;
-}
-
-struct grpldr *getglent () {
- register char *cp,
- **q;
-
- if (glp == NULL && !setglent ())
- return NULL;
- if ((cp = fgets (line, BUFSIZ, glp)) == NULL)
- return NULL;
-
- grpldr.gl_name = cp;
- grpldr.gl_ldr = q = gl_ldr;
-
- while (*cp) {
- while (*cp && !isspace (*cp))
- cp++;
- while (*cp && isspace (*cp))
- *cp++ = '\0';
- if (*cp == '\0')
- break;
- if (q < gl_ldr + MAXGLS)
- *q++ = cp;
- else
- break;
- }
- *q = NULL;
-
- return (&grpldr);
-}
-
-struct grpldr *getglnam (name)
-char *name;