summaryrefslogtreecommitdiff
path: root/sys/dev/filemon
diff options
context:
space:
mode:
authorpgoyette <pgoyette@NetBSD.org>2015-11-22 01:20:52 +0000
committerpgoyette <pgoyette@NetBSD.org>2015-11-22 01:20:52 +0000
commit260412feaea2f12bd4879b39693ca8656d4ca818 (patch)
tree103d73def8ee0e4b836034e66dc406d42b4cf602 /sys/dev/filemon
parenta874c2dd519f09f3646a339ed0f417ae45c7d96e (diff)
Fix return-code handling for execve and chdir wrappers.
Fixes PR kern/50309
Diffstat (limited to 'sys/dev/filemon')
-rw-r--r--sys/dev/filemon/filemon_wrapper.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/filemon/filemon_wrapper.c b/sys/dev/filemon/filemon_wrapper.c
index 1e2b73cc5db..e526ea45047 100644
--- a/sys/dev/filemon/filemon_wrapper.c
+++ b/sys/dev/filemon/filemon_wrapper.c
@@ -1,4 +1,4 @@
-/* $NetBSD: filemon_wrapper.c,v 1.8 2015/11/20 01:16:04 pgoyette Exp $ */
+/* $NetBSD: filemon_wrapper.c,v 1.9 2015/11/22 01:20:52 pgoyette Exp $ */
/*
* Copyright (c) 2010, Juniper Networks, Inc.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: filemon_wrapper.c,v 1.8 2015/11/20 01:16:04 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filemon_wrapper.c,v 1.9 2015/11/22 01:20:52 pgoyette Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -48,7 +48,7 @@ filemon_wrapper_chdir(struct lwp * l, const struct sys_chdir_args * uap,
struct filemon *filemon;
if ((error = sys_chdir(l, uap, retval)) != 0)
- return 0;
+ return error;
filemon = filemon_lookup(curproc);
if (filemon == NULL)
@@ -76,11 +76,11 @@ filemon_wrapper_execve(struct lwp * l, struct sys_execve_args * uap,
struct filemon *filemon;
if ((error = sys_execve(l, uap, retval)) != EJUSTRETURN)
- return 0;
+ return error;
filemon = filemon_lookup(curproc);
if (filemon == NULL)
- return 0;
+ return EJUSTRETURN;
error = copyinstr(SCARG(uap, path), fname, sizeof(fname), &done);
if (error)
@@ -89,7 +89,7 @@ filemon_wrapper_execve(struct lwp * l, struct sys_execve_args * uap,
filemon_printf(filemon, "E %d %s\n", curproc->p_pid, fname);
out:
rw_exit(&filemon->fm_mtx);
- return 0;
+ return EJUSTRETURN;
}