oweals/busybox.git
20 years agoDo not use getpass(3)
Eric Andersen [Sat, 1 May 2004 01:27:30 +0000 (01:27 -0000)]
Do not use getpass(3)

20 years agoRe-add the TODO list, mention tr
Glenn L McGrath [Sat, 1 May 2004 00:49:49 +0000 (00:49 -0000)]
Re-add the TODO list, mention tr

20 years agoBugfixes
Glenn L McGrath [Fri, 30 Apr 2004 23:09:39 +0000 (23:09 -0000)]
Bugfixes
1) a non NULL terminated buffer that can mess up output, spotted by Ian
Latter
2) in miscutils/strings.c: get rid of useless pointer dereference in
third part of for(;;), spotted by Larry Doolittle
3) bug when reading from a pipe and being invoked as strings
"cat Readme | strings" is broken
"cat Readme | busybox strings" works
spotted by Ian Latter and fixed by Tito.

20 years agoFix symlink handling and small memory leak
Glenn L McGrath [Thu, 29 Apr 2004 09:24:19 +0000 (09:24 -0000)]
Fix symlink handling and small memory leak

20 years agoThomas Koeller writes:
Eric Andersen [Mon, 26 Apr 2004 19:32:49 +0000 (19:32 -0000)]
Thomas Koeller writes:

    Hi,

    the following output is from BusyBox 1.0.0-pre10:

    ~ # ip link help
    ip: Command "help" is unknown, try "ip link help".

    tk

This patch fixes it by removing the advertisements for
the "ip blah help" stuff that is not implemented.

20 years agoSync my tasks with AUTHORS file
Glenn L McGrath [Sun, 25 Apr 2004 06:05:14 +0000 (06:05 -0000)]
Sync my tasks with AUTHORS file

20 years agoUpdate my email address, document some of my tasks in the AUTHORS file
Glenn L McGrath [Sun, 25 Apr 2004 05:11:19 +0000 (05:11 -0000)]
Update my email address, document some of my tasks in the AUTHORS file

20 years agoThis sed patch can only be described as "duh". Stat the source file, chmod
Eric Andersen [Wed, 21 Apr 2004 00:57:14 +0000 (00:57 -0000)]
This sed patch can only be described as "duh".  Stat the source file, chmod
the _destination_ file.  (Ah hah!  That works _much_ better...)  I
implemented the behavior, I just forgot to test this corner of it.  My fault,
sorry...

No, gnu sed -i doesn't preverve ownership information.  I checked.
Permissions, yes, ownership info, no.

Rob

20 years agoSo I'm building a linux from scratch system, using a working script to do this
Eric Andersen [Wed, 21 Apr 2004 00:56:22 +0000 (00:56 -0000)]
So I'm building a linux from scratch system, using a working script to do this
that the _only_ change to is that gnu sed has been replaced with busybox sed.
And ncurses' install phase hangs.  I trace it down, and it's trying to run
gawk.  (Insert obligatory doubletake, but this is FSF code we're talking
about, so...)

It turns out gawk shells out to sed, ala "sed -f /tmp/blah file.h".  The
/tmp/blah file is basically empty (it contains one character, a newline).  So
basically, gawk is using sed as "cat".  With gnu sed, it works like cat,
anyway.

With busybox sed, it tests if its command list is empty after parsing the
command line, and if the list is empty it takes the first file argument as a
sed command string, and if that leaves the file list empty it tries to read
the data to operate on from stdin.  (Hence the hang, since nothing's coming
in on stdin...)

It _should_ be testing whether there were any instances of -f or -e, not
whether it actually got any commands.  Using sed as cat may be kind of
stupid, but it's valid and gawk relies on this behavior.

Here's a patch to fix it, turning a couple of ints into chars in hopes of
saving a bit of the space this adds.  Comments?

Rob

20 years agoDont try and preserve hard links to directories.
Glenn L McGrath [Mon, 19 Apr 2004 12:28:02 +0000 (12:28 -0000)]
Dont try and preserve hard links to directories.
The linux kernel doesnt allow hard links to directories, SUS says its
implementation specific.
cramfs gives empty directories and 0 length files the same node it
makies it difficult to distinguish from hard links.

20 years agoAdd two fundamental tests for copying directories
Glenn L McGrath [Sun, 18 Apr 2004 13:35:56 +0000 (13:35 -0000)]
Add two fundamental tests for copying directories

