blob: af70c3b7f799ff2a41013416846bfa7d77ad60fa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
$NetBSD: patch-ab,v 1.13 2007/10/27 02:52:23 obache Exp $
--- main.c.orig 2007-05-04 20:56:20.000000000 +0000
+++ main.c
@@ -44,8 +44,18 @@ const char *CopyrightVersion = "%s %s\n\
#include "conf.h"
#include <stdio.h>
+#ifdef __STDC__
+#include <stdlib.h>
+#endif
#include <errno.h>
#include <pwd.h>
+#ifdef __NetBSD__
+#include <sys/sysctl.h>
+#endif
+
+#ifndef KI_MAXCOMLEN /* Pre NetBSD/1.5. Missing on !NetBSD */
+#define KI_MAXCOMLEN 24
+#endif
/*
* Processes which could not be checked -- usually due to permission
@@ -137,7 +147,7 @@ main(argc, argv)
for (i = 0; i < CmdIndx; i++) {
cmdp = (CmdList + i);
if ((cmdp->flags & CMD_FLAG_EXACT) != 0 &&
- STREQU(CMD, cmdp->cmd.cmdstr))
+ STRNEQU(CMD, cmdp->cmd.cmdstr, KI_MAXCOMLEN-8))
break;
else if ((cmdp->flags & CMD_FLAG_REGEX) != 0 &&
RegexMatch(CMD, cmdp) != 0)
@@ -384,8 +394,6 @@ Usage(error)
char *
SysErr()
{
- extern int errno;
-
#if defined(HAS_STRERROR) || defined(_LP64)
char *se = strerror(errno);
return((se==NULL)? "unknown error": se);
|