Bug 19475

Summary: /bin/sh sometimes says "not fould" with registered alias.
Product: Base System Reporter: sada <sada>
Component: binAssignee: sada <sada>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.4-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description sada freebsd_committer freebsd_triage 2000-06-23 18:50:01 UTC
	/bin/sh sometimes fails looking-up alias.

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.
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
Comment 1 Jeroen Ruigrok van der Werven freebsd_committer freebsd_triage 2000-06-24 09:01:35 UTC
Responsible Changed
From-To: freebsd-bugs->cracauer

Over to Mr. Shell.
Comment 2 sada 2000-07-02 05:53:36 UTC
This is clear problem and easy to verify.
If "Mr. Shell" has no time to work with and no arguments would be present,
I'll commit it myself.
Comment 3 Martin Cracauer 2000-07-02 11:32:20 UTC
In <200007020453.NAA89879@home.bsdclub.org>, SADA Kenji wrote: 
> This is clear problem and easy to verify.
> If "Mr. Shell" has no time to work with and no arguments would be present,
> I'll commit it myself.

It's clear that the provided patch fixes the problem.  I had no time
to look if it introduces new problems, hence I didn't commit it.

Feel free to commit it after you build a world with it and ran some
big GNU configure scripts while comparing results from one shell
without and one with the patch.

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer@cons.org> http://www.cons.org/cracauer/
BSD User Group Hamburg, Germany     http://www.bsdhh.org/
Comment 4 sada freebsd_committer freebsd_triage 2000-07-15 15:35:33 UTC
State Changed
From-To: open->closed

Committed. 
Martin Cracauer approved this PR with 2 conditions. 
1. Build world with the patch. 
-> Succeeded with 3, 4, and 5 branch. 
2. Check some big GNU configure's log output. 
-> Equaled with bison, emacs, and gcc. 


Comment 5 sada freebsd_committer freebsd_triage 2000-07-15 15:35:33 UTC
Responsible Changed
From-To: cracauer->sada

Martin Cracauer has approved my checkin.
Comment 6 sada freebsd_committer freebsd_triage 2000-07-18 17:05:39 UTC
State Changed
From-To: closed->analyzed

Should be kept opening until MFC.
Comment 7 sada freebsd_committer freebsd_triage 2000-07-19 16:30:51 UTC
State Changed
From-To: analyzed->closed

Committed.