.\" -*- coding: UTF-8 -*- .\" $NetBSD: rcmd.3,v 1.9 1996/05/28 02:07:39 mrg Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" %%%LICENSE_START(BSD_4_CLAUSE_UCB) .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" %%%LICENSE_END .\" .\" @(#)rcmd.3 8.1 (Berkeley) 6/4/93 .\" .\" Contributed as Linux man page by David A. Holland, 970908 .\" I have not checked whether the Linux situation is exactly the same. .\" .\" 2007-12-08, mtk, Converted from mdoc to man macros .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH RCMD 3 "15 septembre 2017" Linux "Manuel du programmeur Linux" .SH NOM rcmd, rresvport, iruserok, ruserok, rcmd_af, rresvport_af, iruserok_af, ruserok_af \- Routines renvoyant un flux de données pour une commande invoquée à distance .SH SYNOPSIS .nf \fB#include \ \ \fP/* Ou sur certains systèmes */ .PP \fBint rcmd(char **\fP\fIahost\fP\fB, unsigned short \fP\fIinport\fP\fB, const char *\fP\fIlocuser\fP\fB, \fP \fB const char *\fP\fIremuser\fP\fB, const char *\fP\fIcmd\fP\fB, int *\fP\fIfd2p\fP\fB);\fP .PP \fBint rresvport(int *\fP\fIport\fP\fB);\fP .PP \fBint iruserok(uint32_t \fP\fIraddr\fP\fB, int \fP\fIsuperuser\fP\fB, \fP \fB const char *\fP\fIruser\fP\fB, const char *\fP\fIluser\fP\fB);\fP .PP \fBint ruserok(const char *\fP\fIrhost\fP\fB, int \fP\fIsuperuser\fP\fB, \fP \fB const char *\fP\fIruser\fP\fB, const char *\fP\fIluser\fP\fB);\fP .PP \fBint rcmd_af(char **\fP\fIahost\fP\fB, unsigned short \fP\fIinport\fP\fB, const char *\fP\fIlocuser\fP\fB, \fP \fB const char *\fP\fIremuser\fP\fB, const char *\fP\fIcmd\fP\fB, int *\fP\fIfd2p\fP\fB,\fP \fB sa_family_t \fP\fIaf\fP\fB);\fP .PP \fBint rresvport_af(int *\fP\fIport\fP\fB, sa_family_t \fP\fIaf\fP\fB);\fP .PP \fBint iruserok_af(const void *\fP\fIraddr\fP\fB, int \fP\fIsuperuser\fP\fB, \fP \fB const char *\fP\fIruser\fP\fB, const char *\fP\fIluser\fP\fB, sa_family_t \fP\fIaf\fP\fB);\fP .PP \fBint ruserok_af(const char *\fP\fIrhost\fP\fB, int \fP\fIsuperuser\fP\fB, \fP \fB const char *\fP\fIruser\fP\fB, const char *\fP\fIluser\fP\fB, sa_family_t \fP\fIaf\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 \fBrcmd\fP(), \fBrcmd_af\fP(), \fBrresvport\fP(), \fBrresvport_af\fP(), \fBiruserok\fP(), \fBiruserok_af\fP(), \fBruserok\fP(), \fBruserok_af\fP(): Since glibc 2.19: _DEFAULT_SOURCE Glibc 2.19 and earlier: _BSD_SOURCE .SH DESCRIPTION The \fBrcmd\fP() function is used by the superuser to execute a command on a remote machine using an authentication scheme based on privileged port numbers. The \fBrresvport\fP() function returns a file descriptor to a socket with an address in the privileged port space. The \fBiruserok\fP() and \fBruserok\fP() functions are used by servers to authenticate clients requesting service with \fBrcmd\fP(). All four functions are used by the \fBrshd\fP(8) server (among others). .SS rcmd() .PP La fonction \fBrcmd\fP() recherche l'hôte \fI*ahost\fP en utilisant \fBgethostbyname\fP(3), puis renvoie \-1 si cet hôte n'existe pas. Sinon, \fI*ahost\fP est rempli avec le nom standard de cet hôte, et une connexion est établie avec un serveur se trouvant sur l'un des ports bien connus \fIinport\fP. .PP If the connection succeeds, a socket in the Internet domain of type \fBSOCK_STREAM\fP is returned to the caller, and given to the remote command as \fIstdin\fP and \fIstdout\fP. If \fIfd2p\fP is nonzero, then an auxiliary channel to a control process will be set up, and a file descriptor for it will be placed in \fI*fd2p\fP. The control process will return diagnostic output from the command (unit 2) on this channel, and will also accept bytes on this channel as being UNIX signal numbers, to be forwarded to the process group of the command. If \fIfd2p\fP is 0, then the \fIstderr\fP (unit 2 of the remote command) will be made the same as the \fIstdout\fP and no provision is made for sending arbitrary signals to the remote process, although you may be able to get its attention by using out\-of\-band data. .PP Le protocole est décrit en détail dans \fBrshd\fP(8). .SS rresvport() .PP .\" The \fBrresvport\fP() function is used to obtain a socket with a privileged port bound to it. This socket is suitable for use by \fBrcmd\fP() and several other functions. Privileged ports are those in the range 0 to 1023. Only a privileged process (on Linux: a process that has the \fBCAP_NET_BIND_SERVICE\fP capability in the user namespace governing its network namespace). is allowed to bind to a privileged port. In the glibc implementation, this function restricts its search to the ports from 512 to 1023. The \fIport\fP argument is value\-result: the value it supplies to the call is used as the starting point for a circular search of the port range; on (successful) return, it contains the port number that was bound to. .SS "iruserok() et ruserok()" .PP Les fonctions \fBiruserok\fP() et \fBruserok\fP() prennent respectivement en argument une adresse IP et un nom d'hôte distant, deux noms d'utilisateurs et un drapeau indiquant si l'utilisateur local est superutilisateur «\ \fIsuperuser\fP\ ». Ainsi, si l'utilisateur n'est \fIpas\fP le superutilisateur, elles vérifient le fichier \fI/etc/hosts.equiv\fP. Si cela échoue, le fichier \&\fI.rhosts\fP est recherché dans le répertoire personnel de l'utilisateur local, afin de voir si la requête est autorisée. .PP If this file does not exist, is not a regular file, is owned by anyone other than the user or the superuser, is writable by anyone other than the owner, or is hardlinked anywhere, the check automatically fails. Zero is returned if the machine name is listed in the \fIhosts.equiv\fP file, or the host and remote username are found in the \fI.rhosts\fP file; otherwise \fBiruserok\fP() and \fBruserok\fP() return \-1. If the local domain (as obtained from \fBgethostname\fP(2)) is the same as the remote domain, only the machine name need be specified. .PP Si l'adresse IP de l'hôte distant est connue, \fBiruserok\fP() sera préférée à \fBruserok\fP(), car elle ne nécessite pas d'avoir un serveur DNS digne de confiance pour le domaine distant. .SS "Variantes *_af()" Toutes les fonctions décrites ci\-dessus fonctionnent avec des sockets IPv4 (\fBAF_INET\fP). Les variantes «\ _af\ » prennent un argument supplémentaire qui permet d'indiquer la famille d'adresse de socket. Pour ces fonctions, l'argument \fIaf\fP peut être indiqué comme \fBAF_INET\fP ou \fBAF_INET6\fP. De plus, \fBrcmd_af\fP() permet d'utiliser \fBAF_UNSPEC\fP. .SH "VALEUR RENVOYÉE" La fonction \fBrcmd\fP() renvoie un descripteur de socket valable si elle réussit, sinon elle renvoie \-1 et affiche un message de diagnostic sur sa sortie d'erreur standard. .PP La fonction \fBrresvport\fP() renvoie un descripteur de socket valable, attaché à une adresse privilégiée si elle réussit. Elle renvoie \-1 sinon, et \fIerrno\fP contient le code d'erreur. Le code d'erreur \fBEAGAIN\fP signifie en réalité «\ Tous les ports réseau sont déjà utilisés\ ». .PP Voir ci\-dessus pour des renseignements sur les valeurs renvoyées par \fBruserok\fP() et \fBiruserok\fP(). .SH VERSIONS Les fonctions \fBiruserok_af\fP(), \fBrcmd_af\fP(), \fBrresvport_af\fP() et \fBruserok_af\fP() sont fournies dans la glibc depuis la version\ 2.2. .SH ATTRIBUTS Pour une explication des termes utilisés dans cette section, consulter \fBattributes\fP(7). .TS allbox; lbw27 lb lb l l l. Interface Attribut Valeur T{ \fBrcmd\fP(), \fBrcmd_af\fP() T} Sécurité des threads MT\-Unsafe T{ \fBrresvport\fP(), \fBrresvport_af\fP() T} Sécurité des threads MT\-Safe T{ \fBiruserok\fP(), \fBruserok\fP(), .br \fBiruserok_af\fP(), \fBruserok_af\fP() T} Sécurité des threads MT\-Safe locale .TE .sp 1 .SH CONFORMITÉ Not in POSIX.1. Present on the BSDs, Solaris, and many other systems. These functions appeared in 4.2BSD. The "_af" variants are more recent additions, and are not present on as wide a range of systems. .SH BOGUES .\" Bug filed 25 Nov 2007: .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=5399 \fBiruserok\fP() et \fBiruserok_af\fP() ne sont déclarées dans les fichiers d'en\-tête de la glibc que depuis la version\ 2.12. .SH "VOIR AUSSI" \fBrlogin\fP(1), \fBrsh\fP(1), \fBintro\fP(2), \fBrexec\fP(3), \fBrexecd\fP(8), \fBrlogind\fP(8), \fBrshd\fP(8) .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 .