[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [BusyBox] dd parameters swallowed by ash environment variable overeagerness?
From:       Stewart Brodie <stewart.brodie () pace ! co ! uk>
Date:       2002-05-30 10:39:02
[Download RAW message or body]

I m experiencing some problems with dd which appear to be the fault of ash. 
Example command which fails:

  dd if=/dev/zero of=/tmp/zeroes bs=1024 count=1

Nothing happens when this command is executing because it is attempting to
read stdin.  Adding some debugging into fileutils/dd.c shows that none of the
parameters are making it as far as dd_main.  If, for testing, I add an extra
parameter "foo" to the command line, then that does make it.

Specifically, it looks as if ash believes that things like "if=/dev/zero" are
requests to set a temporary environment variable whilst dd is running, even
though it appears after the command name.  This affects all of dd's
parameters.  I believe this to be the case because I have also tested it with
the busybox date command, which is easier to demonstrate:

# 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


I've also tested thish with hush and msh and they get this right - only ash
gets it wrong.

Can anybody else confirm this?  I looked at ash.c but environment handling is
rather complex in that so it'll take time for me to understand it, so if
somebody else who's already familiar with it could take a look at it first,
that'd be good :-)


BB version information: head of busybox repository at May 30th, 16:15 UTC.
Built for mipsel-linux.  Configuration for Bourne shell section: shell = ash,
with options: +job control, +enable getopt builtin, +optimise for size,
+command line editing, +tab completion, +hide message on interactive shell
startup, everything else switched off.

The only other snapshot i have is from April 24th which exhibits the same
problem.


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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic