.\" -*- coding: UTF-8 -*- .\" Copyright (c) 2006, 2014, Michael Kerrisk .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH FEXECVE 3 "10 octobre 2019" Linux "Manuel du programmeur Linux" .SH NOM fexecve \- Exécuter un programme indiqué par un descripteur de fichier .SH SYNOPSIS .nf \fB#include \fP .PP \fBint fexecve(int \fP\fIfd\fP\fB, char *const \fP\fIargv\fP\fB[], char *const \fP\fIenvp\fP\fB[]);\fP .fi .PP .in -4n Exigences de macros de test de fonctionnalités pour la glibc (consulter \fBfeature_test_macros\fP(7))\ : .in .PP \fBfexecve\fP()\ : .PD 0 .ad l .RS 4 .TP 4 Depuis la glibc 2.10\ : _POSIX_C_SOURCE\ >=\ 200809L .TP Avant la glibc 2.10\ : _GNU_SOURCE .RE .ad .PD .SH DESCRIPTION \fBfexecve\fP() performs the same task as \fBexecve\fP(2), with the difference that the file to be executed is specified via a file descriptor, \fIfd\fP, rather than via a pathname. The file descriptor \fIfd\fP must be opened read\-only (\fBO_RDONLY\fP) or with the \fBO_PATH\fP flag and the caller must have permission to execute the file that it refers to. .SH "VALEUR RENVOYÉE" En cas de réussite, la fonction \fBfexecve\fP() ne revient jamais. En cas d'erreur, la fonction renvoie \-1 et \fIerrno\fP est définie. .SH ERREURS Les erreurs sont les mêmes que pour \fBexecve\fP(2), avec en plus\ : .TP \fBEINVAL\fP \fIfd\fP n'est pas un descripteur de fichier valable, ou \fIargv\fP est NULL, ou \fIenvp\fP est NULL. .TP \fBENOENT\fP The close\-on\-exec flag is set on \fIfd\fP, and \fIfd\fP refers to a script. See BUGS. .TP \fBENOSYS\fP The kernel does not provide the \fBexecveat\fP(2) system call, and the \fI/proc\fP filesystem could not be accessed. .SH VERSIONS \fBfexecve\fP() est disponible depuis la glibc\ 2.3.2. .SH ATTRIBUTS Pour une explication des termes utilisés dans cette section, consulter \fBattributes\fP(7). .TS allbox; lb lb lb l l l. Interface Attribut Valeur T{ \fBfexecve\fP() T} Sécurité des threads MT\-Safe .TE .sp 1 .SH CONFORMITÉ POSIX.1\-2008. Cette fonction n'est pas spécifiée dans POSIX.1\-2001 et n'est que rarement disponible sur d'autres systèmes. Cette fonction est spécifiée dans POSIX.1\-2008. .SH NOTES .\" glibc commit 43ffc53a352a67672210c9dd4959f6c6b7407e60 On Linux with glibc versions 2.26 and earlier, \fBfexecve\fP() is implemented using the \fBproc\fP(5) filesystem, so \fI/proc\fP needs to be mounted and available at the time of the call. Since glibc 2.27, if the underlying kernel supports the \fBexecveat\fP(2) system call, then \fBfexecve\fP() is implemented using that system call, with the benefit that \fI/proc\fP does not need to be mounted. .PP L’idée derrière \fBfexecve\fP() est de permettre à l’appelant de vérifier (avec une somme de contrôle) le contenu d’un exécutable avant de l’exécuter. Juste ouvrir le fichier et calculer la somme de contrôle du contenu avant de faire un \fBexecve\fP() ne suffirait pas puisque, entre les deux étapes, le nom du fichier, ou un préfixe de répertoire dans le nom de chemin, pourrait avoir été modifié (par exemple en modifiant la cible d’un lien symbolique). \fBfexecve\fP() n’atténue pas le problème que le \fIcontenu\fP d’un fichier pourrait être modifié entre le calcul de la somme de contrôle et l’appel à \fBfexecve\fP(). Pour cela, la solution est de s’assurer que les permissions sur le fichier l’empêchent d’être modifié par un utilisateur malveillant. .PP The natural idiom when using \fBfexecve\fP() is to set the close\-on\-exec flag on \fIfd\fP, so that the file descriptor does not leak through to the program that is executed. This approach is natural for two reasons. First, it prevents file descriptors being consumed unnecessarily. (The executed program normally has no need of a file descriptor that refers to the program itself.) Second, if \fBfexecve\fP() is used recursively, employing the close\-on\-exec flag prevents the file descriptor exhaustion that would result from the fact that each step in the recursion would cause one more file descriptor to be passed to the new program. (But see BUGS.) .SH BOGUES If \fIfd\fP refers to a script (i.e., it is an executable text file that names a script interpreter with a first line that begins with the characters \fI#!\fP) and the close\-on\-exec flag has been set for \fIfd\fP, then \fBfexecve\fP() fails with the error \fBENOENT\fP. This error occurs because, by the time the script interpreter is executed, \fIfd\fP has already been closed because of the close\-on\-exec flag. Thus, the close\-on\-exec flag can't be set on \fIfd\fP if it refers to a script, leading to the problems described in NOTES. .SH "VOIR AUSSI" \fBexecve\fP(2), \fBexecveat\fP(2) .SH COLOPHON Cette page fait partie de la publication\ 5.04 du projet \fIman\-pages\fP Linux. Une description du projet et des instructions pour signaler des anomalies et la dernière version de cette page peuvent être trouvées à l'adresse \%https://www.kernel.org/doc/man\-pages/. .SH TRADUCTION La traduction française de cette page de manuel a été créée par Christophe Blaess , Stéphan Rafin , Thierry Vignaud , François Micaux, Alain Portal , Jean-Philippe Guérard , Jean-Luc Coulon (f5ibh) , Julien Cristau , Thomas Huriaux , Nicolas François , Florentin Duneau , Simon Paillard , Denis Barbier et David Prévot . Cette traduction est une documentation libre ; veuillez vous reporter à la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License version 3 .UE concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITÉ LÉGALE. Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à .MT debian-l10n-french@lists.debian.org .ME .