20 years agoThats odd. I guess this was cut-n-paste error, but vodz
Eric Andersen [Fri, 16 Apr 2004 15:02:10 +0000 (15:02 -0000)]
Thats odd.  I guess this was cut-n-paste error, but vodz
email address was wrong!

20 years agoUpdate Acronis and Belkin
Eric Andersen [Thu, 15 Apr 2004 19:16:28 +0000 (19:16 -0000)]
Update Acronis and Belkin

20 years agoSteven Scholz writes:
Eric Andersen [Wed, 14 Apr 2004 17:59:21 +0000 (17:59 -0000)]
Steven Scholz writes:

Hi there,

the "-h" option of httpd is not described in the usage text.

Please find the attached patch.

Thanks.

Steven

20 years agoremove a warning
Eric Andersen [Wed, 14 Apr 2004 17:57:11 +0000 (17:57 -0000)]
remove a warning

20 years agoLarry Doolittle writes:
Eric Andersen [Wed, 14 Apr 2004 17:51:38 +0000 (17:51 -0000)]
Larry Doolittle writes:

This is a bulk spelling fix patch against busybox-1.00-pre10.
If anyone gets a corrupted copy (and cares), let me know and
I will make alternate arrangements.

Erik - please apply.

Authors - please check that I didn't corrupt any meaning.

Package importers - see if any of these changes should be
passed to the upstream authors.

I glossed over lots of sloppy capitalizations, missing apostrophes,
mixed American/British spellings, and German-style compound words.

What is "pretect redefined for test" in cmdedit.c?

Good luck on the 1.00 release!

      - Larry

20 years agobump version, prepare for -pre10 1_00_pre10
Eric Andersen [Tue, 13 Apr 2004 19:38:17 +0000 (19:38 -0000)]
bump version, prepare for -pre10

20 years agoFix incorrect ipcalc usage text
Eric Andersen [Tue, 13 Apr 2004 19:27:20 +0000 (19:27 -0000)]
Fix incorrect ipcalc usage text

20 years agoslightly clean the whacked out formatting
Eric Andersen [Tue, 13 Apr 2004 19:25:57 +0000 (19:25 -0000)]
slightly clean the whacked out formatting

20 years agoFix several problems with start-stop-daemon, add -m support
Eric Andersen [Tue, 13 Apr 2004 18:28:46 +0000 (18:28 -0000)]
Fix several problems with start-stop-daemon, add -m support

20 years agoPut the glibc nss junk back at the end
Eric Andersen [Tue, 13 Apr 2004 16:31:41 +0000 (16:31 -0000)]
Put the glibc nss junk back at the end

20 years agoSigh. The patch from David Anders (prpplague) broke standard
Eric Andersen [Mon, 12 Apr 2004 22:49:06 +0000 (22:49 -0000)]
Sigh.  The patch from David Anders (prpplague) broke standard
securetty files since the /dev was not stripped.

20 years agoWolfgang Denk writes:
Eric Andersen [Mon, 12 Apr 2004 21:41:29 +0000 (21:41 -0000)]
Wolfgang Denk writes:

He,

there is a bug in HUSH's handling of "if" / "elif" commands:

        $  if true
        > then
        > echo 1
        > elif
        > true
        > then
        > echo 2
        > elif
        > true
        > then
        > echo 3
        > else
        > echo 4
        > fi
        1
        2
        3
        $

The same bug exists in all versions of HUSH from BB v0.60.x up to and
including v1.00-pre9. The attached patch fixes this:

        $ if true
        > then
        > echo 1
        > elif
        > true
        > then
        > echo 2
        > elif
        > true
        > then
        > echo 3
        > else
        > echo 4
        > fi
        1
        $

Best regards,

Wolfgang Denk

20 years agoEric Spakman noticed that ifdown' will attempt to run 'ifconfig'
Eric Andersen [Mon, 12 Apr 2004 20:57:17 +0000 (20:57 -0000)]
Eric Spakman noticed that ifdown' will attempt to run 'ifconfig'
even if built with CONFIG_FEATURE_IFUPDOWN_IP when shutting down
a dhcp connection.

20 years agoSilly me
Eric Andersen [Mon, 12 Apr 2004 19:21:54 +0000 (19:21 -0000)]
Silly me

