From owner-freebsd-bugs@FreeBSD.ORG Tue May 20 09:20:10 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B92A637B404 for ; Tue, 20 May 2003 09:20:10 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id EBE7B43FB1 for ; Tue, 20 May 2003 09:20:08 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h4KGK8Up087435 for ; Tue, 20 May 2003 09:20:08 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h4KGK88H087433; Tue, 20 May 2003 09:20:08 -0700 (PDT) Resent-Date: Tue, 20 May 2003 09:20:08 -0700 (PDT) Resent-Message-Id: <200305201620.h4KGK88H087433@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jilles Tjoelker Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E220037B401 for ; Tue, 20 May 2003 09:19:54 -0700 (PDT) Received: from hexagon.stack.nl (hexagon.stack.nl [131.155.140.144]) by mx1.FreeBSD.org (Postfix) with ESMTP id 43D4043F75 for ; Tue, 20 May 2003 09:19:54 -0700 (PDT) (envelope-from jilles@stack.nl) Received: by hexagon.stack.nl (Postfix, from userid 65534) id 313581C40; Tue, 20 May 2003 18:19:53 +0200 (CEST) Received: from toad.stack.nl (toad.stack.nl [2001:610:1108:5010::135]) by hexagon.stack.nl (Postfix) with ESMTP id 412CC1C4C for ; Tue, 20 May 2003 18:19:48 +0200 (CEST) Received: by toad.stack.nl (Postfix, from userid 1677) id 1AAEF9A; Tue, 20 May 2003 18:19:48 +0200 (CEST) Message-Id: <20030520161948.1AAEF9A@toad.stack.nl> Date: Tue, 20 May 2003 18:19:48 +0200 (CEST) From: Jilles Tjoelker To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/52489: [PATCH] ps tpt does not work X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Jilles Tjoelker List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 May 2003 16:20:11 -0000 >Number: 52489 >Category: bin >Synopsis: [PATCH] ps tpt does not work >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: Tue May 20 09:20:08 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Jilles Tjoelker >Release: FreeBSD 4.8-RELEASE i386 >Organization: MCGV Stack >Environment: System: FreeBSD xxx.xxx.xxx 4.8-RELEASE FreeBSD 4.8-RELEASE #0: Sat Apr 19 16:05:02 CEST 2003 jilles@xxx.xxx.xxx:/usr/obj/usr/src/sys/JAGUAR i386 The problem is present on a fairly recent 4.8-STABLE and 5.1-BETA as well. >Description: The kludge in ps that changes 't' to 'T' at the end of argv[1] if there is no minus does not check for a 't' option. Note that ps Uroot did not work in FreeBSD 4.3-RELEASE, but works in 4.8-RELEASE. >How-To-Repeat: $ ps tpt ps: /dev/ttypT: No such file or directory >Fix: Workaround: Use ps -tpt or ps t pt. A possible fix is below. --- ps-tkludge.patch begins here --- --- /usr/src/bin/ps/ps.c.orig Thu Jul 4 10:30:37 2002 +++ /usr/src/bin/ps/ps.c Fri May 16 23:07:00 2003 @@ -619,7 +619,7 @@ * option string, the remainder of the string is the argument to * that flag; do not modify that argument. */ - if (strcspn(s, "MNOoU") == len && *cp == 't' && *s != '-') + if (strcspn(s, "MNOoUt") >= len - 1 && *cp == 't' && *s != '-') *cp = 'T'; else { /* --- ps-tkludge.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: