.\" -*- 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 "21 Diciembre 2020" Linux "Manual del Programador de Linux" .SH NOMBRE rcmd, rresvport, iruserok, ruserok, rcmd_af, rresvport_af, iruserok_af, ruserok_af \- routines for returning a stream to a remote command .SH SINOPSIS .nf \fB#include \ \ \fP/* Or on some systems */ .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 .RS -4 Requisitos de Macros de Prueba de Características para glibc (véase \fBfeature_test_macros\fP(7)): .RE .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 DESCRIPCIÓN La función \fBrcmd\fP() es utilizada por el superusuario para ejecutar una orden en una máquina remota usando un esquema de autenticación basado en números de puertos reservados. La función \fBrresvport\fP() devuelve el descriptor de un enchufe (socket) cuya dirección cae dentro del espacio de puertos privilegidados. Los servidores utilizan las funciones \fBiruserok\fP() y \fBruserok\fP() para autenticar a los clientes que solicitan servicios mediante \fBrcmd\fP(). Estas cuatro funciones se encuentran en el mismo fichero y son usadas por el servidor \fBrshd\fP(8) (entre otros). .SS rcmd() La función \fBrcmd\fP busca al anfitrión (host) \fI*ahost\fP usando \fBgethostbyname\fP(3), devolviendo \-1 si el anfitrión no existe. En caso contrario, se asigna a \fI*ahost\fP el nombre estándar del anfitrión y se establece una conexión con el servidor que reside en el, bien definido, puerto de Internet \fIinport\fP. .PP Si la conexión tiene éxito, se devuelve al invocador un socket dentro del dominio de Internet del tipo \fBSOCK_STREAM\fP, y dicho socket se convierte en la \fBentrada estándar (stdin)\fP y la \fBsalida estándar (stdout)\fP de la orden remota. Si \fIfd2p\fP no es cero, se creará un canal auxiliar hacia un proceso de control y en \fI*fd2p\fP se colocará un descriptor para dicho canal. El proceso de control devolverá la salida de error (descriptor de fichero número 2) de la orden remota sobre este canal, y también aceptará sobre este canal el envío de bytes que se comportarán como números de señal de UNIX para ser enviados al grupo de procesos de la orden. Si \fIfd2p\fP es 0, entonces la \fBsalida de error estándar (stderr)\fP (descriptor de fichero número 2 de la orden remota) coincidirán con la \fBsalida estándar (stdout)\fP y no habrá forma de enviar señales arbitrarias al proceso remoto, aunque podrá llamar su atención usando datos "fuera de orden" (out\-of\-band). .PP El protocolo se describe con detalle en \fBrshd\fP(8). .SS rresvport() .\" 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() y ruserok()" Las funciones \fBiruserok\fP() y \fBruserok\fP() toman la dirección IP o el nombre de un anfitrión remoto, respectivamente, dos nombres de usuario y una bandera que indica si el nombre del usuario local es o no el del superusuario. A continuación, si el usuario \fIno\fP es el superusuario, comprueba el fichero \fI/etc/hosts.equiv\fP. Si dicha búsqueda no se realiza o no tiene éxito, se comprueba el fichero \fI.rhosts\fP en el directorio raíz (home) del usuario local para ver si se permite la petición de servicio. .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 se conoce la dirección IP del anfitrión remoto, preferentemente se debe usar \fBiruserok\fP() en lugar de \fBruserok\fP(), ya que no necesita consultar al servidor DNS para el dominio del anfitrión remoto. .SS "*_af() variants" All of the functions described above work with IPv4 (\fBAF_INET\fP) sockets. The "_af" variants take an extra argument that allows the socket address family to be specified. For these functions, the \fIaf\fP argument can be specified as \fBAF_INET\fP or \fBAF_INET6\fP. In addition, \fBrcmd_af\fP() supports the use of \fBAF_UNSPEC\fP. .SH "VALOR DEVUELTO" La función \fBrcmd\fP() devuelve un descriptor válido de socket en caso de éxito. Devuelve \-1 en caso de error y muestra un mensaje de error en la salida de error estándar. .PP La función \fBrresvport\fP() devuelve un descriptor de socket válido, y ya ligado, en caso de éxito. Devuelve \-1 en caso de error y asigna a \fIerrno\fP un valor que indica la razón del fallo. Se sobrecarga el significado del código de error \fBEAGAIN\fP para indicar que "Todos los puertos de red están en uso." .PP For information on the return from \fBruserok\fP() and \fBiruserok\fP(), see above. .SH VERSIONES The functions \fBiruserok_af\fP(), \fBrcmd_af\fP(), \fBrresvport_af\fP(), and \fBruserok_af\fP() functions are provide in glibc since version 2.2. .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .TS allbox; lbw27 lb lb l l l. Interfaz Atributo Valor T{ \fBrcmd\fP(), \fBrcmd_af\fP() T} Seguridad del hilo MT\-Unsafe T{ \fBrresvport\fP(), \fBrresvport_af\fP() T} Seguridad del hilo Multi\-hilo seguro T{ \fBiruserok\fP(), \fBruserok\fP(), .br \fBiruserok_af\fP(), \fBruserok_af\fP() T} Seguridad del hilo Configuración regional de multi\-hilo seguro .TE .sp 1 .SH "CONFORME A" 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 ERRORES .\" Bug filed 25 Nov 2007: .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=5399 \fBiruserok\fP() and \fBiruserok_af\fP() are declared in glibc headers only since version 2.12. .SH "VÉASE TAMBIÉN" \fBrlogin\fP(1), \fBrsh\fP(1), \fBrexec\fP(3), \fBrexecd\fP(8), \fBrlogind\fP(8), \fBrshd\fP(8) .SH COLOFÓN Esta página es parte de la versión 5.10 del proyecto Linux \fIman\-pages\fP. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en \%https://www.kernel.org/doc/man\-pages/. .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Juan Piernas . .PP Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. .PP Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org .ME .