20 years agoAs reported by Quy Tonthat, init has problems with inittab's that
Eric Andersen [Mon, 12 Apr 2004 19:17:13 +0000 (19:17 -0000)]
As reported by Quy Tonthat, init has problems with inittab's that
contain only actions sysinit/wait/once. It does not clean up zombies
in that case.

20 years agoPeter Milne writes:
Eric Andersen [Mon, 12 Apr 2004 19:12:13 +0000 (19:12 -0000)]
Peter Milne writes:

Just upgraded from 0.6 to 1.00-pre8

Dot command handling handled args correctly (same as bash) in 0.60,
but failed in 1.00:

I fixed this by reverting the dotcmd function back to previous 0.60
instantiation,
please consider using the older version.

Thanks

Peter

20 years agoJamie Guinan writes:
Eric Andersen [Mon, 12 Apr 2004 17:59:24 +0000 (17:59 -0000)]
Jamie Guinan writes:

It looks like latest uClibc defines ARCH_HAS_MMU, but a few busybox files
test UCLIBC_HAS_MMU, resulting in vfork() getting called instead of
fork(), etc.

Patch below.   Only tested for lash.

Cheers,
-Jamie

20 years agoAdd an extra link
Eric Andersen [Mon, 12 Apr 2004 15:23:19 +0000 (15:23 -0000)]
Add an extra link

20 years agoPatch from Rob Landley to fix sed documentation.
Eric Andersen [Mon, 12 Apr 2004 15:12:06 +0000 (15:12 -0000)]
Patch from Rob Landley to fix sed documentation.
The -i option was not documented, and in genereal
the formatting was a bit ugly.

20 years ago"Mac OS X" is how it is written on the Apple website
Eric Andersen [Mon, 12 Apr 2004 15:05:10 +0000 (15:05 -0000)]
"Mac OS X" is how it is written on the Apple website

20 years agoFix spelling. "sort of" is two words.
Eric Andersen [Mon, 12 Apr 2004 15:03:51 +0000 (15:03 -0000)]
Fix spelling.  "sort of" is two words.

20 years agomake mount ignore -n when CONFIG_FEATURE_MTAB_SUPPORT is disabled
Eric Andersen [Mon, 12 Apr 2004 15:02:53 +0000 (15:02 -0000)]
make mount ignore -n when CONFIG_FEATURE_MTAB_SUPPORT is disabled

20 years agoFix compile error if CONFIG_FEATURE_IP_ADDR isnt enabled
Glenn L McGrath [Mon, 12 Apr 2004 02:35:44 +0000 (02:35 -0000)]
Fix compile error if CONFIG_FEATURE_IP_ADDR isnt enabled

20 years agoFix up conditional compile of files needed by ip applets
Glenn L McGrath [Mon, 12 Apr 2004 02:22:39 +0000 (02:22 -0000)]
Fix up conditional compile of files needed by ip applets

20 years agoAdd a comment explaining why we have to check for an extra \n
Glenn L McGrath [Fri, 9 Apr 2004 06:59:05 +0000 (06:59 -0000)]
Add a comment explaining why we have to check for an extra \n

20 years agoFix ftp resume
Glenn L McGrath [Thu, 8 Apr 2004 10:27:11 +0000 (10:27 -0000)]
Fix ftp resume
Terminate returned message at <CRLF> so strtoul returns without error

20 years agoVladimir N. Oleynik writes:
Eric Andersen [Wed, 7 Apr 2004 17:59:04 +0000 (17:59 -0000)]
Vladimir N. Oleynik writes:

Hi.

Last changes (rev 1.12) to recursive_actions() by Christian Grigis
have problem.
Test for demonstrate:

$ mkdir aaa bbb ccc
$ su
# chown root bbb
# chmod 700 bbb
# exit
$ busybox chmod 777 -R .
./bbb: Permision denied

But "./ccc" mode not changed. Previous variant works fine,
errors skiped and continued recursion.

--w
vodz

20 years agoAdd the Tritton Technologies NAS120
Eric Andersen [Wed, 7 Apr 2004 16:59:59 +0000 (16:59 -0000)]
Add the Tritton Technologies NAS120

20 years agoDocument insmod -o
Eric Andersen [Wed, 7 Apr 2004 15:07:55 +0000 (15:07 -0000)]
Document insmod -o

