From owner-freebsd-stable Mon Oct 28 13:59:38 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 96A0437B401 for ; Mon, 28 Oct 2002 13:59:36 -0800 (PST) Received: from mtiwmhc11.worldnet.att.net (mtiwmhc11.worldnet.att.net [204.127.131.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D7C6843E42 for ; Mon, 28 Oct 2002 13:59:35 -0800 (PST) (envelope-from cswiger@mac.com) Received: from prime ([12.88.85.139]) by mtiwmhc11.worldnet.att.net (InterMail vM.5.01.05.12 201-253-122-126-112-20020820) with SMTP id <20021028215932.ZILA20156.mtiwmhc11.worldnet.att.net@prime>; Mon, 28 Oct 2002 21:59:32 +0000 Message-ID: <000701c27ecd$4ba3d9e0$0301a8c0@prime> From: "Charles Swiger" To: Cc: "Lowell Gilbert" , References: <44smyq9r4m.fsf@be-well.ilk.org> Subject: Re: last cores Date: Mon, 28 Oct 2002 16:59:30 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG From: "Lowell Gilbert" > Bryan Fullerton writes: >> Someone might want to look at this. >> >> % last -w0 >> Segmentation fault (core dumped) >> >> Does this on 4.6.2-RELEASE-p2, 4.7-RELEASE, 4.7-STABLE (Oct 17). > > Doesn't belong the -security list, but it looks like the > backward-compatibility hack in the option-handling switch > statement of last.c needs another hack. The example in the getopt(3) manpage should probably be reviewed for correctness as well. Bryan, please see whether this helps: 5-sec# diff -w -c last.c_orig last.c /usr/src/usr.bin/last *** last.c_orig Mon Oct 28 08:41:16 2002 --- last.c Mon Oct 28 09:10:18 2002 *************** *** 142,147 **** --- 143,149 ---- * a number after a dash. */ if (maxrec == -1) { + if (optind == argc) break; p = argv[optind - 1]; if (p[0] == '-' && p[1] == ch && !p[2]) maxrec = atol(++p); -Chuck To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message