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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
$NetBSD: patch-aa,v 1.1 2014/07/22 08:20:24 manu Exp $
Disable the NFS code
--- src/killall5.c.orig 2014-07-01 02:01:37.000000000 +0200
+++ src/killall5.c 2014-07-03 09:53:15.000000000 +0200
@@ -42,9 +42,11 @@
*/
#include <dirent.h>
#include <errno.h>
#include <getopt.h>
+#ifdef linux
#include <mntent.h>
+#endif
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
@@ -236,8 +238,9 @@
}
return 0;
}
+#ifdef linux
/*
* Remember all NFS typed partitions.
*/
void init_nfs(void)
@@ -301,8 +304,9 @@
}
}
endmntent(mnt);
}
+#endif /* linux */
static void clear_shadow(SHADOW *restrict shadow)
{
SHADOW *s, *n, *l;
@@ -365,8 +369,9 @@
out:
return 0;
}
+#ifdef linux
/*
* Check path is located on a network based partition.
*/
int check4nfs(const char * path, char * real)
@@ -430,8 +435,9 @@
}
return 0;
}
+#endif /* linux */
int readarg(FILE *fp, char *buf, int sz)
{
int c = 0, f = 0;
@@ -607,11 +613,13 @@
p->nfs = 0;
switch (do_stat) {
+#ifdef linux
case DO_NETFS:
if ((p->nfs = check4nfs(path, buf)))
break;
+#endif
case DO_STAT:
if (stat(path, &st) != 0)
break;
p->dev = st.st_dev;
@@ -695,10 +703,12 @@
/* Try to stat the executable. */
if (prog[0] == '/') {
memset(&real[0], 0, sizeof(real));
+#ifdef linux
if (check4nfs(prog, real))
nfs++;
+#endif
if (real[0] != '\0')
prog = &real[0]; /* Binary located on network FS. */
@@ -926,10 +936,12 @@
exit(1);
}
}
+#ifdef linux
if (flags & PIDOF_NETFS)
init_nfs(); /* Which network based FS are online? */
+#endif
/* Print out process-ID's one by one. */
readproc((flags & PIDOF_NETFS) ? DO_NETFS : DO_STAT);
|