1.\" Copyright (c) 1989, 1991 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.man% 5.\" 6.\" @(#)getpass.3 6.4 (Berkeley) 04/21/91 7.\" 8.Dd 9.Dt GETPASS 3 10.Os 11.Sh NAME 12.Nm getpass 13.Nd get a password 14.Sh SYNOPSIS 15.Fd #include <unistd.h> 16.Ft char * 17.Fn getpass "const char *prompt" 18.Sh DESCRIPTION 19The 20.Fn getpass 21function displays a prompt to, and reads in a password from, 22.Pa /dev/tty . 23If this file is not accessible, 24.Nm getpass 25displays the prompt on the standard error output and reads from the standard 26input. 27.Pp 28The password may be up to 128 characters in length; any additional 29characters and the terminating newline character are discarded. 30.Pp 31.Nm Getpass 32turns off character echoing while reading the password. 33.Pp 34.Sh RETURN VALUES 35.Nm Getpass 36returns a pointer to the null terminated password. 37.Sh FILES 38.Bl -tag -width /dev/tty - compact 39.It Pa /dev/tty 40.El 41.Sh SEE ALSO 42.Xr crypt 3 43.Sh HISTORY 44A 45.Nm getpass 46function appeared in 47.At v7 . 48.Sh BUGS 49The 50.Nm getpass 51function leaves its result in an internal static object and returns 52a pointer to that object. 53Subsequent calls to 54.Nm getpass 55will modify the same object. 56.Pp 57The calling process should zero the password as soon as possible to 58avoid leaving the cleartext password visible in the process's address 59space. 60