33
33
#endif /* HAVE_PWD_H */
34
34
#else /* ! HAVE_GETPASS */
36
#include <sys/ioctl.h>
37
#ifdef HAVE_TERMIOS_H /* For tty-password */
39
#define TERMIO struct termios
41
#ifdef HAVE_TERMIO_H /* For tty-password */
43
#define TERMIO struct termio
46
#define TERMIO struct sgttyb
49
#ifdef alpha_linux_port
50
#include <asm/ioctls.h> /* QQ; Fix this in configure */
51
#include <asm/termiobits.h>
35
#include <sys/ioctl.h>
36
#ifdef HAVE_TERMIOS_H /* For tty-password */
38
#define TERMIO struct termios
40
#ifdef HAVE_TERMIO_H /* For tty-password */
42
#define TERMIO struct termio
45
#define TERMIO struct sgttyb
48
#ifdef alpha_linux_port
49
#include <asm/ioctls.h> /* QQ; Fix this in configure */
50
#include <asm/termiobits.h>
56
52
#endif /* HAVE_GETPASS */
58
54
#ifdef HAVE_GETPASSPHRASE /* For Solaris */
59
55
#define getpass(A) getpassphrase(A)
63
/* were just going to fake it here and get input from
66
char *get_tty_password(const char *opt_message)
69
char *pos=to,*end=to+sizeof(to)-1;
71
DBUG_ENTER("get_tty_password");
72
_cputs(opt_message ? opt_message : "Enter password: ");
77
if (tmp == '\b' || (int) tmp == 127)
86
if (tmp == '\n' || tmp == '\r' || tmp == 3)
88
if (iscntrl(tmp) || pos == end)
93
while (pos != to && isspace(pos[-1]) == ' ')
94
pos--; /* Allow dummy space at end */
97
DBUG_RETURN(my_strdup(to,MYF(MY_FAE)));
103
58
#ifndef HAVE_GETPASS
105
60
** Can't use fgets, because readline will get confused