From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 11 13:15:35 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DE24106564A for ; Thu, 11 Dec 2008 13:15:35 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 5BCAF8FC14 for ; Thu, 11 Dec 2008 13:15:33 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (adsl22-219.kln.forthnet.gr [77.49.149.219]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-5) with ESMTP id mBBDFEZp004259 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 11 Dec 2008 15:15:20 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id mBBDFE6Q006679; Thu, 11 Dec 2008 15:15:14 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id mBBDFDCX006678; Thu, 11 Dec 2008 15:15:13 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Trond =?iso-8859-1?Q?Endrest=F8l?= References: <87vdtr9q8a.fsf@kobe.laptop> <20081211080955.T60586@ramstind.fig.ol.no> Date: Thu, 11 Dec 2008 15:15:13 +0200 In-Reply-To: <20081211080955.T60586@ramstind.fig.ol.no> ("Trond =?iso-8859-1?Q?Endrest=F8l=22's?= message of "Thu, 11 Dec 2008 08:11:20 +0100 (CET)") Message-ID: <87zlj2kg4e.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-MailScanner-ID: mBBDFEZp004259 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.859, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.54, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: freebsd-hackers@freebsd.org Subject: Re: Small Change to chpass.c X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Dec 2008 13:15:35 -0000 On Thu, 11 Dec 2008 08:11:20 +0100 (CET), Trond Endrest=F8l wrote: >On Thu, 11 Dec 2008 08:32+0200, Giorgos Keramidas wrote: >> On Wed, 10 Dec 2008 18:00:25 -0800, "Sheldon Givens" wrote: >> > --- /usr/src/usr.bin/chpass.c 2008-12-11 01:55:27.000000000 -0800 >> > +++ /usr/src/usr.bin/chpass.c 2008-12-11 01:57:09.000000000 -0800 >> > @@ -80,10 +80,11 @@ >> > { >> > enum { NEWSH, LOADENTRY, EDITENTRY, NEWPW, NEWEXP } op; >> > struct passwd lpw, *old_pw, *pw; >> > - int ch, pfd, tfd; >> > + int ch, pfd, tfd, itr, auth; >> > const char *password; >> > char *arg =3D NULL; >> > uid_t uid; >> > + int max_retries =3D 3; >> > #ifdef YP >> > struct ypclnt *ypclnt; >> > const char *yp_domain =3D NULL, *yp_host =3D NULL; >> > @@ -227,9 +228,16 @@ >> > } >> > >> > if (old_pw && !master_mode) { >> > - password =3D getpass("Password: "); > > I'm sure you have noticed the trailing space in the string. > >> > - if (strcmp(crypt(password, old_pw->pw_passwd), >> > - old_pw->pw_passwd) !=3D 0) >> > + auth =3D 0; >> > + for(itr=3D0;itr> > + password =3D getpass("Password:"); > > The space's missing in this string. It might be better to stay > consistent with the original code. Good catch. No, I didn't notice the missing space the first time I read the diff :/