[prev in list] [next in list] [prev in thread] [next in thread]
List: freebsd-hackers
Subject: Re: ipmitool crashing, getpass()
From: Daniel Braniss <danny () cs ! huji ! ac ! il>
Date: 2016-11-12 10:15:12
Message-ID: BD23310E-5061-4B62-9820-775E5EA9F3B4 () cs ! huji ! ac ! il
[Download RAW message or body]
> On 12 Nov 2016, at 12:03 PM, Daniel Braniss <danny@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@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
_______________________________________________
freebsd-hackers@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic