From owner-freebsd-hackers@freebsd.org Sat Nov 12 10:03:59 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 06581C3B991 for ; Sat, 12 Nov 2016 10:03:59 +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 ADDEF15D9 for ; Sat, 12 Nov 2016 10:03:58 +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 1c5V9z-000Kh3-Lx for freebsd-hackers@FreeBSD.org; Sat, 12 Nov 2016 12:03:43 +0200 From: Daniel Braniss Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: ipmitool crashing, getpass() Message-Id: <65C0C11B-123E-4536-B7C1-2EBC0DDA37FE@cs.huji.ac.il> Date: Sat, 12 Nov 2016 12:03:43 +0200 To: Freebsd hackers list Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) 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:03:59 -0000 Hi, I have no idea when this started to happen, but with a relative new = 11.3-stable, ipmitool core dumps. 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: --- 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 the code was cut-n-pasted from libc. cheers, danny