comparison cli-authpasswd.c @ 268:475a818dd6e7

Cancel a dbclient password prompt if the user presses ctrl-c. Enter still has to be pressed since glibc blocks ctrl-c in getpass()
author Matt Johnston <matt@ucc.asn.au>
date Sun, 15 Jan 2006 06:43:24 +0000
parents efbaf6b03837
children 8f3ec7c104d9
comparison
equal deleted inserted replaced
267:7ce577234a10 268:475a818dd6e7
123 #ifdef ENABLE_CLI_ASKPASS_HELPER 123 #ifdef ENABLE_CLI_ASKPASS_HELPER
124 if (want_askpass()) 124 if (want_askpass())
125 password = gui_getpass("Password: "); 125 password = gui_getpass("Password: ");
126 else 126 else
127 #endif 127 #endif
128 password = getpass("Password: "); 128 password = getpass_or_cancel("Password: ");
129
130 if (password == NULL)
131 return 0;
132 129
133 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST); 130 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST);
134 131
135 buf_putstring(ses.writepayload, cli_opts.username, 132 buf_putstring(ses.writepayload, cli_opts.username,
136 strlen(cli_opts.username)); 133 strlen(cli_opts.username));