diff options
author | dg <dg@FreeBSD.org> | 1995-11-06 12:52:37 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-11-06 12:52:37 +0000 |
commit | b0e92e3fe4280bcb3c077c4b792fd4b49023a90e (patch) | |
tree | b1085bc2d506b9f9ebbc0763719203202ce8d6a6 /sys/kern/imgact_aout.c | |
parent | 70e33173922ad4e39017ab578a3fe083ecc6b794 (diff) | |
download | FreeBSD-src-b0e92e3fe4280bcb3c077c4b792fd4b49023a90e.zip FreeBSD-src-b0e92e3fe4280bcb3c077c4b792fd4b49023a90e.tar.gz |
All:
Changed vnodep -> vp for consistency with the rest of the kernel, and
changed iparams -> imgp for brevity.
kern_exec.c:
Explicitly initialized some additional parts of the image_params struct
to avoid bzeroing it. Rewrote the set-id code to reduce the number of
logical tests. The rewrite exposed a mostly benign bug in the algorithm:
traced set-id images would get ktracing disabled even if the set-id didn't
happen for other reasons.
Diffstat (limited to 'sys/kern/imgact_aout.c')
-rw-r--r-- | sys/kern/imgact_aout.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index edf7c56..920952f 100644 --- a/sys/kern/imgact_aout.c +++ b/sys/kern/imgact_aout.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: imgact_aout.c,v 1.15 1995/08/24 10:32:36 davidg Exp $ + * $Id: imgact_aout.c,v 1.16 1995/09/08 13:24:32 davidg Exp $ */ #include <sys/param.h> @@ -44,11 +44,11 @@ #include <vm/vm.h> int -exec_aout_imgact(iparams) - struct image_params *iparams; +exec_aout_imgact(imgp) + struct image_params *imgp; { - struct exec *a_out = (struct exec *) iparams->image_header; - struct vmspace *vmspace = iparams->proc->p_vmspace; + struct exec *a_out = (struct exec *) imgp->image_header; + struct vmspace *vmspace = imgp->proc->p_vmspace; unsigned long vmaddr, virtual_offset, file_offset; unsigned long bss_size; int error; @@ -111,7 +111,7 @@ exec_aout_imgact(iparams) return (-1); /* text + data can't exceed file size */ - if (a_out->a_data + a_out->a_text > iparams->attr->va_size) + if (a_out->a_data + a_out->a_text > imgp->attr->va_size) return (EFAULT); /* @@ -125,18 +125,18 @@ exec_aout_imgact(iparams) /* data + bss can't exceed rlimit */ a_out->a_data + bss_size > - iparams->proc->p_rlimit[RLIMIT_DATA].rlim_cur) + imgp->proc->p_rlimit[RLIMIT_DATA].rlim_cur) return (ENOMEM); /* copy in arguments and/or environment from old process */ - error = exec_extract_strings(iparams); + error = exec_extract_strings(imgp); if (error) return (error); /* * Destroy old process VM and create a new one (with a new stack) */ - exec_new_vmspace(iparams); + exec_new_vmspace(imgp); /* * Map text read/execute @@ -149,7 +149,7 @@ exec_aout_imgact(iparams) VM_PROT_READ | VM_PROT_EXECUTE, /* protection */ VM_PROT_READ | VM_PROT_EXECUTE | VM_PROT_WRITE, /* max protection */ MAP_PRIVATE | MAP_FIXED, /* flags */ - (caddr_t)iparams->vnodep, /* vnode */ + (caddr_t)imgp->vp, /* vnode */ file_offset); /* offset */ if (error) return (error); @@ -165,7 +165,7 @@ exec_aout_imgact(iparams) a_out->a_data, VM_PROT_READ | VM_PROT_WRITE | (a_out->a_text ? 0 : VM_PROT_EXECUTE), VM_PROT_ALL, MAP_PRIVATE | MAP_FIXED, - (caddr_t) iparams->vnodep, + (caddr_t) imgp->vp, file_offset + a_out->a_text); if (error) return (error); @@ -189,13 +189,13 @@ exec_aout_imgact(iparams) vmspace->vm_daddr = (caddr_t) virtual_offset + a_out->a_text; /* Fill in image_params */ - iparams->interpreted = 0; - iparams->entry_addr = a_out->a_entry; + imgp->interpreted = 0; + imgp->entry_addr = a_out->a_entry; - iparams->proc->p_sysent = &aout_sysvec; + imgp->proc->p_sysent = &aout_sysvec; /* Indicate that this file should not be modified */ - iparams->vnodep->v_flag |= VTEXT; + imgp->vp->v_flag |= VTEXT; return (0); } |