From owner-freebsd-bugs Fri Jun 23 10:50:20 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 96B0537C410 for ; Fri, 23 Jun 2000 10:50:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id KAA45313; Fri, 23 Jun 2000 10:50:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from home.bsdclub.org (home.bsdclub.org [202.227.26.94]) by hub.freebsd.org (Postfix) with ESMTP id 12D1B37BA4C for ; Fri, 23 Jun 2000 10:40:01 -0700 (PDT) (envelope-from sada@bsdclub.org) Received: (from sada@localhost) by home.bsdclub.org (8.9.3/3.7W) id CAA97797; Sat, 24 Jun 2000 02:39:55 +0900 (JST) Message-Id: <200006231739.CAA97797@home.bsdclub.org> Date: Sat, 24 Jun 2000 02:39:55 +0900 (JST) From: sada@FreeBSD.org Reply-To: sada@FreeBSD.org To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/19475: /bin/sh: sometimes fails with alias Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 19475 >Category: bin >Synopsis: /bin/sh sometimes says "not fould" with registered alias. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jun 23 10:50:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: SADA Kenji >Release: FreeBSD 3.4-RELEASE/5.0-CURRENT i386 >Organization: private >Environment: FreeBSD 5.0-CURRENT FreeBSD 3.4-RELEASE >Description: /bin/sh sometimes fails looking-up alias. >How-To-Repeat: NOTE: This doesn't occur everytime, every alias. Some alias would go, others fail. $ alias lcvs alias lcvs=time nice cvs -d /ncvs -R $ type lcvs lcvs not found $ lcvs lcvs: not found >Fix: /bin/sh records its aliases in structures named "alias" (alias.h). The structure's integer member "flag" includes "ALIASINUSE" bit and it controls if that alias would be replaced or not. "ALIASINUSE" bit is expected to be set only when that alias is being replaced, so it stops limit-less replacing. But sometimes the flag is set when alias command is executed, and never unset until shell is aborted. This problem would be solved by just clearing the member "flag" at its creation point. diff -u -w -B -b -r1.12 alias.c --- alias.c 1999/08/27 23:15:07 1.12 +++ alias.c 2000/06/23 15:57:07 @@ -109,6 +109,7 @@ ap->val[len+1] = '\0'; } #endif + ap->flag = 0; ap->next = *app; *app = ap; INTON; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message