execve.2 (108087) | execve.2 (131504) |
---|---|
1.\" Copyright (c) 1980, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 16 unchanged lines hidden (view full) --- 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)execve.2 8.5 (Berkeley) 6/1/94 | 1.\" Copyright (c) 1980, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 16 unchanged lines hidden (view full) --- 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)execve.2 8.5 (Berkeley) 6/1/94 |
33.\" $FreeBSD: head/lib/libc/sys/execve.2 108087 2002-12-19 09:40:28Z ru $ | 33.\" $FreeBSD: head/lib/libc/sys/execve.2 131504 2004-07-02 23:52:20Z ru $ |
34.\" 35.Dd June 1, 1994 36.Dt EXECVE 2 37.Os 38.Sh NAME 39.Nm execve 40.Nd execute a file 41.Sh LIBRARY --- 11 unchanged lines hidden (view full) --- 53whose name is pointed to by 54.Fa path , 55called the 56.Em new process file . 57This file is either an executable object file, 58or a file of data for an interpreter. 59An executable object file consists of an identifying header, 60followed by pages of data representing the initial program (text) | 34.\" 35.Dd June 1, 1994 36.Dt EXECVE 2 37.Os 38.Sh NAME 39.Nm execve 40.Nd execute a file 41.Sh LIBRARY --- 11 unchanged lines hidden (view full) --- 53whose name is pointed to by 54.Fa path , 55called the 56.Em new process file . 57This file is either an executable object file, 58or a file of data for an interpreter. 59An executable object file consists of an identifying header, 60followed by pages of data representing the initial program (text) |
61and initialized data pages. Additional pages may be specified | 61and initialized data pages. 62Additional pages may be specified |
62by the header to be initialized with zero data; see 63.Xr elf 5 64and 65.Xr a.out 5 . 66.Pp 67An interpreter file begins with a line of the form: 68.Pp 69.Bd -ragged -offset indent -compact --- 12 unchanged lines hidden (view full) --- 82.Em arg 83is specified, it becomes the first argument to the 84.Em interpreter , 85and the name of the originally 86.Sy execve Ap d 87file becomes the second argument; 88otherwise, the name of the originally 89.Sy execve Ap d | 63by the header to be initialized with zero data; see 64.Xr elf 5 65and 66.Xr a.out 5 . 67.Pp 68An interpreter file begins with a line of the form: 69.Pp 70.Bd -ragged -offset indent -compact --- 12 unchanged lines hidden (view full) --- 83.Em arg 84is specified, it becomes the first argument to the 85.Em interpreter , 86and the name of the originally 87.Sy execve Ap d 88file becomes the second argument; 89otherwise, the name of the originally 90.Sy execve Ap d |
90file becomes the first argument. The original arguments are shifted over to | 91file becomes the first argument. 92The original arguments are shifted over to |
91become the subsequent arguments. 92The zeroth argument is set to the specified 93.Em interpreter . 94.Pp 95The argument 96.Fa argv 97is a pointer to a null-terminated array of 98character pointers to null-terminated character strings. 99These strings construct the argument list to be made available to the new | 93become the subsequent arguments. 94The zeroth argument is set to the specified 95.Em interpreter . 96.Pp 97The argument 98.Fa argv 99is a pointer to a null-terminated array of 100character pointers to null-terminated character strings. 101These strings construct the argument list to be made available to the new |
100process. At least one argument must be present in | 102process. 103At least one argument must be present in |
101the array; by custom, the first element should be 102the name of the executed program (for example, the last component of 103.Fa path ) . 104.Pp 105The argument 106.Fa envp 107is also a pointer to a null-terminated array of 108character pointers to null-terminated strings. --- 45 unchanged lines hidden (view full) --- 154After any set-user-ID and set-group-ID processing, 155the effective user ID is recorded as the saved set-user-ID, 156and the effective group ID is recorded as the saved set-group-ID. 157These values may be used in changing the effective IDs later (see 158.Xr setuid 2 ) . 159.Pp 160The set-ID bits are not honored if the respective file system has the 161.Cm nosuid | 104the array; by custom, the first element should be 105the name of the executed program (for example, the last component of 106.Fa path ) . 107.Pp 108The argument 109.Fa envp 110is also a pointer to a null-terminated array of 111character pointers to null-terminated strings. --- 45 unchanged lines hidden (view full) --- 157After any set-user-ID and set-group-ID processing, 158the effective user ID is recorded as the saved set-user-ID, 159and the effective group ID is recorded as the saved set-group-ID. 160These values may be used in changing the effective IDs later (see 161.Xr setuid 2 ) . 162.Pp 163The set-ID bits are not honored if the respective file system has the 164.Cm nosuid |
162option enabled or if the new process file is an interpreter file. Syscall | 165option enabled or if the new process file is an interpreter file. 166Syscall |
163tracing is disabled if effective IDs are changed. 164.Pp 165The new process also inherits the following attributes from 166the calling process: 167.Pp 168.Bl -column parent_process_ID -offset indent -compact 169.It process ID Ta see Xr getpid 2 170.It parent process ID Ta see Xr getppid 2 --- 136 unchanged lines hidden --- | 167tracing is disabled if effective IDs are changed. 168.Pp 169The new process also inherits the following attributes from 170the calling process: 171.Pp 172.Bl -column parent_process_ID -offset indent -compact 173.It process ID Ta see Xr getpid 2 174.It parent process ID Ta see Xr getppid 2 --- 136 unchanged lines hidden --- |