Date: Wed, 24 Mar 2004 07:10:21 -0800 (PST) From: MUKAIGAITO Takeya <mkgt@box.email.ne.jp> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/64658: lastcomm dosen't accept arguments Message-ID: <200403241510.i2OFALtm084410@www.freebsd.org> Resent-Message-ID: <200403241520.i2OFKLLc078301@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 64658 >Category: bin >Synopsis: lastcomm dosen't accept arguments >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Mar 24 07:20:20 PST 2004 >Closed-Date: >Last-Modified: >Originator: MUKAIGAITO Takeya >Release: 5.2 Current >Organization: >Environment: FreeBSD belfort 5.2-CURRENT FreeBSD 5.2-CURRENT #1: Fri Mar 19 16:31:28 JST 2004 root@belfort:/usr/obj/usr/src/sys/belfort i386 >Description: The lastcomm command dosen't accept arguments. When I run lastcomm with an argument, it fails. e.g. bash-2.05b# lastcomm who lastcomm: /var/account/acct: Unknown error: 0 bash-2.05b# >How-To-Repeat: $ lastcomm command >Fix: When i run the lastcomm with some argments, the next comparison in the main loop may become true. if (*argv && !requested(argv, &ab)) continue; It would `continue' without fseeking the acct file. The easiest and worst fix: --- lastcomm.c.orig Tue Jan 28 03:16:32 2003 +++ lastcomm.c Wed Mar 24 18:57:09 2004 @@ -167,7 +167,7 @@ if (!isprint(*p)) *p = '?'; if (*argv && !requested(argv, &ab)) - continue; + goto L1;; (void)printf("%-*.*s %-7s %-*s %-*s", AC_COMM_LEN, AC_COMM_LEN, ab.ac_comm, @@ -210,7 +210,7 @@ (void)printf(" %.16s", ctime(&t)); } printf("\n"); - +L1: if (size == 0) break; size -= sizeof(struct acct); >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403241510.i2OFALtm084410>