Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Jun 2000 02:39:55 +0900 (JST)
From:      sada@FreeBSD.org
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/19475: /bin/sh: sometimes fails with alias
Message-ID:  <200006231739.CAA97797@home.bsdclub.org>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200006231739.CAA97797>