20 years agoUpdate for release 1_00_pre9
Eric Andersen [Wed, 7 Apr 2004 14:19:41 +0000 (14:19 -0000)]
Update for release

20 years agoUpdate changelog for release
Eric Andersen [Wed, 7 Apr 2004 14:19:26 +0000 (14:19 -0000)]
Update changelog for release

20 years agoFix url
Eric Andersen [Wed, 7 Apr 2004 14:07:27 +0000 (14:07 -0000)]
Fix url

20 years agoMinor update
Eric Andersen [Wed, 7 Apr 2004 14:02:40 +0000 (14:02 -0000)]
Minor update

20 years agoMention Acronis PartitionExpert
Eric Andersen [Wed, 7 Apr 2004 12:57:15 +0000 (12:57 -0000)]
Mention Acronis PartitionExpert

20 years agoMore doc updates
Eric Andersen [Wed, 7 Apr 2004 12:26:57 +0000 (12:26 -0000)]
More doc updates

20 years agoAdd an example inetd.conf file
Eric Andersen [Wed, 7 Apr 2004 10:34:16 +0000 (10:34 -0000)]
Add an example inetd.conf file

20 years agoRemove the CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN option. It was sortof
Eric Andersen [Wed, 7 Apr 2004 09:34:27 +0000 (09:34 -0000)]
Remove the CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN option.  It was sortof
stupid and didn't work properly anyways.

20 years agoUpdate the default config
Eric Andersen [Wed, 7 Apr 2004 09:17:14 +0000 (09:17 -0000)]
Update the default config

20 years agoBump version to -pre9
Eric Andersen [Tue, 6 Apr 2004 17:58:37 +0000 (17:58 -0000)]
Bump version to -pre9

20 years agoFix buffalo url
Eric Andersen [Tue, 6 Apr 2004 17:53:09 +0000 (17:53 -0000)]
Fix buffalo url

20 years agoYet more doc updates
Eric Andersen [Tue, 6 Apr 2004 17:52:02 +0000 (17:52 -0000)]
Yet more doc updates

20 years agoYet more doc cleanups. Many thanks to Robert P. J. Day for
Eric Andersen [Tue, 6 Apr 2004 17:16:36 +0000 (17:16 -0000)]
Yet more doc cleanups.  Many thanks to Robert P. J. Day for
kindly reviewing the existing docs and providing helpful feedback.

20 years agoSeem not many people are using 'ipaddr' since it has
Eric Andersen [Tue, 6 Apr 2004 16:59:43 +0000 (16:59 -0000)]
Seem not many people are using 'ipaddr' since it has
never worked....  Most people use 'ip addr foo' I suppose.

20 years agoFix indenting
Eric Andersen [Tue, 6 Apr 2004 16:56:00 +0000 (16:56 -0000)]
Fix indenting

20 years agoyet-more doc updates and cleanups
Eric Andersen [Tue, 6 Apr 2004 16:36:20 +0000 (16:36 -0000)]
yet-more doc updates and cleanups

20 years agoYet more doc updates
Eric Andersen [Tue, 6 Apr 2004 15:39:20 +0000 (15:39 -0000)]
Yet more doc updates

20 years agoEliminate all trace of the sgml based docs. It was a noble effort,
Eric Andersen [Tue, 6 Apr 2004 15:26:25 +0000 (15:26 -0000)]
Eliminate all trace of the sgml based docs.  It was a noble effort,
but it just never worked out...

20 years agoFix it so build dependancies actually work and do something useful
Eric Andersen [Tue, 6 Apr 2004 15:19:52 +0000 (15:19 -0000)]
Fix it so build dependancies actually work and do something useful

20 years agoFix it so usage is _always_ in sync with applets.c. Previously,
Eric Andersen [Tue, 6 Apr 2004 14:28:35 +0000 (14:28 -0000)]
Fix it so usage is _always_ in sync with applets.c.  Previously,
broken depends allowed these to get out of sync.

20 years agoMichael Tokarev, mjt at tls dot msk dot ru writes:
Eric Andersen [Tue, 6 Apr 2004 12:06:03 +0000 (12:06 -0000)]
Michael Tokarev, mjt at tls dot msk dot ru writes:

Fix parsing of all tag-value pairs (in modules.conf in particular).
Without this fix, code chokes badly on lines where either value or
both tag+value are missing, like bare
 alias
line, or alias w/o the value like
 alias some-module
