Mercurial > dropbear
comparison cli-auth.c @ 1156:a8f4dade70e5
avoid getpass when not used
some systems (like android's bionic) do not provide getpass. you can
disable ENABLE_CLI_PASSWORD_AUTH & ENABLE_CLI_INTERACT_AUTH to avoid
its use (and rely on pubkey auth), but the link still fails because
the support file calls getpass. do not define this func if both of
those auth methods are not used.
author | Mike Frysinger <vapier@gentoo.org> |
---|---|
date | Wed, 21 Oct 2015 22:39:55 +0800 |
parents | aaf576b27a10 |
children | c6346c63281b |
comparison
equal
deleted
inserted
replaced
1155:80b45616e1f3 | 1156:a8f4dade70e5 |
---|---|
322 } | 322 } |
323 TRACE(("leave cli_auth_try failure")) | 323 TRACE(("leave cli_auth_try failure")) |
324 return DROPBEAR_FAILURE; | 324 return DROPBEAR_FAILURE; |
325 } | 325 } |
326 | 326 |
327 #if defined(ENABLE_CLI_PASSWORD_AUTH) || defined(ENABLE_CLI_INTERACT_AUTH) | |
327 /* A helper for getpass() that exits if the user cancels. The returned | 328 /* A helper for getpass() that exits if the user cancels. The returned |
328 * password is statically allocated by getpass() */ | 329 * password is statically allocated by getpass() */ |
329 char* getpass_or_cancel(char* prompt) | 330 char* getpass_or_cancel(char* prompt) |
330 { | 331 { |
331 char* password = NULL; | 332 char* password = NULL; |
345 if (password == NULL || strchr(password, '\3') != NULL) { | 346 if (password == NULL || strchr(password, '\3') != NULL) { |
346 dropbear_close("Interrupted."); | 347 dropbear_close("Interrupted."); |
347 } | 348 } |
348 return password; | 349 return password; |
349 } | 350 } |
351 #endif |