Questions about behaviour of busybox `tee`

Rob Landley rob at landley.net
Fri May 19 14:15:33 PDT 2006


On Thursday 18 May 2006 11:26 am, Harry Butterworth wrote:
> Hi folks,
>
>     The Xen xm-test test suite is using busybox on a ramdisk and I was
> trying to write a new test involving busybox tee.
>
>     I am trying to do something like this:
>
>     head -c <bytes> /dev/urandom | tee random_file | md5sum
>
>     then
>
>     md5sum random_file
>
>     I was expecting that both md5sums would be the same.
>
>     When tee is compiled without the CONFIG_FEATURE_TEE_USE_BLOCK_IO
> flag set and <bytes> is large I find that the md5sums are different (I
> happened to try <bytes> == 666 which worked and <bytes> == 182376 which
> didn't).

If the output of tee is going into busybox's md5sum, we just fixed a bug (svn 
15088) where certain input sequences could process md5 data out of order.

I've beaten tee to death and I'm pretty sure it's working correctly now.

>     I had a look at the code for tee but can't see what the problem is.

Take a look at the code for md5sum. :)

http://busybox.net/downloads/patches/svn-15088.patch

>     The Busybox version I'm using is 1.1.2 and I was running the tests
> under the latest xen-unstable hypervisor in an unprivileged domain
> (hopefully running under Xen isn't significant).
>
>     Thanks for any help.

I don't remember if the md5 fix made it into 1.1.3 or not (check the release 
announcement), but it'll definitely be in 1.2.0 next month.

Rob
-- 
Never bet against the cheap plastic solution.


More information about the busybox mailing list