From 8ebc2e9beec6e592b40d97596776d080e2b3b63c Mon Sep 17 00:00:00 2001 From: elad Date: Sun, 26 Jun 2005 19:58:29 +0000 Subject: From marius@openbsd: Add an exec message so that whenever a set-uid/gid process executes a new image which we may control, the exec does not go by unnoticed. --- sys/kern/exec_script.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'sys/kern/exec_script.c') diff --git a/sys/kern/exec_script.c b/sys/kern/exec_script.c index 4b2dc1bd161..36a93503dc7 100644 --- a/sys/kern/exec_script.c +++ b/sys/kern/exec_script.c @@ -1,4 +1,4 @@ -/* $NetBSD: exec_script.c,v 1.39 2005/05/19 20:16:19 elad Exp $ */ +/* $NetBSD: exec_script.c,v 1.40 2005/06/26 19:58:29 elad Exp $ */ /* * Copyright (c) 1993, 1994, 1996 Christopher G. Demetriou @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: exec_script.c,v 1.39 2005/05/19 20:16:19 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exec_script.c,v 1.40 2005/06/26 19:58:29 elad Exp $"); #if defined(SETUIDSCRIPTS) && !defined(FDSCRIPTS) #define FDSCRIPTS /* Need this for safe set-id scripts. */ @@ -56,6 +56,10 @@ __KERNEL_RCSID(0, "$NetBSD: exec_script.c,v 1.39 2005/05/19 20:16:19 elad Exp $" #include +#ifdef SYSTRACE +#include +#endif /* SYSTRACE */ + /* * exec_script_makecmds(): Check if it's an executable shell script. * @@ -225,8 +229,13 @@ check_shell: if ((epp->ep_flags & EXEC_HASFD) == 0) { #endif /* normally can't fail, but check for it if diagnostic */ +#ifdef SYSTRACE + error = copystr(epp->ep_name, *tmpsap++, MAXPATHLEN, + (size_t *)0); +#else error = copyinstr(epp->ep_name, *tmpsap++, MAXPATHLEN, (size_t *)0); +#endif /* SYSTRACE */ #ifdef DIAGNOSTIC if (error != 0) panic("exec_script: copyinstr couldn't fail"); -- cgit