Provided by: manpages-es-dev_4.13-4_all bug

NOMBRE

       rcmd,  rresvport,  iruserok,  ruserok,  rcmd_af,  rresvport_af,  iruserok_af, ruserok_af -
       routines for returning a stream to a remote command

SINOPSIS

       #include <netdb.h>   /* Or <unistd.h> on some systems */

       int rcmd(char **ahost, unsigned short inport, const char *locuser,
                const char *remuser, const char *cmd, int *fd2p);

       int rresvport(int *port);

       int iruserok(uint32_t raddr, int superuser,
                    const char *ruser, const char *luser);

       int ruserok(const char *rhost, int superuser,
                   const char *ruser, const char *luser);

       int rcmd_af(char **ahost, unsigned short inport, const char *locuser,
                   const char *remuser, const char *cmd, int *fd2p,
                   sa_family_t af);

       int rresvport_af(int *port, sa_family_t af);

       int iruserok_af(const void *raddr, int superuser,
                       const char *ruser, const char *luser, sa_family_t af);

       int ruserok_af(const char *rhost, int superuser,
                      const char *ruser, const char *luser, sa_family_t af);

   Requisitos de Macros de Prueba de Características para glibc (véase feature_test_macros(7)):

       rcmd(), rcmd_af(),  rresvport(),  rresvport_af(),  iruserok(),  iruserok_af(),  ruserok(),
       ruserok_af():
           Since glibc 2.19:
               _DEFAULT_SOURCE
           Glibc 2.19 and earlier:
               _BSD_SOURCE

DESCRIPCIÓN

       La  función rcmd() 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  rresvport()  devuelve  el  descriptor  de  un enchufe (socket) cuya dirección cae
       dentro del espacio de puertos  privilegidados.   Los  servidores  utilizan  las  funciones
       iruserok()  y  ruserok()  para  autenticar a los clientes que solicitan servicios mediante
       rcmd().  Estas cuatro funciones se encuentran en el mismo fichero  y  son  usadas  por  el
       servidor rshd(8)  (entre otros).

   rcmd()
       La  función rcmd busca al anfitrión (host)  *ahost usando gethostbyname(3), devolviendo -1
       si el anfitrión no existe.  En caso contrario, se asigna a *ahost 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 inport.

       Si la conexión tiene éxito, se devuelve al invocador  un  socket  dentro  del  dominio  de
       Internet  del tipo SOCK_STREAM, y dicho socket se convierte en la entrada estándar (stdin)
       y la salida estándar (stdout) de la orden remota.  Si fd2p no es cero, se creará un  canal
       auxiliar  hacia  un  proceso  de  control  y en *fd2p 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  fd2p  es  0,  entonces la salida de error estándar (stderr)
       (descriptor de fichero número 2 de la orden remota) coincidirán  con  la  salida  estándar
       (stdout)  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).

       El protocolo se describe con detalle en rshd(8).

   rresvport()
       The rresvport()  function is used to obtain a socket with a privileged port bound  to  it.
       This  socket is suitable for use by rcmd()  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   CAP_NET_BIND_SERVICE   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 port 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.

   iruserok() y ruserok()
       Las funciones iruserok() y ruserok() 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  no  es  el
       superusuario, comprueba el fichero /etc/hosts.equiv.  Si dicha búsqueda no se realiza o no
       tiene éxito, se comprueba el fichero .rhosts en el  directorio  raíz  (home)  del  usuario
       local para ver si se permite la petición de servicio.

       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
       hosts.equiv file, or the host and remote username are found in the .rhosts file; otherwise
       iruserok()   and   ruserok()    return   -1.   If  the  local  domain  (as  obtained  from
       gethostname(2))  is the same  as  the  remote  domain,  only  the  machine  name  need  be
       specified.

       Si se conoce la dirección IP del anfitrión remoto, preferentemente se debe usar iruserok()
       en lugar de ruserok(), ya que no necesita consultar al servidor DNS para  el  dominio  del
       anfitrión remoto.

   *_af() variants
       All  of  the  functions  described  above  work  with  IPv4 (AF_INET)  sockets.  The "_af"
       variants take an extra argument that allows the socket address  family  to  be  specified.
       For  these  functions,  the  af  argument  can  be  specified  as AF_INET or AF_INET6.  In
       addition, rcmd_af()  supports the use of AF_UNSPEC.

VALOR DEVUELTO

       La función rcmd() 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.

       La  función  rresvport()  devuelve un descriptor de socket válido, y ya ligado, en caso de
       éxito.  Devuelve -1 en caso de error y asigna a errno un valor que  indica  la  razón  del
       fallo.   Se  sobrecarga  el significado del código de error EAGAIN para indicar que "Todos
       los puertos de red están en uso."

       For information on the return from ruserok()  and iruserok(), see above.

VERSIONES

       The functions iruserok_af(), rcmd_af(), rresvport_af(), and  ruserok_af()   functions  are
       provide in glibc since version 2.2.

ATRIBUTOS

       Para obtener una explicación de los términos usados en esta sección, véase attributes(7).

       ┌────────────────────────────┬────────────────────┬─────────────────────────────────────────────┐
       │InterfazAtributoValor                                       │
       ├────────────────────────────┼────────────────────┼─────────────────────────────────────────────┤
       │rcmd(), rcmd_af()           │ Seguridad del hilo │ MT-Unsafe                                   │
       ├────────────────────────────┼────────────────────┼─────────────────────────────────────────────┤
       │rresvport(), rresvport_af() │ Seguridad del hilo │ Multi-hilo seguro                           │
       ├────────────────────────────┼────────────────────┼─────────────────────────────────────────────┤
       │iruserok(), ruserok(),      │ Seguridad del hilo │ Configuración regional de multi-hilo seguro │
       │iruserok_af(), ruserok_af() │                    │                                             │
       └────────────────────────────┴────────────────────┴─────────────────────────────────────────────┘

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.

ERRORES

       iruserok()  and iruserok_af()  are declared in glibc headers only since version 2.12.

VÉASE TAMBIÉN

       rlogin(1), rsh(1), rexec(3), rexecd(8), rlogind(8), rshd(8)

COLOFÓN

       Esta  página es parte de la versión 5.10 del proyecto Linux man-pages. 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/.

TRADUCCIÓN

       La  traducción  al  español  de  esta  página  del  manual  fue  creada  por  Juan Piernas
       <piernas@ditec.um.es>

       Esta traducción es documentación libre; lea  la  GNU  General  Public  License  Version  3
       ⟨https://www.gnu.org/licenses/gpl-3.0.html⟩  o posterior con respecto a las condiciones de
       copyright.  No existe NINGUNA RESPONSABILIDAD.

       Si encuentra algún error en la traducción de esta  página  del  manual,  envíe  un  correo
       electrónico a debian-l10n-spanish@lists.debian.org ⟨⟩.