View | Details | Raw Unified | Return to bug 141852
Collapse All | Expand All

(-)fuser/files/patch-fuser.c (+35 lines)
Line 0 Link Here
1
--- fuser.c.orig	2006-03-14 14:07:08.000000000 +0300
2
+++ fuser.c	2009-12-21 22:51:33.000000000 +0300
3
@@ -608,6 +608,7 @@
4
 	char		*ep;
5
 	char		*kernimg = NULL; /* We are using curr. sys by default */
6
 	char		*mcore = NULL;
7
+  int     retvalue = 0;
8
 
9
 	while ((ch = getopt(argc, argv, "C:K:cfkms:u")) != -1)
10
 		switch(ch) {
11
@@ -696,8 +697,13 @@
12
 			if (ufl != 0) {
13
 				print_file_info(pinfo->pid, \
14
 				    pinfo->uid, ufl);
15
-				if ((flags & KFLAG) != 0)
16
-					(void)kill(pinfo->pid, sig);
17
+				if ((flags & KFLAG) != 0) {
18
+            if (geteuid() == getuid()) {
19
+              (void)kill(pinfo->pid, sig);
20
+            } else {
21
+              retvalue = 1;
22
+            }
23
+        } 
24
 			}
25
 		}
26
 		(void)fprintf(stderr, "\n");
27
@@ -707,7 +713,7 @@
28
 	SLIST_FREE(&prclist, next, pinfo_free);
29
 	(void)kvm_close(kd);
30
 
31
-	return 0;
32
+	return retvalue;
33
 		
34
 }
35

Return to bug 141852