(syntactically incorrect, but no need for coredumps either).

20 years agoMichael Tokarev, mjt at tls dot msk dot ru writes:
Eric Andersen [Tue, 6 Apr 2004 12:05:04 +0000 (12:05 -0000)]
Michael Tokarev, mjt at tls dot msk dot ru writes:

alias 'off' parsing fix.
It is not
 alias off module
it is
 alias module off

20 years agoMichael Tokarev, mjt at tls dot msk dot ru writes:
Eric Andersen [Tue, 6 Apr 2004 12:04:14 +0000 (12:04 -0000)]
Michael Tokarev, mjt at tls dot msk dot ru writes:

Initialize all fields of struct dep_t.
Without that, e.g. `busybox modprobe -v char-major-10-144' *sometimes*
fails this way (strace):

 write(1, "insmod    nvram `\213\f\10\n", 21) = 21

Note the garbage after module name which is taken from the m_options field,
which is not initialized in the alias reading/parsing part.
(Shell properly complains to this command, telling it can't find the
closing backtick)

20 years agoChristian Grigis, christian.grigis at smartdata dot ch writes:
Eric Andersen [Tue, 6 Apr 2004 11:56:26 +0000 (11:56 -0000)]
Christian Grigis, christian.grigis at smartdata dot ch writes:

Hello everyone,

Busybox's insmod fails to locate a module when that module is the only one
existing in the /lib/modules directory (with a unique name).

Example:

# find /lib/modules/ -type f
/lib/modules/kernel/drivers/char/bios.o
# insmod bios
insmod: bios.o: no module by that name found
# touch /lib/modules/dummy
# find /lib/modules/ -type f
/lib/modules/kernel/drivers/char/bios.o
/lib/modules/dummy
# insmod bios
Using /lib/modules/kernel/drivers/char/bios.o

As long as there is another file in the /lib/modules directory, insmod
finds it OK.

I tracked the problem down to 'check_module_name_match()' in insmod.c:

It returns TRUE when a match is found, and FALSE otherwise. In the case
where there is only one module in the /lib/modules directory (or more that
one module, but all with the same name), 'recursive_action()' will return
TRUE and we end up on line 4196 in 'insmod.c' which returns an error.
[The reason it works with more than one module with different
names is that in this case there will always be one not matching,
'recursive_action()' will return FALSE and we end up in line 4189.]

Now, from the implementation of 'recursive_action()' and from other
usages of it (tar.c, etc.), it seems to me that FALSE should be returned
to indicate that we want to stop the recursion, so TRUE and FALSE should
be inverted in 'check_module_name_match()'.

At the same time, 'recursive_action()' continues to recurse even after
the recursive call has returned FALSE; again in my understanding and
other usages of it, we can safely stop recursing at this point.

Here is my patch against 1.00-pre8:

20 years agoYet more 'make allyesconfig' adjustments
Eric Andersen [Tue, 6 Apr 2004 11:51:45 +0000 (11:51 -0000)]
Yet more 'make allyesconfig' adjustments

20 years agoMake 'allyesconfig' be a bit less stupid
Eric Andersen [Tue, 6 Apr 2004 11:46:56 +0000 (11:46 -0000)]
Make 'allyesconfig' be a bit less stupid

20 years agoMinor tar test update
Eric Andersen [Tue, 6 Apr 2004 11:34:02 +0000 (11:34 -0000)]
Minor tar test update

20 years agoSimplify, make formatting better match the procps version
Eric Andersen [Tue, 6 Apr 2004 11:10:50 +0000 (11:10 -0000)]
Simplify, make formatting better match the procps version

20 years agoKill off the old 'tests' stuff. Write a ton of new tests for the
Eric Andersen [Tue, 6 Apr 2004 11:10:30 +0000 (11:10 -0000)]
Kill off the old 'tests' stuff.  Write a ton of new tests for the
'testsuite' dir.  Fix a bunch of broken tests.  Fix the testsuite
'runtest' script so it actually reports all failures and provides
meaningful feedback.
 -Erik

20 years agoFix non standard 'date -R' formatting
Eric Andersen [Tue, 6 Apr 2004 09:38:18 +0000 (09:38 -0000)]
Fix non standard 'date -R' formatting

20 years agoFix the test suite script so it actually works and actually flags
Eric Andersen [Tue, 6 Apr 2004 00:41:39 +0000 (00:41 -0000)]
Fix the test suite script so it actually works and actually flags
all errors as such.  Make verbose mode exit on FAIL and provide a
printout of the failed test run.

