[patch] avoid getpass when not used

Mike Frysinger vapier at gentoo.org
Sat Oct 10 07:25:22 AWST 2015


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.
-mike

cli-auth.o:cli-auth.c:function getpass_or_cancel: error: undefined reference to 'getpass'
collect2: error: ld returned 1 exit status

--- a/cli-auth.c	Tue Sep 29 22:19:11 2015 +0800
+++ b/cli-auth.c	Fri Oct 09 19:21:35 2015 -0400
@@ -324,6 +324,7 @@ int cli_auth_try() {
 	return DROPBEAR_FAILURE;
 }
 
+#if defined(ENABLE_CLI_PASSWORD_AUTH) || defined(ENABLE_CLI_INTERACT_AUTH)
 /* A helper for getpass() that exits if the user cancels. The returned
  * password is statically allocated by getpass() */
 char* getpass_or_cancel(char* prompt)
@@ -347,3 +348,4 @@ char* getpass_or_cancel(char* prompt)
 	}
 	return password;
 }
+#endif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
Url : http://lists.ucc.gu.uwa.edu.au/pipermail/dropbear/attachments/20151009/d7f537da/attachment.sig 


More information about the Dropbear mailing list