getpass(3) Library Functions Manual getpass(3) NOMBRE getpass - obtiene una contrasena BIBLIOTECA Biblioteca Estandar C (libc, -lc) SINOPSIS #include [[a extinguir]] char *getpass(const char *prompt); Requisitos de Macros de Prueba de Caracteristicas para glibc (vease feature_test_macros(7)): getpass(): A partir de glibc 2.2.2: _XOPEN_SOURCE && ! (_POSIX_C_SOURCE >= 200112L) || /* glibc >= 2.19: */ _DEFAULT_SOURCE || /* glibc <= 2.19: */ _BSD_SOURCE Antes de glibc 2.2.2: nada DESCRIPCION This function is obsolete. Do not use it. See NOTES. If you want to read input without terminal echoing enabled, see the description of the ECHO flag in termios(3). La funcion getpass() abre el fichero /dev/tty (la terminal de control del proceso), escribe la cadena prompt, desactiva el eco, lee una linea (la "contrasena"), restablece el estado de la terminal y cierra /dev/tty de nuevo. VALOR DEVUELTO The function getpass() returns a pointer to a static buffer containing (the first PASS_MAX bytes of) the password without the trailing newline, terminated by a null byte ('\0'). This buffer may be overwritten by a following call. On error, the terminal state is restored, errno is set to indicate the error, and NULL is returned. ERRORES ENXIO El proceso no tiene una terminal de control. ARCHIVOS /dev/tty ATRIBUTOS Para obtener una explicacion de los terminos usados en esta seccion, vease attributes(7). +--------------------------------+--------------------+----------------+ |Interfaz | Atributo | Valor | +--------------------------------+--------------------+----------------+ |getpass() | Seguridad del hilo | MT-Unsafe term | +--------------------------------+--------------------+----------------+ ESTANDARES None. HISTORIAL Version 7 AT&T UNIX. Present in SUSv2, but marked LEGACY. Removed in POSIX.1-2001. NOTAS You should use instead readpassphrase(3bsd), provided by libbsd. In the GNU C library implementation, if /dev/tty cannot be opened, the prompt is written to stderr and the password is read from stdin. There is no limit on the length of the password. Line editing is not disabled. According to SUSv2, the value of PASS_MAX must be defined in in case it is smaller than 8, and can in any case be obtained using sysconf(_SC_PASS_MAX). However, POSIX.2 withdraws the constants PASS_MAX and _SC_PASS_MAX, and the function getpass(). The glibc version accepts _SC_PASS_MAX and returns BUFSIZ (e.g., 8192). ERRORES El proceso que llama a esta funcion deberia poner a cero todos los caracteres de la contrasena tan pronto como le fuera posible para evitar dejar la contrasena sin cifrar visible en el espacio de direcciones del proceso. VEASE TAMBIEN crypt(3) TRADUCCION La traduccion al espanol de esta pagina del manual fue creada por Gerardo Aburruzaga Garcia , Miguel Perez Ibars y Marcos Fouces Esta traduccion es documentacion libre; lea la GNU General Public License Version 3 o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. Si encuentra algun error en la traduccion de esta pagina del manual, envie un correo electronico a . Paginas de Manual de Linux 6.15 17 Mayo 2025 getpass(3)