20 years agoSome test additions
Eric Andersen [Mon, 5 Apr 2004 18:46:24 +0000 (18:46 -0000)]
Some test additions

20 years agoPatch adding support for ibs= and obs= to dd
Eric Andersen [Mon, 5 Apr 2004 14:30:15 +0000 (14:30 -0000)]
Patch adding support for ibs= and obs= to dd

20 years agoPer suggestion by Pawel Sakowski, fix the dash_arith() prototype
Eric Andersen [Mon, 5 Apr 2004 13:24:07 +0000 (13:24 -0000)]
Per suggestion by Pawel Sakowski, fix the dash_arith() prototype
to return a long.  We were needlessly truncating to an int.

20 years agoTito, farmatito at tiscali dot it writes:
Eric Andersen [Mon, 5 Apr 2004 13:08:08 +0000 (13:08 -0000)]
Tito, farmatito at tiscali dot it writes:

Hi to all,
I discovered a little bug in hdparm.c
(really two little bugs...I've made...sigh! Mea culpa).
Some vars were  modified only locally and this could lead to wrong
results to be displayed with the -I switch and maybe with others.
Attached is a patch that fix it ( +88b).

Also attached is second patch that reduces the size a little bit:
   text    data     bss     dec     hex filename
    27984     624     900   29508    7344 hdparm.o (without bug-fix)
    28072     624     900   29596    739c hdparm.o (with bug-fix)
    28141     624     900   29665    73e1 hdparm.o (original)
but maybe this one can wait as we are in a feature freeze.

Ciao,
Tito

20 years agorename uncompress.c to decompress_uncompress.c
Eric Andersen [Mon, 5 Apr 2004 13:03:34 +0000 (13:03 -0000)]
rename uncompress.c to decompress_uncompress.c
rename unzip.c to decompress_unzip.c

20 years agoEverything should be made as simple as possible. But no simpler.
Eric Andersen [Sat, 3 Apr 2004 12:36:03 +0000 (12:36 -0000)]
Everything should be made as simple as possible.  But no simpler.

20 years agoThe last patch broke:
Rob Landley [Thu, 1 Apr 2004 09:23:30 +0000 (09:23 -0000)]
The last patch broke:
sed -i "/^boo/a fred" ipsec.conf

Which works in gnu sed.  (And is _supposed_ to strip all the whitespace before
"fred".)

It also broke:
sed -i -e "/^boo/a \\" -e "   fred" ipsec.conf

I.E. there can legally be spaces between the a and the backslash at the end of
the line.

And strangely enough, gnu sed accepts the following syntax as well:
sed -i "/^boo/a \\  fred" ipsec.conf

Which is a way of having the significant whitespace at the start of the line,
all on one line.  (But notice that the whitespace BEFORE the slash is still
stripped, as is the slash itself.  And notice that the naieve placement of
"\n" there doesn't work, it puts an n at the start of the appended line.  The
double slashing is for shell escapes because you could escape the quote, you
see.  It's turned into a single backslash.  But \n there is _not_ turned into
a newline by the shell.  So there.)

This makes all three syntaxes work in my tests.  I should probably start
writing better documentation at some point.  I posted my current sedtests.py
file to the list, which needs a lot more tests added as well...

20 years agoPatch from Hideki IWAMOTO adding support for 'cmp -n'
Eric Andersen [Wed, 31 Mar 2004 11:53:37 +0000 (11:53 -0000)]
Patch from Hideki IWAMOTO adding support for 'cmp -n'

20 years agoJunio Hamano, junio at twinsun dot com writes:
Eric Andersen [Wed, 31 Mar 2004 11:42:40 +0000 (11:42 -0000)]
Junio Hamano, junio at twinsun dot com writes:

The sed command in busybox 1.0.0-pre8 loses leading whitespace
in 'a' command ('i' and 'c' commands are also affected).  A
patch to fix this is attached at the end of this message.

The following is a transcript that reproduces the problem.  The
first run uses busybox 1.0.0-pre3 as "/bin/sed" command, which
gets the expected result.  Later in the test, /bin/sed symlink
is changed to point at busybox 1.0.0-pre8 and the test script is
run again, which shows the failure.

=== reproduction recipe ===
* Part 1.  Use busybox 1.0.0-pre3 as sed; this works.

root# cd /tmp
root# cat 1.sh
#!/bin/sh

cd /tmp
rm -f ipsec.conf ipsec.conf+
cat >ipsec.conf <<\EOF
version 2.0

config setup
        klipsdebug=none
        plutodebug=none
        plutostderrlog=/dev/null

conn %default
        keyingtries=1
        ...
EOF
sed -e '/^config setup/a\
nat_traversal=yes' ipsec.conf >ipsec.conf+
mv -f ipsec.conf+ ipsec.conf
root# sh -x 1.sh
+ cd /tmp
+ rm -f ipsec.conf ipsec.conf+
+ cat
+ sed -e /^config setup/a\
        nat_traversal=yes ipsec.conf
+ mv -f ipsec.conf+ ipsec.conf
root# cat ipsec.conf
version 2.0

config setup
        nat_traversal=yes
        klipsdebug=none
        plutodebug=none
        plutostderrlog=/dev/null

conn %default
        keyingtries=1
        ...
root# sed --version
sed: invalid option -- -
BusyBox v1.00-pre3 (2004.02.26-18:47+0000) multi-call binary

Usage: sed [-nef] pattern [files...]

* Part 2.  Continuing from the above, use busybox 1.0.0-pre8
  as sed; this fails.

root# ln -s busybox-pre8 /bin/sed-8
root# mv /bin/sed-8 /bin/sed
root# sed --version
This is not GNU sed version 4.0
root# sed --
BusyBox v1.00-pre8 (2004.03.30-02:44+0000) multi-call binary

Usage: sed [-nef] pattern [files...]
root# sh -x 1.sh
+ cd /tmp
+ rm -f ipsec.conf ipsec.conf+
+ cat
+ sed -e /^config setup/a\
        nat_traversal=yes ipsec.conf
+ mv -f ipsec.conf+ ipsec.conf
root# cat ipsec.conf
version 2.0

config setup
nat_traversal=yes
        klipsdebug=none
        plutodebug=none
        plutostderrlog=/dev/null

conn %default
        keyingtries=1
        ...
root#
=== reproduction recipe ends here ===

This problem was introduced in 1.0.0-pre4.  The problem is that
the command argument parsing code strips leading whitespaces too
aggressively.  When running the above example, the piece of code
in question gets "\n\tnat_traversal=yes" as its argument in
cmdstr variable (shown part in the following patch).  What it
needs to do at this point is to strip the first newline and
nothing else, but it instead strips all the leading whitespaces
at the beginning of the string, thus losing the tab character.
The following patch fixes this.

20 years agoPatch from Thomas Winkler:
Eric Andersen [Wed, 31 Mar 2004 11:30:08 +0000 (11:30 -0000)]
Patch from Thomas Winkler:

ifconfig did not look up hostnames, so
ifconfig lo localhost
would not work, you have to do
ifconfig lo 127.0.0.1

20 years agoPatch from Thomas Winkler showing the the system time for each process
Eric Andersen [Wed, 31 Mar 2004 11:21:24 +0000 (11:21 -0000)]
Patch from Thomas Winkler showing the the system time for each process
when running 'top'

20 years agoPatch from Thomas Winkler -- vi -R did not work
Eric Andersen [Wed, 31 Mar 2004 11:12:51 +0000 (11:12 -0000)]
Patch from Thomas Winkler -- vi -R did not work

20 years agoSigh. what a mess.
Eric Andersen [Tue, 30 Mar 2004 09:33:18 +0000 (09:33 -0000)]
Sigh.  what a mess.

20 years agoAs waldi noticed, checks for the size of an off_t and casting
Eric Andersen [Tue, 30 Mar 2004 09:21:54 +0000 (09:21 -0000)]
As waldi noticed, checks for the size of an off_t and casting
etc was also redundant and possibly buggy...

20 years agoGo ahead and kill off the FDISK_SUPPORT_LARGE_DISKS option,
Eric Andersen [Tue, 30 Mar 2004 09:13:05 +0000 (09:13 -0000)]
Go ahead and kill off the FDISK_SUPPORT_LARGE_DISKS option,
as it is redundant....

20 years agoThe fdisk llseek junk was redundant, since both uClibc and glibc
Eric Andersen [Tue, 30 Mar 2004 09:08:58 +0000 (09:08 -0000)]
The fdisk llseek junk was redundant, since both uClibc and glibc
automatically promote lseek and friends to their 64 bit counterparts
when CONFIG_LFS is enabled, since it enables __USE_FILE_OFFSET64

20 years agoAs noted by Martin Schwenke, the example for find was wrong
Eric Andersen [Mon, 29 Mar 2004 08:20:08 +0000 (08:20 -0000)]
As noted by Martin Schwenke, the example for find was wrong

20 years agoYet more doc cleanups
Eric Andersen [Sat, 27 Mar 2004 11:35:46 +0000 (11:35 -0000)]
Yet more doc cleanups

20 years agoAdd missing include files
Eric Andersen [Sat, 27 Mar 2004 11:26:32 +0000 (11:26 -0000)]
Add missing include files

20 years agopasswd and sulogin also need libcrypt, via libbb/pw_encrypt()
Eric Andersen [Sat, 27 Mar 2004 10:08:53 +0000 (10:08 -0000)]
passwd and sulogin also need libcrypt, via libbb/pw_encrypt()

20 years agos/fileno\(stdin\)/STDIN_FILENO/g
Eric Andersen [Sat, 27 Mar 2004 10:02:48 +0000 (10:02 -0000)]
s/fileno\(stdin\)/STDIN_FILENO/g
s/fileno\(stdout\)/STDOUT_FILENO/g

20 years agoVladimir N. Oleynik (vodz) writes:
Eric Andersen [Sat, 27 Mar 2004 09:49:57 +0000 (09:49 -0000)]
Vladimir N. Oleynik (vodz) writes:

Ok. Last patch reduce 73 bytes for compensate (and over) your changes ;-)

