From owner-freebsd-hackers@freebsd.org Sat Nov 12 10:15:19 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32B71C3BDFB for ; Sat, 12 Nov 2016 10:15:19 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from kabab.cs.huji.ac.il (kabab.cs.huji.ac.il [132.65.116.210]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E36221E4C for ; Sat, 12 Nov 2016 10:15:18 +0000 (UTC) (envelope-from danny@cs.huji.ac.il) Received: from imac.bs.cs.huji.ac.il ([132.65.179.42]) by kabab.cs.huji.ac.il with esmtp id 1c5VL6-0005Rt-RK for freebsd-hackers@FreeBSD.org; Sat, 12 Nov 2016 12:15:12 +0200 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: ipmitool crashing, getpass() From: Daniel Braniss In-Reply-To: <65C0C11B-123E-4536-B7C1-2EBC0DDA37FE@cs.huji.ac.il> Date: Sat, 12 Nov 2016 12:15:12 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <65C0C11B-123E-4536-B7C1-2EBC0DDA37FE@cs.huji.ac.il> To: Freebsd hackers list X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Nov 2016 10:15:19 -0000 > On 12 Nov 2016, at 12:03 PM, Daniel Braniss = 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 > +#include > + > + > +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"