Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/filemon Don't allow setting the PID-to-trace if the ...



details:   https://anonhg.NetBSD.org/src/rev/f55c8663ffb4
branches:  trunk
changeset: 811867:f55c8663ffb4
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Fri Nov 20 01:21:05 2015 +0000

description:
Don't allow setting the PID-to-trace if the target has a non-native
emulation.

diffstat:

 sys/dev/filemon/filemon.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (22 lines):

diff -r ac5e089a95c6 -r f55c8663ffb4 sys/dev/filemon/filemon.c
--- a/sys/dev/filemon/filemon.c Fri Nov 20 01:16:04 2015 +0000
+++ b/sys/dev/filemon/filemon.c Fri Nov 20 01:21:05 2015 +0000
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: filemon.c,v 1.12 2015/11/20 01:12:38 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filemon.c,v 1.13 2015/11/20 01:21:05 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -308,7 +308,8 @@
                mutex_enter(proc_lock);
                tp = proc_find(*((pid_t *) data));
                mutex_exit(proc_lock);
-               if (tp == NULL) {
+               if (tp == NULL ||
+                   tp->p_emul != &emul_netbsd)) {
                        error = ESRCH;
                        break;
                }



Home | Main Index | Thread Index | Old Index