Comments:
Added cin_fileno variable, auto setted to 0 from BSS and have "eq" stdin
descriptor if isatty(stout)==0, removed global variable FILE* cin.
Removed default setting to terminal_width/terminal_height, this used
only from main() and setted after call get_terminal_width_height()
always correct.
Variable please_display_more_prompt changed to bits logic, have size
reducing.
--w
vodz

20 years agoUpdate docs
Eric Andersen [Sat, 27 Mar 2004 09:40:15 +0000 (09:40 -0000)]
Update docs

20 years agoBrian Pomerantz writes:
Eric Andersen [Tue, 23 Mar 2004 23:15:36 +0000 (23:15 -0000)]
Brian Pomerantz writes:

I've noticed a bug in the "autowidth" feature more, and is probably in
others.  The call to the function get_terminal_width_height() passes
in a file descriptor but that file descriptor is never used, instead
the ioctl() is called with 0.  In more_main() the call to
get_terminal_width_height() passes 0 as the file descriptor instead of
fileno(cin).  This isn't a problem when you more a file (e.g. "more
/etc/passwd") but when you pipe a file to it (e.g. "cat /etc/passwd |
more") the size of the terminal cannot be determined because file
descriptor 0 is not a terminal.  The fix is simple, I've attached a
patch for more.c and get_terminal_width_height.c.

