Deleted Added
full compact
execve.2 (207735) execve.2 (208027)
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.

--- 12 unchanged lines hidden (view full) ---

21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\" @(#)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.

--- 12 unchanged lines hidden (view full) ---

21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\" @(#)execve.2 8.5 (Berkeley) 6/1/94
29.\" $FreeBSD: head/lib/libc/sys/execve.2 207735 2010-05-06 22:49:54Z jilles $
29.\" $FreeBSD: head/lib/libc/sys/execve.2 208027 2010-05-13 12:07:55Z uqs $
30.\"
31.Dd April 10, 2008
32.Dt EXECVE 2
33.Os
34.Sh NAME
35.Nm execve ,
36.Nm fexecve
37.Nd execute a file

--- 270 unchanged lines hidden (view full) ---

308.Fn fexecve
309will fail and return to the calling process if:
310.Bl -tag -width Er
311.It Bq Er EBADF
312The
313.Fa fd
314argument is not a valid file descriptor open for executing.
315.El
30.\"
31.Dd April 10, 2008
32.Dt EXECVE 2
33.Os
34.Sh NAME
35.Nm execve ,
36.Nm fexecve
37.Nd execute a file

--- 270 unchanged lines hidden (view full) ---

308.Fn fexecve
309will fail and return to the calling process if:
310.Bl -tag -width Er
311.It Bq Er EBADF
312The
313.Fa fd
314argument is not a valid file descriptor open for executing.
315.El
316.Sh CAVEATS
317If a program is
318.Em setuid
319to a non-super-user, but is executed when
320the real
321.Em uid
322is ``root'', then the program has some of the powers
323of a super-user as well.
324.Pp
325When executing an interpreted program through
326.Fn fexecve ,
327kernel supplies
328.Pa /dev/fd/n
329as a second argument to the interpreter,
330where
331.Ar n
332is the file descriptor passed in the
333.Fa fd
334argument to
335.Fn fexecve .
336For this construction to work correctly, the
337.Xr fdescfs 5
338filesystem shall be mounted on
339.Pa /dev/fd .
340.Sh SEE ALSO
341.Xr ktrace 1 ,
342.Xr _exit 2 ,
343.Xr fork 2 ,
344.Xr open 2 ,
345.Xr execl 3 ,
346.Xr exit 3 ,
347.Xr sysctl 3 ,

--- 20 unchanged lines hidden (view full) ---

368The
369.Fn execve
370system call appeared in
371.Bx 4.2 .
372The
373.Fn fexecve
374system call appeared in
375.Fx 8.0 .
316.Sh SEE ALSO
317.Xr ktrace 1 ,
318.Xr _exit 2 ,
319.Xr fork 2 ,
320.Xr open 2 ,
321.Xr execl 3 ,
322.Xr exit 3 ,
323.Xr sysctl 3 ,

--- 20 unchanged lines hidden (view full) ---

344The
345.Fn execve
346system call appeared in
347.Bx 4.2 .
348The
349.Fn fexecve
350system call appeared in
351.Fx 8.0 .
352.Sh CAVEATS
353If a program is
354.Em setuid
355to a non-super-user, but is executed when
356the real
357.Em uid
358is ``root'', then the program has some of the powers
359of a super-user as well.
360.Pp
361When executing an interpreted program through
362.Fn fexecve ,
363kernel supplies
364.Pa /dev/fd/n
365as a second argument to the interpreter,
366where
367.Ar n
368is the file descriptor passed in the
369.Fa fd
370argument to
371.Fn fexecve .
372For this construction to work correctly, the
373.Xr fdescfs 5
374filesystem shall be mounted on
375.Pa /dev/fd .