-/* $NetBSD: wump.c,v 1.8 1999/02/10 01:44:34 hubertf Exp $ */
+/* $NetBSD: wump.c,v 1.12 1999/09/12 09:02:24 jsm Exp $ */
/*
* Copyright (c) 1989, 1993
#if 0
static char sccsid[] = "@(#)wump.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: wump.c,v 1.8 1999/02/10 01:44:34 hubertf Exp $");
+__RCSID("$NetBSD: wump.c,v 1.12 1999/09/12 09:02:24 jsm Exp $");
#endif
#endif /* not lint */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#include <unistd.h>
#include "pathnames.h"
{
int c;
+ /* Revoke setgid privileges */
+ setregid(getgid(), getgid());
+
#ifdef DEBUG
while ((c = getopt(argc, argv, "a:b:hp:r:t:d")) != -1)
#else
int_compare(a, b)
const void *a, *b;
{
- return(*(int *)a < *(int *)b ? -1 : 1);
+ return(*(const int *)a < *(const int *)b ? -1 : 1);
}
void
return;
}
- if (!isatty(1))
+ if (!isatty(STDOUT_FILENO))
pager = "cat";
else {
if (!(pager = getenv("PAGER")) || (*pager == 0))
case 0: /* child */
if ((fd = open(_PATH_WUMPINFO, O_RDONLY)) == -1)
err(1, "open %s", _PATH_WUMPINFO);
- if (dup2(fd, 0) == -1)
+ if (dup2(fd, STDIN_FILENO) == -1)
err(1, "dup2");
(void)execl("/bin/sh", "sh", "-c", pager, NULL);
err(1, "exec sh -c %s", pager);