comparison cli-authinteract.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 d059b0bb57dd
children 973fccb59ea4 31743c9bdf78
comparison
equal deleted inserted replaced
267:7ce577234a10 268:475a818dd6e7
113 cleantext(prompt); 113 cleantext(prompt);
114 114
115 echo = buf_getbool(ses.payload); 115 echo = buf_getbool(ses.payload);
116 116
117 if (!echo) { 117 if (!echo) {
118 unsigned char* p = getpass(prompt); 118 unsigned char* p = getpass_or_cancel(prompt);
119 response = m_strdup(p); 119 response = m_strdup(p);
120 m_burn(p, strlen(p)); 120 m_burn(p, strlen(p));
121 } else { 121 } else {
122 response = get_response(prompt); 122 response = get_response(prompt);
123 } 123 }