Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Nov 2016 12:15:12 +0200
From:      Daniel Braniss <danny@cs.huji.ac.il>
To:        Freebsd hackers list <freebsd-hackers@FreeBSD.org>
Subject:   Re: ipmitool crashing, getpass()
Message-ID:  <BD23310E-5061-4B62-9820-775E5EA9F3B4@cs.huji.ac.il>
In-Reply-To: <65C0C11B-123E-4536-B7C1-2EBC0DDA37FE@cs.huji.ac.il>
References:  <65C0C11B-123E-4536-B7C1-2EBC0DDA37FE@cs.huji.ac.il>

next in thread | previous in thread | raw e-mail | index | archive | help

> On 12 Nov 2016, at 12:03 PM, Daniel Braniss <danny@cs.huji.ac.il> =
wrote:
>=20
> 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(=E2=80=A6) and coredumps trying to strdup =
the password. My guess it=E2=80=99s not
> calling libc=E2=80=99s getpass(), because adding this patch t works:
>=20
> --- 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 @@
>=20
> static struct ipmi_intf * ipmi_main_intf =3D NULL;
>=20
> +#include <pwd.h>
> +#include <readpassphrase.h>
> +
> +
> +static char *
> +getpass(const char *prompt)
> +{
> +     static char buf[ _PASSWORD_LEN + 1];
> +    =20
> +     if (readpassphrase(prompt, buf, sizeof(buf), RPP_ECHO_OFF)=3D=3D =
NULL)
> +	  buf[0] =3D '\0';
> +     return(buf);
> +}
> +
> /* ipmi_password_file_read  -  Open file and read password from it
>  *
>  * @filename:	file name to read from
>=20
> the code was cut-n-pasted from libc.
>=20
> cheers,
> 	danny
>=20
> _______________________________________________
> 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"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BD23310E-5061-4B62-9820-775E5EA9F3B4>