ipmitool crashing, getpass()

Daniel Braniss danny at cs.huji.ac.il
Sat Nov 12 10:15:19 UTC 2016


> On 12 Nov 2016, at 12:03 PM, Daniel Braniss <danny at cs.huji.ac.il> wrote:
> 
> Hi,
> I have no idea when this started to happen, but with a relative new 11.3-stable, ipmitool core dumps.
s/11.3/10.3/

> ipmi_main() calls getpass(…) and coredumps trying to strdup the password. My guess it’s not
> calling libc’s getpass(), because adding this patch t works:
> 
> --- lib/ipmi_main.c~	2016-05-06 17:48:54.000000000 +0300
> +++ lib/ipmi_main.c	2016-11-12 11:55:39.396032000 +0200
> @@ -97,6 +97,20 @@
> 
> static struct ipmi_intf * ipmi_main_intf = NULL;
> 
> +#include <pwd.h>
> +#include <readpassphrase.h>
> +
> +
> +static char *
> +getpass(const char *prompt)
> +{
> +     static char buf[ _PASSWORD_LEN + 1];
> +     
> +     if (readpassphrase(prompt, buf, sizeof(buf), RPP_ECHO_OFF)== NULL)
> +	  buf[0] = '\0';
> +     return(buf);
> +}
> +
> /* ipmi_password_file_read  -  Open file and read password from it
>  *
>  * @filename:	file name to read from
> 
> the code was cut-n-pasted from libc.
> 
> cheers,
> 	danny
> 
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"



More information about the freebsd-hackers mailing list