[BusyBox] bug#1252: ash needs CONFIG_ASH_ALIAS for environment variables to be parsed correctly

Stewart Brodie stewart.brodie at pace.co.uk
Mon Jun 17 04:46:05 UTC 2002


Package: busybox
Version: 0.61pre
Severity: normal

Specific revision information: busybox/shell/ash.c revision 1.52

When alias support is not configured, ash believes that command parameters
that look like dd's "if=/dev/zero" are requests to set a temporary
environment variable whilst dd is running, even though it appears after the
command name.  This is caused by the re-use of the checkalias global variable
to indicate when both alias checking and environment variable checking.  The
failure to reset this flag is due to the reset action being performed only
inside the feature check CHECK_ASH_ALIAS.  Hence ash works as expected when
aliases are configured in, and fails when not.

Example script using 'date' with different settings of TZ:

# TZ=Europe/London
# export TZ
# date
Thu May 30 17:18:49 BST 2002
# TZ=America/New_York date
Thu May 30 12:19:10 EDT 2002
# date
Thu May 30 17:19:12 BST 2002
# date TZ=America/New_York
Thu May 30 12:19:30 EDT 2002    <----- wrong, should be BST time (or error!)
# date
Thu May 30 17:19:35 BST 2002

Attached is a patch against revision 1.52 of ash.c which moves the checks so
that checkalias is updated regardless of whether CONFIG_ASH_ALIAS is set.
With this patch applied, the command shown above which should generate an
error does generate an error.

I have tested this patch with the 'dd' command too and that now works
correctly.

-- 
Stewart Brodie, Senior Software Engineer
Pace Micro Technology PLC
645 Newmarket Road
Cambridge, CB5 8PB, United Kingdom         WWW: http://www.pacemicro.com/


begin 644 ash.c.diff
M26YD97 at Z(&%S:"YC"CT]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T*4D-3(&9I;&4Z
M("]V87(O8W9S+V)U<WEB;W at O<VAE;&PO87-H+F,L=@IR971R:65V:6YG(')E
M=FES:6]N(#$N-3(*9&EF9B`M=R`M8R`M<C$N-3(@87-H+F,**BHJ(&%S:"YC
M"38 at 2G5N(#(P,#(@,3(Z,#<Z,C@@+3`P,#`),2XU, at HM+2T@87-H+F,),3<@
M2G5N(#(P,#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*'=O<F1T97AT*2D@(3T at 3E5,3"`F
M)B`A*&%P+3YF;&%G("8 at 04Q)05-)3E5312DI('L*("`)"0EI9B`H*F%P+3YV
M86PI('L*("`)"0D)<'5S:'-T<FEN9RAA<"T^=F%L+"!S=')L96XH87`M/G9A
M;"DL(&%P*3L*+2TM(#$P,#$Y+#$P,#(V("TM+2T*("`)"7T*("`)?2!E;'-E
M(&EF("AC:&5C:V%L:6%S(#T](#(@)B8@:7-A<W-I9VYM96YT*'=O<F1T97AT
M*2D@>PH@(`D);&%S='1O:V5N(#T@="`](%1!4U-)1TX["B`@"7T at 96QS92!I
M9B`H8VAE8VMA;&EA<RD@>PHK("-I9F1E9B!#3TY&24=?05-(7T%,24%3"B`@
M"0EI9B`H(7%U;W1E9FQA9R`F)B`H87`@/2`J7U]L;V]K=7!A;&EA<RAW;W)D
M=&5X="DI("$]($Y53$P@)B8@(2AA<"T^9FQA9R`F($%,24%324Y54T4I*2![
M"B`@"0D):68@*"IA<"T^=F%L*2!["B`@"0D)"7!U<VAS=')I;F<H87`M/G9A
M;"P@<W1R;&5N*&%P+3YV86PI+"!A<"D["BHJ*BHJ*BHJ*BHJ*BHJ*@HJ*BH@
M,3`P,S`L,3`P,S<@*BHJ*@H@(`D)"6-H96-K:W=D(#T@<V%V96-H96-K:W=D
M.PH@(`D)"6=O=&\@=&]P.PH@(`D)?0HM(`D)8VAE8VMA;&EA<R`](#`["B`@
M(V5N9&EF"B`@"7T*("!O=70Z"B`@(VEF9&5F($1%0E5'"BTM+2`Q,#`R."PQ
M,#`S-2`M+2TM"B`@"0D)8VAE8VMK=V0@/2!S879E8VAE8VMK=V0["B`@"0D)
M9V]T;R!T;W`["B`@"0E]"B`@(V5N9&EF"BL@"0EC:&5C:V%L:6%S(#T@,#L*
<("`)?0H@(&]U=#H*("`C:69D968 at 1$5"54<*"@EC
`
end



More information about the busybox mailing list