summaryrefslogtreecommitdiff
path: root/sys/kern/exec_script.c
diff options
context:
space:
mode:
authordarrenr <darrenr@NetBSD.org>2003-06-28 14:20:43 +0000
committerdarrenr <darrenr@NetBSD.org>2003-06-28 14:20:43 +0000
commit960df3c8d11a934b85f6f7d3ac388ec5ee57c12f (patch)
tree04eacdb0da6eefa4c57bf27833661e791d6a5853 /sys/kern/exec_script.c
parentda6b84e29093b9bfc2c3f38bfa199d379d8984d5 (diff)
Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace "struct proc *" with "struct lwp *" in various function prototypes, pass the lwp through and use l_proc to get the process pointer when needed. Bump the kernel rev up to 1.6V
Diffstat (limited to 'sys/kern/exec_script.c')
-rw-r--r--sys/kern/exec_script.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/kern/exec_script.c b/sys/kern/exec_script.c
index 06962abca31..2fe85823958 100644
--- a/sys/kern/exec_script.c
+++ b/sys/kern/exec_script.c
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_script.c,v 1.34 2003/05/16 14:25:03 itojun Exp $ */
+/* $NetBSD: exec_script.c,v 1.35 2003/06/28 14:21:52 darrenr Exp $ */
/*
* Copyright (c) 1993, 1994, 1996 Christopher G. Demetriou
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exec_script.c,v 1.34 2003/05/16 14:25:03 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exec_script.c,v 1.35 2003/06/28 14:21:52 darrenr Exp $");
#if defined(SETUIDSCRIPTS) && !defined(FDSCRIPTS)
#define FDSCRIPTS /* Need this for safe set-id scripts. */
@@ -66,13 +66,14 @@ __KERNEL_RCSID(0, "$NetBSD: exec_script.c,v 1.34 2003/05/16 14:25:03 itojun Exp
* into the exec package.
*/
int
-exec_script_makecmds(struct proc *p, struct exec_package *epp)
+exec_script_makecmds(struct lwp *l, struct exec_package *epp)
{
int error, hdrlinelen, shellnamelen, shellarglen;
char *hdrstr = epp->ep_hdr;
char *cp, *shellname, *shellarg, *oldpnbuf;
char **shellargp, **tmpsap;
struct vnode *scriptvp;
+ struct proc *p = l->l_proc;
#ifdef SETUIDSCRIPTS
/* Gcc needs those initialized for spurious uninitialized warning */
uid_t script_uid = (uid_t) -1;
@@ -241,9 +242,9 @@ check_shell:
oldpnbuf = epp->ep_ndp->ni_cnd.cn_pnbuf;
#ifdef VERIFIED_EXEC
- if ((error = check_exec(p, epp, 0)) == 0) {
+ if ((error = check_exec(l, epp, 0)) == 0) {
#else
- if ((error = check_exec(p, epp)) == 0) {
+ if ((error = check_exec(l, epp)) == 0) {
#endif
/* note that we've clobbered the header */
epp->ep_flags |= EXEC_DESTR|EXEC_HASES;
@@ -256,7 +257,7 @@ check_shell:
*/
if ((epp->ep_flags & EXEC_HASFD) == 0) {
vn_lock(scriptvp, LK_EXCLUSIVE | LK_RETRY);
- VOP_CLOSE(scriptvp, FREAD, p->p_ucred, p);
+ VOP_CLOSE(scriptvp, FREAD, p->p_ucred, l);
vput(scriptvp);
}
@@ -292,10 +293,10 @@ fail:
/* kill the opened file descriptor, else close the file */
if (epp->ep_flags & EXEC_HASFD) {
epp->ep_flags &= ~EXEC_HASFD;
- (void) fdrelease(p, epp->ep_fd);
+ (void) fdrelease(l, epp->ep_fd);
} else if (scriptvp) {
vn_lock(scriptvp, LK_EXCLUSIVE | LK_RETRY);
- VOP_CLOSE(scriptvp, FREAD, p->p_ucred, p);
+ VOP_CLOSE(scriptvp, FREAD, p->p_ucred, l);
vput(scriptvp);
}