BAPper

20 years agoSome corrections from vodz:
Robert Griebl [Mon, 22 Mar 2004 21:27:39 +0000 (21:27 -0000)]
Some corrections from vodz:
- Make -u/-l mutually exclusive
- Minor size reduction

20 years agoThe utc variable was not modified according to the -u/-l command line
Robert Griebl [Sun, 21 Mar 2004 18:01:46 +0000 (18:01 -0000)]
The utc variable was not modified according to the -u/-l command line
parameters.

20 years agoTito noticed a printf that should have been a bb_error_msg.
Eric Andersen [Sat, 20 Mar 2004 00:56:46 +0000 (00:56 -0000)]
Tito noticed a printf that should have been a bb_error_msg.

20 years agoOops.. got a bit to aggressive with size optimization and global replace. :-(
Manuel Novoa III [Fri, 19 Mar 2004 23:27:08 +0000 (23:27 -0000)]
Oops.. got a bit to aggressive with size optimization and global replace.  :-(

20 years agoAs noted in a patch from Kendrick Hamilton, rmmod was only
Eric Andersen [Fri, 19 Mar 2004 21:00:03 +0000 (21:00 -0000)]
As noted in a patch from Kendrick Hamilton, rmmod was only
half way converted, and still used the old delete_module(),
call rather than a syscall, in one spot.