Subject: Bug in file(1)
To: None <netbsd-bugs@sun-lamp.cs.berkeley.edu>
From: Bob Kemp <rsk@ecs.soton.ac.uk>
List: netbsd-bugs
Date: 04/02/1994 15:53:52
>Submitter-Id:	net
>Originator:	Bob Kemp
>Organization:
Private Machine
>Confidential:	no
>Synopsis:	file(1) core dumps
>Severity:	non-critical
>Priority:	medium
>Category:	bin
>Class:		sw-bug
>Release:	-current 05Mar94
>Environment:
System: NetBSD allegory 0.9a ALLEGORY#0 i386
>Description:
	file(1) core dumps when called with /etc/* but
	not when called on them individually, ie

		file /etc/*		{ core dumps }

		foreach f(/etc/*)	{ works ok }
			file $f
		end

>How-To-Repeat:
	Uudecode the following shell script and execute it.  Altering
	"irrelevant" details in it can cause it to not core dump.
	For example, it seems important that you use /tmp not
	/tmp/zz.  Run it on a machine where you can delete all
	other files in /tmp and don't run it under X11 (perhaps
	pseudo ttys screw it up).

	I won't be surprised if you can't repeat it.  It's taken
	me a few hours to get it to be this solid :-(

begin 664 cmds
M"@HC($1E;&5T92!A;&P@9FEL97,@:6X@+W1M<`HC(&5X96-U=&4@=&AE(&9O
M;&QO=VEN9R`H8W5T(&]U="!A;F0@=7-E(&%S(&$@<VAE;&P@<V-R:7!T*0H*
M(R!F:7)S="!T:6UE.B!F:6QE*#$I('=I;&P@8V]R92!D=6UP"B,@<V5C;VYD
M('1I;64Z(&YO(&-O<F4@9'5M<"!B96-A=7-E(&9I;&4N8V]R92!E>&ES=',@
M(0H*"6-D("]T;7`*"75U9&5C;V1E(#P\)T5/1B<*8F5G:6X@-C`P(&UA<W1E
M<BYP87-S=V0*33Q&74\](TE)-50])CHW22\T1S$Q,C8X4BY#8%HL(TA:+"-(
M4"Y$+4@X-RE,.C8T0"E#2$\\1EU//2-(3PI-.$9%3BM7,4,\5D`J/29=3SQ#
M24<T14E2,E9!,S)$74DV1D4U+D-@6BPC2%HL(TA0+D0I3STW*4XY,E5!"DTY
M5B5).T(A,STW(44\1S53.3<H6BM7*4\[5S!:(D8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ES;&]G+F-O
M;F8@<&%S<W=D('!H;VYE<R!<"@D)<&]R=&%L+F-O;F8@<')I;G1C87`@<')O
M=&]C;VQS('!W9"YD8B!R8R!R8RYL;V-A;"!<"@D)<F5M;W1E(')P8R!S96-U
M<FET>2!S96YD;6%I;"YC9B!S97)V:6-E<R!S:&5L;',@7`H)"7-P=V0N9&(@
M<WES;&]G+F-O;F8@='1Y<R!U=6-P('9N=&%B('=E96ML>2`I"@H)9F]R96%C
M:"!X*"1F*0H)"6QN(&UA<W1E<BYP87-S=V0@)'@*"65N9`H*"69I;&4@*@D)
M(R![(&-O<F4@9'5M<',@?0H*(R`)9F]R96%C:"!X*"1F*0HC(`D)9FEL92`D
+>`HC(`EE;F0*"@IM
`
end

>Fix:
	Your turn.



------------------------------------------------------------------------------