kern_exec.c (123909) | kern_exec.c (123923) |
---|---|
1/* 2 * Copyright (c) 1993, David Greenman 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1993, David Greenman 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/kern/kern_exec.c 123909 2003-12-27 19:40:03Z alc $"); | 28__FBSDID("$FreeBSD: head/sys/kern/kern_exec.c 123923 2003-12-28 04:18:13Z bde $"); |
29 30#include "opt_ktrace.h" 31#include "opt_mac.h" 32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/eventhandler.h> 36#include <sys/lock.h> --- 92 unchanged lines hidden (view full) --- 129} 130 131/* 132 * Each of the items is a pointer to a `const struct execsw', hence the 133 * double pointer here. 134 */ 135static const struct execsw **execsw; 136 | 29 30#include "opt_ktrace.h" 31#include "opt_mac.h" 32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/eventhandler.h> 36#include <sys/lock.h> --- 92 unchanged lines hidden (view full) --- 129} 130 131/* 132 * Each of the items is a pointer to a `const struct execsw', hence the 133 * double pointer here. 134 */ 135static const struct execsw **execsw; 136 |
137#ifndef _SYS_SYSPROTO_H_ 138struct execve_args { 139 char *fname; 140 char **argv; 141 char **envv; 142}; 143#endif 144 |
|
137/* | 145/* |
146 * MPSAFE 147 */ 148int 149execve(td, uap) 150 struct thread *td; 151 struct execve_args /* { 152 char *fname; 153 char **argv; 154 char **envv; 155 } */ *uap; 156{ 157 158 return (kern_execve(td, uap->fname, uap->argv, uap->envv, NULL)); 159} 160 161#ifndef _SYS_SYSPROTO_H_ 162struct __mac_execve_args { 163 char *fname; 164 char **argv; 165 char **envv; 166 struct mac *mac_p; 167}; 168#endif 169 170/* 171 * MPSAFE 172 */ 173int 174__mac_execve(td, uap) 175 struct thread *td; 176 struct __mac_execve_args /* { 177 char *fname; 178 char **argv; 179 char **envv; 180 struct mac *mac_p; 181 } */ *uap; 182{ 183 184#ifdef MAC 185 return (kern_execve(td, uap->fname, uap->argv, uap->envv, 186 uap->mac_p)); 187#else 188 return (ENOSYS); 189#endif 190} 191 192/* |
|
138 * In-kernel implementation of execve(). All arguments are assumed to be 139 * userspace pointers from the passed thread. 140 * 141 * MPSAFE 142 */ 143static int 144kern_execve(td, fname, argv, envv, mac_p) 145 struct thread *td; --- 518 unchanged lines hidden (view full) --- 664 mac_execve_exit(imgp); 665 if (interplabel != NULL) 666 mac_vnode_label_free(interplabel); 667#endif 668 mtx_unlock(&Giant); 669 return (error); 670} 671 | 193 * In-kernel implementation of execve(). All arguments are assumed to be 194 * userspace pointers from the passed thread. 195 * 196 * MPSAFE 197 */ 198static int 199kern_execve(td, fname, argv, envv, mac_p) 200 struct thread *td; --- 518 unchanged lines hidden (view full) --- 719 mac_execve_exit(imgp); 720 if (interplabel != NULL) 721 mac_vnode_label_free(interplabel); 722#endif 723 mtx_unlock(&Giant); 724 return (error); 725} 726 |
672#ifndef _SYS_SYSPROTO_H_ 673struct execve_args { 674 char *fname; 675 char **argv; 676 char **envv; 677}; 678#endif 679 680/* 681 * MPSAFE 682 */ | |
683int | 727int |
684execve(td, uap) 685 struct thread *td; 686 struct execve_args /* { 687 char *fname; 688 char **argv; 689 char **envv; 690 } */ *uap; 691{ 692 693 return (kern_execve(td, uap->fname, uap->argv, uap->envv, NULL)); 694} 695 696#ifndef _SYS_SYSPROTO_H_ 697struct __mac_execve_args { 698 char *fname; 699 char **argv; 700 char **envv; 701 struct mac *mac_p; 702}; 703#endif 704 705/* 706 * MPSAFE 707 */ 708int 709__mac_execve(td, uap) 710 struct thread *td; 711 struct __mac_execve_args /* { 712 char *fname; 713 char **argv; 714 char **envv; 715 struct mac *mac_p; 716 } */ *uap; 717{ 718 719#ifdef MAC 720 return (kern_execve(td, uap->fname, uap->argv, uap->envv, 721 uap->mac_p)); 722#else 723 return (ENOSYS); 724#endif 725} 726 727int | |
728exec_map_first_page(imgp) 729 struct image_params *imgp; 730{ 731 int rv, i; 732 int initial_pagein; 733 vm_page_t ma[VM_INITIAL_PAGEIN]; 734 vm_object_t object; 735 --- 463 unchanged lines hidden --- | 728exec_map_first_page(imgp) 729 struct image_params *imgp; 730{ 731 int rv, i; 732 int initial_pagein; 733 vm_page_t ma[VM_INITIAL_PAGEIN]; 734 vm_object_t object; 735 --- 463 unchanged lines hidden --- |