Compare commits

..
103 Commits
Author SHA1 Message Date
Eric Andersen 9395ca4f68 prepare for release 2004-10-13 09:42:10 +00:00
Eric Andersen 9789bf1019 return failure when nslookup fails 2004-10-13 07:25:01 +00:00
Eric Andersen 1aee3ff8bb Simon Poole writes:
Erik,

Attached is a patch for the udhcpc sample scripts, to correct the order in
which routers are applied if the DHCP server provides more than one (as per
section 3.5 of RFC2132).

Apologies for not being on the mailing list and thanks for your continued
efforts.

Simon.
2004-10-13 07:18:05 +00:00
Eric Andersen 0e020d1025 Make certain clients of bb_make_directory default to honoring
the user's umask
2004-10-13 06:25:52 +00:00
Eric Andersen 9315842242 Patch from David Daney:
It seems that date  -s MMDDHHMMYYYY.ss

will ignore the .ss part.  This patch tries to fix the problem.

David Daney.
2004-10-11 20:52:16 +00:00
Eric Andersen 62e0037d2d oops 2004-10-08 11:11:02 +00:00
Eric Andersen 5c5f983faf unmerged fix 2004-10-08 10:54:20 +00:00
Eric Andersen 90d3317fbf Bump version 2004-10-08 10:52:33 +00:00
Eric Andersen fdfa09b5c7 Fix the supported architectures section 2004-10-08 10:52:08 +00:00
Eric Andersen 6c4a6b1a23 Add an initial FAQ 2004-10-08 10:50:08 +00:00
Eric Andersen ad63cb2514 Fix CONFIG_ASH_MATH_SUPPORT_64 so it actually works 2004-10-08 09:43:34 +00:00
Eric Andersen a62665b72f Patch from Claus Klein to increase, and make more apparent
the hard coded limit on the number of mounts
2004-10-08 08:57:35 +00:00
Eric Andersen abf58d6ba5 Wade Berrier writes:
Hello,

Here's a patch for a first attempt at static leases for udhcpd.
Included in the tarball are 2 files (static_leases.c, static_leases.h)
and a patch against the latest cvs.

In the config file you can configure static leases with the following
format:

static_lease 00:60:08:11:CE:4E 192.168.0.54
static_lease 00:60:08:11:CE:3E 192.168.0.44

Comments/suggestions/improvements are welcome.


Wade
2004-10-08 08:49:26 +00:00
Eric Andersen 751750e3ee Patch from Denis Vlasenko to fix a problem where
wget http://1.2.3.4/abc/ loses last '/'
2004-10-08 08:27:40 +00:00
Eric Andersen 82baf63de5 Hiroshi Ito writes:
Hello, all.

Busybox init does not handle removed inittab entry correctly.

# I'm sorry about my poor english, but you can find
# what I would like to say from patch, isn't it?

even if you apply this path,
when yoy try to change a command line option in inittab,
you have to do following steps.
1. remove old line from initrd
2. send HUP signal to init
3. kill old proces which is invoked from init.
4. append new line to inittab
5. send HUP signal to init, again

patch is against current CVS + last patch witch I send it last.
2004-10-08 08:21:54 +00:00
Eric Andersen 2271809d75 Hiroshi Ito writes:
"kill -HUP 1" reloads inittab, and when I append one line to inittab
and send HUP signal two times, It will starts 2 process.

patch against current CVS is attached.
2004-10-08 08:17:39 +00:00
Eric Andersen c00e11df85 Hiroshi Ito writes:
ash
   "unset OLDPWD; cd -"  causes segmentation fault.
    ( OLDPWD is not set when sh is invoked from getty. )

patch against current CVS is attached.
2004-10-08 08:14:58 +00:00
Eric Andersen 31c27a9c65 Hiroshi Ito writes:
Hello

    I'm using busy box on mipsel machine.

    "grep -f file" will cause segmentation fault.

Vladimir N. Oleynik writes:

Hiroshi,

Thank for bug report, but your patch is full broken.
Worked patch attached.
(really changes is zero initialize, and indent correcting).


--w
vodz
2004-10-08 08:10:57 +00:00
Eric Andersen 94d628c76a Tito writes:
Hi to all,
This patch contains just some fixes for some misleading
comments in my_getpwuid.c and my_getug.c.
The code is untouched so this patch will not
cause troubles.

Please apply.

Thanks in advance and Ciao,
Tito
2004-10-08 08:07:40 +00:00
Eric Andersen 07f2fea62c last_patch139.gz from Vladimir N. Oleynik:
>I also don't mean to disagree about leaving 30x status codes until after
>1.0.  In fact, although redirecting http://host/dir to http://host/dir/
>with a 301 is common practice (e.g. Apache, IIS), AFAIK it isn't
>actually required (or mentioned) by the HTTP specs.

Ok.
Attached patch have 302 and 408 implemented features.


--w
vodz
2004-10-08 08:03:29 +00:00
Eric Andersen 9e954abc4f As noticed by egor duda, current_menu is declared as 'extern struct menu
*current_menu;' in scripts/config/lkc.h line 63, and this conflicts with
static definition in mconf.c.
2004-10-08 07:58:30 +00:00
Eric Andersen 7daa076d3e egor duda writes:
Hi!

I've created a patch to busybox' build system to allow building it in
separate tree in a manner similar to kbuild from kernel version 2.6.

That is, one runs command like
'make O=/build/some/where/for/specific/target/and/options'
and everything is built in this exact directory, provided that it exists.

I understand that applyingc such invasive changes during 'release
candidates' stage of development is at best unwise. So, i'm currently
asking for comments about this patch, starting from whether such thing
is needed at all to whether it coded properly.

'make check' should work now, and one make creates Makefile in build
directory, so one can run 'make' in build directory after that.

One possible caveat is that if we build in some directory other than
source one, the source directory should be 'distclean'ed first.

egor
2004-10-08 07:46:08 +00:00
Eric Andersen 2842659cc0 Patch from Michael Tokarev:
Scenario:

  touch x -- creates plain file name `x'
  mkdir x -- exits successefully

libbb/make_directory.c, bb_make_directory(), contains
the following code:

        if (mkdir(path, 0777) < 0) {
            /* If we failed for any other reason than the directory
             * already exists, output a diagnostic and return -1.*/
            if (errno != EEXIST) {
                fail_msg = "create";
                umask(mask);
                break;
            }
            /* Since the directory exists, don't attempt to change
             * permissions if it was the full target.  Note that
             * this is not an error conditon. */
            if (!c) {
                umask(mask);
                return 0;
            }
        }

The assumption that EEXIST error is due to that the *directory*
already exists is wrong: any file type with that name will cause
this error to be returned.  Proper way IMHO will be is to stat()
the path and check whenever this is really a directory.  Below
(attached) is a patch to fix this issue.
2004-10-08 07:21:58 +00:00
Eric Andersen d952ee2e9e Make it more apparent that archive creation is not supported 2004-10-07 00:35:59 +00:00
Glenn L McGrath f86391e7d7 Patch from William Barsse to fix a segfault when multiple files are specified. 2004-09-30 00:24:21 +00:00
Glenn L McGrath ca29ffc206 Patch from Dmitry Zakharov to fix a bug triggered by freeswan's scripts. 2004-09-24 09:24:27 +00:00
Glenn L McGrath bdf6319d3a Patch from Egor Duda
Attached patch prevents modprobe from trying to call 'insmod (null)'
whenever nonexistent module is either passed to modprobe via command
line or mentioned in modules.dep

this replaces cryptic error
sh: Syntax error: word unexpected (expecting ")")
with
modprobe: module some-module not found.

egor.
2004-09-24 09:18:55 +00:00
Glenn L McGrath 53090cdedd Fix a typo 2004-09-24 09:09:44 +00:00
Glenn L McGrath 29de86314a Remove this error message at Vodz request, it was misleading. 2004-09-24 02:36:44 +00:00
Glenn L McGrath afc9ab8686 Patch from David Daney to make the -i option work with -l. 2004-09-24 02:04:13 +00:00
Eric Andersen 6f8542b98d A bit of extra explanation regarding STANDALONE 2004-09-24 01:25:39 +00:00
Eric Andersen 31ec93e580 Add some notes on how to make telnetd actually work 2004-09-23 20:08:46 +00:00
Glenn L McGrath ca1c1afadc Add a missing brace, patch by Hideki IWAMOTO 2004-09-15 03:24:32 +00:00
Glenn L McGrath f15dfc5570 Tito writes,
"This patch fixes all the bugs in id previously spotted by vodz and me.
The binary size increased a bit,  but now it should work as expected."
2004-09-15 03:04:08 +00:00
Glenn L McGrath 995d96a99d Only write to shadow file is shadow passwords are enabled. Patch by magicfox modified by myself to retain check for shadow file access. 2004-09-15 02:39:09 +00:00
Glenn L McGrath 240a91d8a1 Patch by Felipe Kellermann, use the common escape handling function and remove some unused code. 2004-09-15 02:05:23 +00:00
Glenn L McGrath b6570d07c4 remove a cut/paste mistake, i better get some sleep. 2004-09-14 19:14:00 +00:00
Glenn L McGrath 225be8c1f0 Apply patch from Felipe Kellermann to simlify logic of sort functions.
I reversed the result of the sort functions to make the big numbers go to the top.
2004-09-14 18:56:52 +00:00
Glenn L McGrath 73ebb889da Patch by Felipe Kellermann, fix a bug introduced in the last patch by adding a condition around the remote logging, also adds some comments. 2004-09-14 18:12:13 +00:00
Glenn L McGrath d4004ee6a9 Patch from Felipe Kellermann, remove some unnecessary dups, i declared a few extra const's also. 2004-09-14 17:24:59 +00:00
Glenn L McGrath ab1955c236 Patch from Felipe Kellermann, adds missing applet usage options, removes usage
for options that are currently not implemented and fixes typos.
2004-09-14 16:23:56 +00:00
Glenn L McGrath d2bd7d8dd5 Patch from tito to add argument checking. 2004-09-14 16:08:02 +00:00
Glenn L McGrath e11db0ed35 I have to assume both Avaks and LSILogic are deliberatly ignoring me. 2004-09-14 13:59:44 +00:00
Eric Andersen e9c826f12a Fixup URL 2004-09-08 20:13:05 +00:00
Eric Andersen f91b9282a3 Felipe Kellermann writes:
The Togg's sysklogd patch to use sendto() on remote logging is formatting
strangely (using `<' and '>' surrounding the `msg' string message).  This
is OK, but this is not the standard way of formatting this message.

So this patch does the following:

o Fix the formatting to the standard way.
o Uses `MAXLINE' when needed;
o Don't loop sending messages without a "sleeping time",
  I'm now doing `now = 1', `now <<= 1';
o Don't die on `init_RemoteLog' when starting up (feature!)
  We're now trying to connect every time we have an invalid fd;
o Removes one static uneeded variable.
o Removes two automatic uneeded variables.
2004-09-08 10:56:06 +00:00
Eric Andersen 4a79c0e9e1 Patrick Huesmann noticed BusyBox would not link when
CONFIG_FEATURE_COMMAND_EDITING was defined *and*
CONFIG_FEATURE_COMMAND_TAB_COMPLETION was undefined.

Vladimir N. Oleynik writes:

Its declare always, also if CONFIG_FEATURE_COMMAND_TAB_COMPLETION
undefined.
Patch to CVS version attached.

--w
vodz
2004-09-08 10:01:07 +00:00
Eric Andersen fd7a4c8c28 Jonas Holmberg from axis dot com writes:
This patch makes msh handle variable expansion within backticks more
correctly.

Current behaviour (wrong):
--------------------------

BusyBox v1.00-rc3 (2004.08.26-11:51+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.

$ A='`echo hello`'
$ echo $A
`echo hello`
$ echo `echo $A`
hello
$


New behaviour (correct):
------------------------

BusyBox v1.00-rc3 (2004.08.26-11:51+0000) Built-in shell (msh)
Enter 'help' for a list of built-in commands.

$ A='`echo hello`'
$ echo $A
`echo hello`
$ echo `echo $A`
`echo hello`
$

The current behaviour (wrong according to standards) was actually my
fault. msh handles backticks by executing a subshell (which makes it
work on MMU-less systems). Executing a subshell makes it hard to only
expand variables once in the parent. Therefore I export all variables
that will be expanded within the backticks and let the subshell handle
the expansion instead.

The bug was found while searching for security leaks in CGI-scripts.
Current behaviour of msh makes it easy to expand backticks by mistake
in $QUERY_STRING. I recommend appling the patch before release of bb
1.00.

/Jonas
2004-09-02 23:13:10 +00:00
Eric Andersen 7b08cdd98c No longer needed 2004-09-02 23:11:53 +00:00
Eric Andersen 45a0513a64 Based on patches from Mike Frysinger, add insmod support for
sparc and ia64 (itanium).

Also, reorganize the insmod architecture support code to be
alphasorted and less messy.

Update the readme to list current insmod arch support.
2004-09-02 23:03:25 +00:00
Eric Andersen 192c35f6eb Tito writes:
The second patch contains:
1) a size optimization for adduser.c
2) removes a warning about an unused variable in syslogd.c if CONFIG_FEATURE_REMOTE_LOG is not set
3)cosmetic fixes for addgroup_full_usage and adduser_full_usage

Ciao,
Tito
2004-09-02 22:22:17 +00:00
Eric Andersen 7eb79fff10 Tito writes:
Hi Erik,
Hi to all,
This is part five of the my_get*id story.
I've tweaked a bit this two functions to make them more flexible,
but this changes will not affect existing code.
Now they work so:
1) my_getpwuid( char *user, uid_t uid, int bufsize)

   if bufsize is > 0 char *user cannot be set to NULL
                     on success username is written on static allocated buffer
                     on failure uid as string is written to buffer and NULL is returned
   if bufsize is = 0 char *user can be set to NULL
                     on success username is returned
                     on failure NULL is returned
   if bufsize is < 0 char *user can be set to NULL
                     on success username is returned
                     on failure an error message is printed and the program exits

  2) 1) my_getgrgid( char *group, uid_t uid, int bufsize)

   if bufsize is > 0 char *group cannot be set to NULL
                     on success groupname is written on static allocated buffer
                     on failure gid as string is written to buffer and NULL is returned
   if bufsize is = 0 char *group can be set to NULL
                     on success groupname is returned
                     on failure NULL is returned
   if bufsize is < 0 char *group can be set to nULL
                     on success groupname is returned
                     on failure an error message is printed and the program exits

This changes were needed mainly for my new id applet.
It is somewhat bigger then the previous but matches the behaviour of GNU id
and is capable to handle usernames of whatever length.
BTW: at a first look it seems to me that it will integrate well (with just a few changes)
with the pending patch  in patches/id_groups_alias.patch.
The increase in size is balanced by the removal of my_getpwnamegid.c
from libbb as this was used only in previous id applet and by size optimizations
made possible in whoami.c and in passwd.c.
I know that we are in feature freeze but I think that i've tested it enough
(at least I hope so.......).
2004-09-02 22:21:41 +00:00
Eric Andersen b225e2a76b Fixup some warnings 2004-08-28 00:43:07 +00:00
Eric Andersen 785001468d Quiet a few warnings 2004-08-27 19:55:28 +00:00
Eric Andersen 75813eea23 Togg writes:
Syslogd wont start if remote-logging is enabled and the connection to the
remote-log server is not possible on syslogd startup.

I found a patch somewhere which works like a charm. It uses sendto() which
seems more reliable for this issue.

Please see attached patch. Many people will be more happy with this included
I think.

Regards,
Togg
2004-08-26 23:15:29 +00:00
Eric Andersen 138791050d Improve the setuid situation a bit, and make it more apparent
when people really ought to make busybox setuid root.
 -Erik
2004-08-26 23:13:00 +00:00
Eric Andersen 37ba6bfb6d The login applet should always be setuid root 2004-08-26 23:01:34 +00:00
Eric Andersen 095dd0c46d Tito writes:
Hi,
I've fixed also the issue of whoami cutting down usernames.
This time I cannot send a diff because i don't know if my previous patches will be applied
or not, so I send in the whole file.
The changes I've made don't affect size but ensure that usernames of whatever lenght
are correctly displayed.
root@localhost:/dev/pts/3:/root/Desktop/busybox/coreutils# size whoami_orig.o
   text    data     bss     dec     hex filename
    102       0       0     102      66 whoami_orig.o
root@localhost:/dev/pts/3:/root/Desktop/busybox/coreutils# size whoami.o
   text    data     bss     dec     hex filename
     93       0       0      93      5d whoami.o

This should be applied even if the other patches aren't as this matches the behaviour of the  GNU whoami.

Thanks in advance,
Ciao,
Tito
2004-08-26 22:36:02 +00:00
Eric Andersen 713d6e3dd3 Save a line or two 2004-08-26 22:26:26 +00:00
Eric Andersen 97a1de10e9 Vladimir N. Oleynik writes:
Ming-Ching,

>>No. Here there are no mistakes.
>>You using POST metod.
>>For get data you should read from stdin CONTENT_LENGTH bytes.

>Hower as I posted a little while ago, there is indeed a bug
>in POST method if the CONTENT_LENGTH is bigger
>than sizeof(wbuf[128]). So if your CGI script is expecting to
>read the full CONTENT_LENGTH, it might block forever,
>because it will only transfer sizeof(wbuf) to the CGI.

Ok, Ok. I should find time to understand with a problem.
Try attached patch.


--w
vodz
2004-08-26 22:22:50 +00:00
Eric Andersen 52499cb9ae Tito writes:
Hi,
I've spent the half night staring at the devilish  my_getpwuid and my_getgrgid functions
trying to find out a way to avoid actual and future potential buffer overflow problems
without breaking existing code.
Finally I've  found a not intrusive way to do this that surely doesn't break existing code
and fixes a couple of problems too.
The attached patch:
1) changes the behaviour of my_getpwuid and my_getgrgid to avoid potetntial buffer overflows
2) fixes all occurences of this function calls in tar.c , id.c , ls.c, whoami.c, logger.c, libbb.h.
3) The behaviour of tar, ls and  logger is unchanged.
4) The behavior of ps with somewhat longer usernames messing up output is fixed.
5) The only bigger change was the increasing of size of the buffers in id.c to avoid
     false negatives (unknown user: xxxxxx) with usernames longer than 8 chars.
     The value i used ( 32 chars ) was taken from the tar header ( see gname and uname).
     Maybe this buffers can be reduced a bit  ( to 16 or whatever ), this is up to you.
6) The increase of size of the binary is not so dramatic:
     size busybox
       text    data     bss     dec     hex filename
     239568    2300   36816  278684   4409c busybox
    size busybox_fixed
       text    data     bss     dec     hex filename
     239616    2300   36816  278732   440cc busybox
7) The behaviour of whoami changed:
    actually it  prints out an username cut down to the size of the buffer.
    This could be fixed by increasing the size of the buffer as in id.c or
    avoid the use of my_getpwuid and use getpwuid directly instead.
    Maybe this colud be also remain unchanged......

Please apply if you think it is ok to do so.
The diff applies on today's cvs tarball (2004-08-25).
Thanks in advance,
Ciao,
Tito
2004-08-26 22:18:59 +00:00
Eric Andersen 6fea7328ee Felipe Kellermann writes:
Unfortunatelly I've not followed the last two or three weeks commits (new
semester started and so now I rarely have time to fix my personal bridge)
but tonight I synched my tree and immediately noticed a rather nasty bug!

[Using libbb/interface.c:1.24]
# grep eth0 /proc/net/dev | xargs
eth0:311708397 237346 1670 0 1789 1670 0 0 22580308 120297 0 0 0 102 0 0

# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:20:AF:7C:EA:B7
          inet addr:10.0.0.1  Bcast:10.0.0.127  Mask:255.255.255.128
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:5 Base address:0x320


All values `ifconfig' is showing are `zeroed' -- I quickly looked at the
last commits I missed and noticed that there were a commit relating to
ifconfig, libbb/interface.c:1.23->1.24 (PatchSet 4338).

I've reversed the patch and now everything is working again.  I compared
the get_name's return values from the 1.23 and 1.24 and quickly noticed
that the new revision is leaving `p' right on the sep while the rev 1.23
was leaving it right on the starting of the values...

1-line, 1/3-minute patch attached  :-)
2004-08-26 21:45:21 +00:00
Glenn L McGrath b619419962 Patch from Manousaridis Angelos to cleanup stale file descriptors, it was preventing unmounting an initial filesystem. 2004-08-25 02:02:19 +00:00
Eric Andersen a4d27d2d38 Patch from Rodney Radford adding x86_64 support. 2004-08-19 19:17:30 +00:00
Eric Andersen a9eb33ddc7 regularly update the status line display
-Erik
2004-08-19 19:15:06 +00:00
Eric Andersen 807bd846b6 Patch from Mike Castle to cleanup some modutils issues, in
particular making alias support work better.
2004-08-19 18:30:31 +00:00
Eric Andersen a4fcccefa6 Patch from Tito adding support for '-q' 2004-08-19 18:26:26 +00:00
Eric Andersen b131db4326 Patch from Tito documenting the '-q' option 2004-08-19 18:25:02 +00:00
Eric Andersen cb01bb1d68 Patch from Vladimir N. Oleynik:
On Wed Aug 18, 2004 at 06:52:57PM +0800, Matt Johnston wrote:
> I've come across some strange-seeming behaviour when running programs
> under Busybox (1.0.0-rc3) ash. If the child process sets stdin to be
> non-blocking and then exits, the parent ash will also exit. A quick strace
> shows that a subsequent read() from stdin returns EAGAIN (as would be
> expected):

Thanks!
Patch attached.


--w
vodz
2004-08-19 18:22:13 +00:00
Eric Andersen 9ab4657c89 Fixup 'dc' usage 2004-08-18 17:57:16 +00:00
Eric Andersen b36900c4b4 Prepare for release 2004-08-16 10:29:29 +00:00
Eric Andersen 85ae1bb67d Bump version 2004-08-16 10:23:33 +00:00
Eric Andersen e3a792c80c Only pass modprobe module params with 2.6.x kernel support.
-Erik
2004-08-16 10:22:34 +00:00
Eric Andersen 1f50e84283 Do not use vfork, as init is not vfork safe. Do not allow
askfirst when mmuless.
2004-08-16 09:29:42 +00:00
Eric Andersen 88e38ca2fb Bertrand Baudet writes:
Looks like the -D and -H options of the adduser applet aren't handle
properly in BusyBox.

This patch fixes the masks definition for those options according to
there position in the optstring.

Patch against RC2 but should also apply cleanly against CVS.

Bertrand
2004-08-16 09:07:39 +00:00
Eric Andersen acd647c877 Joe.C writes:
This bug is in busybox 1.0.0-rc2. When using lash exec
builtin with redirection, the opened file fd keep increasing.
For example, please try the following command with lash.


ls -al /proc/<lash pid>/fd
exec /bin/sh 2>/dev/null
ls -al /proc/<lash pid>/fd

  The last 'ls' command output will look like this. The fd
number 4 shouldn't exist.

lrwx------    1 501      100         64 Aug 13 13:56 4 -> /dev/pts/5
l-wx------    1 501      100         64 Aug 13 13:56 2 -> /dev/null
lrwx------    1 501      100         64 Aug 13 13:56 1 -> /dev/pts/5
lrwx------    1 501      100         64 Aug 13 13:56 0 -> /dev/pts/5
dr-xr-xr-x    3 501      100          0 Aug 13 13:56 ..
dr-x------    2 501      100          0 Aug 13 13:56 .

  This one-line patch fix this problem by setting CLOEXEC flag for
squirrel fd. Please apply.

Joe.C
2004-08-16 08:38:34 +00:00
Eric Andersen 0722513497 Use __kernel_old_dev_t for 2.6.x kernels 2004-08-16 08:36:28 +00:00
Eric Andersen cf6ef05711 Aurelien Jacobs writes:
with a quick conversion you will see that 132608 == 0x20600
so noticed that the elif will never be matched !
Apparently there was already a try to modify this in CVS which
was reverted (it was plain wrong).

I don't know when __kernel_old_dev_t is needed, but with a 2.6.7
or a 2.6.8 this is __kernel_dev_t wich is needed.

I corrected this with the following patch but maybe older 2.6
still need __kernel_old_dev_t ?

I think this should be corrected before 1.0.

Thanks
Aurel
2004-08-16 08:29:44 +00:00
Eric Andersen beaef16315 Christian Ostheimer writes:
Hello,

function build_dep in modprobe.c assumes that dependencies of one module
have not more than 255 chars;
that is not sufficient in kernel 2.6.7 (alsa sound modules). - Below is
a diff that solves the problem for me.

With regards, Christian Ostheimer
2004-08-14 20:57:33 +00:00
Eric Andersen 9940e081c9 Patch from solar to fix problems with get_name() 2004-08-12 16:52:00 +00:00
Glenn L McGrath 4014ab1c60 Set default command to list rather than get, its default behaviour now
coincides with upstream. Patch from debian diff.
2004-08-11 08:10:58 +00:00
Glenn L McGrath fcf47321d4 Patch from Mike Castle, dont print an empty line (patch modified by me to
change formatting).
2004-08-11 05:56:30 +00:00
Glenn L McGrath 18bbd9bf3b Patch from Tito to fix memory leak upon error. 2004-08-11 03:50:30 +00:00
Glenn L McGrath 73db8be80a Patch from Bastian Blank to add 64 bit support to the test command.
Example of broken usage: ./busybox test 2147483648 -gt 2147483648
2004-08-11 02:45:47 +00:00
Glenn L McGrath d2c6f9a1f9 Patch from Phil Blundellto improve substring match 2004-08-11 02:32:18 +00:00
Glenn L McGrath 65c8c7ba27 Willian Barsse wrote
"There seems to be a slight problem with the "mod_strcmp" function in
modprobe.c, it scans for the first occurence of the module name in the
"mod_path" variable and expects it to be the last path element. ie
/lib/modules/2.4.22-debug/kernel/fs/vfat in my example. The comparison
will always fail if mod_path contains another substring matching the
module name."

Robert McQueen wrote
"Although William Barsse's patch fixed mod_strcmp for 2.4 kernels, there
was a remaining problem which prevented it from working for me. I've
just tracked it down - when you enable kernel 2.6 module support it
hard-wired the extension to .ko instead of checking at runtime like the
other places where 2.4 differs from 2.6. The attached patch fixes this
for me."
2004-08-11 02:30:30 +00:00
Glenn L McGrath 2f325a030b Patch from Tito to fix warnings about redifined functionions barrier and likely. 2004-08-06 01:49:04 +00:00
Glenn L McGrath 12ed333714 Part of patch from William Barsse, fixes a problem with unescaped %. 2004-08-06 00:58:53 +00:00
Eric Andersen 12de6cf0d7 Michael Leibow, MichaelLe at belkin.com writes:
A question was posted a month ago by Mark Alamo to see if others had
problems with sourcing subscripts within msh.  We asked his firm to fix the
msh.c bug he described because we didn't have enough time to do it
ourselves.

When msh.c is executing a compound statement and there is a . command to
source another script file, msh.c will not execute the subscript until it's
completed executing the rest of the compound statement.

His example was this:

Echo "Start" ; . ./subA; echo "mid" ; . ./subB ; echo "end"

subA and subB execute AFTER end is printed in reverse order.  The same is
true if the sourced files are inside an if else fi, case esac, or any
compound statement.

Attached is a patch to msh.c.  It fixes the problem.  Cd to the root of your
busybox tree and execute "patch -p1 < msh.c.patch"

Unfortunately, I won't have more time to work on this so I hope that there
aren't any problems!

Michael Leibow
Senior Software Engineer

Belkin Corporation
2004-08-04 19:19:10 +00:00
Eric Andersen 8401eeafd6 Run msh through indent 2004-08-04 19:16:54 +00:00
Eric Andersen 44b5758247 William Barsse writes:
fixes two other issues (plus the previous as well) with a 2.4 kernel :

- should be able to modprobe an already loaded module and get 0 return
code :
# modprobe <something> && modprobe <something> && echo "ok" || echo "failed"
....
failed

Well, hope this helps and that I didn't screw up again,
- William
2004-08-03 08:23:33 +00:00
Eric Andersen 93d7fba892 Tito, farmatito at tiscali dot it writes:
Hi to all,
This patch is useful for:
1) remove an unused var from extern char *find_real_root_device_name(const char* name)
    changing it to extern char *find_real_root_device_name(void).
2) fixes include/libbb.h, coreutils/df.c, util-linux/mount.c and  util-linux/umount.c accordingly.
3) fixes a bug, really a false positive,  in find_real_root_device_name() that happens if
    in the /dev directory exists a link named root (/dev/root) that should be skipped but
    is not. This affects applets like df that display wrong results
2004-08-03 00:14:02 +00:00
Eric Andersen ec91de762a fixup cut-n-paste problem 2004-08-01 18:54:45 +00:00
Eric Andersen 67776bef59 Simon Poole reports that awk segfaults when environment variables
with no value exist, i.e.

	$ export BOB=''
	% ./busybox awk
	Segmentation fault

This patch teaches awk to not blow chunks on empty env variables.
 -Erik
2004-07-30 23:52:08 +00:00
Eric Andersen cbcdbc41ff Fix incorrect arguments being passed to mknod 2004-07-30 17:48:21 +00:00
Eric Andersen b737b1a68b Umm. Not guilty by reason of insanity.
-Erik
2004-07-30 17:39:08 +00:00
Eric Andersen aad29b37a7 Fixup getty, login, etc so the utmp and wtmp are updated, allowing
the 'who' and 'last' applets among other things to work as expected.
 -Erik
2004-07-30 17:24:47 +00:00
Eric Andersen 15b588559b use SIGTERM to kill off udhcpd, not SIGKILL 2004-07-30 14:45:08 +00:00
Eric Andersen e71e760a99 Fix up brain damage with the way major and minor are used to
create a dev_t
2004-07-30 14:36:37 +00:00
Eric Andersen 373bc1eaee As noted by Eric Spakman, calling static_down() and then calling
bootp_down() seems redundant, esp since bootp_down was a subset
of static_down, so just use that...
2004-07-30 14:31:01 +00:00
Manuel Novoa III 413db4d583 Clean up hex escape support. 2004-07-29 23:15:16 +00:00
Eric Andersen 27645b4345 Thanks to Ken Roberts, fix the slackware url 2004-07-28 19:15:04 +00:00
Eric Andersen ccfc44806d Felipe Kellermann noticed a missing `break'. 2004-07-27 16:45:46 +00:00
Robert Griebl 9768a65eb4 document stuff I have done 2004-07-26 18:57:49 +00:00
164 changed files with 5753 additions and 3531 deletions

No files matched your search

+4
View File
@@ -56,6 +56,10 @@ Gennady Feldman <gfeldman@gena01.com>
Sysklogd (single threaded syslogd, IPC Circular buffer support,
logread), various fixes.
Robert Griebl <sandman@handhelds.org>
modprobe, hwclock, suid/sgid handling, tinylogin integration
many bugfixes and enhancements
Karl M. Hegbloom <karlheg@debian.org>
cp_mv.c, the test suite, various fixes to utility.c, &c.
+1306 -372
View File
File diff suppressed because it is too large. Load diff
+122 -35
View File
@@ -22,41 +22,126 @@
#--------------------------------------------------------------
noconfig_targets := menuconfig config oldconfig randconfig \
defconfig allyesconfig allnoconfig clean distclean \
release tags
TOPDIR=./
include Rules.mak
release tags
ifndef TOPDIR
TOPDIR=$(CURDIR)/
endif
ifndef top_srcdir
top_srcdir=$(CURDIR)
endif
ifndef top_builddir
top_builddir=$(CURDIR)
endif
srctree=$(top_srcdir)
vpath %/Config.in $(srctree)
include $(top_builddir)/Rules.mak
DIRS:=applets archival archival/libunarchive coreutils console-tools \
debianutils editors findutils init miscutils modutils networking \
networking/libiproute networking/udhcp procps loginutils shell \
sysklogd util-linux libpwdgrp coreutils/libcoreutils libbb
SRC_DIRS:=$(patsubst %,$(top_srcdir)/%,$(DIRS))
ifeq ($(strip $(CONFIG_SELINUX)),y)
CFLAGS += -I/usr/include/selinux
LIBRARIES += -lsecure
endif
CONFIG_CONFIG_IN = sysdeps/$(TARGET_OS)/Config.in
CONFIG_DEFCONFIG = sysdeps/$(TARGET_OS)/defconfig
CONFIG_CONFIG_IN = $(top_srcdir)/sysdeps/$(TARGET_OS)/Config.in
CONFIG_DEFCONFIG = $(top_srcdir)/sysdeps/$(TARGET_OS)/defconfig
ALL_DIRS:= $(DIRS) scripts/config
ALL_MAKEFILES:=$(patsubst %,%/Makefile,$(ALL_DIRS))
ifeq ($(KBUILD_SRC),)
ifdef O
ifeq ("$(origin O)", "command line")
KBUILD_OUTPUT := $(O)
endif
endif
# That's our default target when none is given on the command line
.PHONY: _all
_all:
ifneq ($(KBUILD_OUTPUT),)
# Invoke a second make in the output directory, passing relevant variables
# check that the output directory actually exists
saved-output := $(KBUILD_OUTPUT)
KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
$(if $(wildcard $(KBUILD_OUTPUT)),, \
$(error output directory "$(saved-output)" does not exist))
.PHONY: $(MAKECMDGOALS)
$(filter-out _all,$(MAKECMDGOALS)) _all: $(KBUILD_OUTPUT)/Rules.mak $(KBUILD_OUTPUT)/Makefile
$(MAKE) -C $(KBUILD_OUTPUT) \
top_srcdir=$(CURDIR) \
top_builddir=$(KBUILD_OUTPUT) \
TOPDIR=$(KBUILD_OUTPUT) \
KBUILD_SRC=$(CURDIR) \
-f $(CURDIR)/Makefile $@
$(KBUILD_OUTPUT)/Rules.mak:
@echo > $@
@echo top_srcdir=$(CURDIR) >> $@
@echo top_builddir=$(KBUILD_OUTPUT) >> $@
@echo include $(top_srcdir)/Rules.mak >> $@
$(KBUILD_OUTPUT)/Makefile:
@echo > $@
@echo top_srcdir=$(CURDIR) >> $@
@echo top_builddir=$(KBUILD_OUTPUT) >> $@
@echo KBUILD_SRC='$$(top_srcdir)' >> $@
@echo include '$$(KBUILD_SRC)'/Makefile >> $@
# Leave processing to above invocation of make
skip-makefile := 1
endif # ifneq ($(KBUILD_OUTPUT),)
endif # ifeq ($(KBUILD_SRC),)
ifeq ($(skip-makefile),)
_all: all
ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
all: busybox busybox.links doc
# In this section, we need .config
-include .config.cmd
include $(patsubst %,%/Makefile.in, $(DIRS))
-include $(TOPDIR).depend
all_tree: $(ALL_MAKEFILES)
busybox: .depend include/config.h $(libraries-y)
$(ALL_MAKEFILES): %/Makefile: $(top_srcdir)/%/Makefile
d=`dirname $@`; [ -d "$$d" ] || mkdir -p "$$d"; cp $< $@
# In this section, we need .config
-include $(top_builddir)/.config.cmd
include $(patsubst %,%/Makefile.in, $(SRC_DIRS))
-include $(top_builddir)/.depend
busybox: $(ALL_MAKEFILES) .depend include/config.h $(libraries-y)
$(CC) $(LDFLAGS) -o $@ -Wl,--start-group $(libraries-y) $(LIBRARIES) -Wl,--end-group
$(STRIPCMD) $@
busybox.links: applets/busybox.mkll include/config.h
busybox.links: $(top_srcdir)/applets/busybox.mkll include/config.h $(top_srcdir)/include/applets.h
- $(SHELL) $^ >$@
install: applets/install.sh busybox busybox.links
$(SHELL) $< $(PREFIX)
ifeq ($(strip $(CONFIG_FEATURE_SUID)),y)
@echo
@echo
@echo --------------------------------------------------
@echo You will probably need to make your busybox binary
@echo setuid root to ensure all configured applets will
@echo work properly.
@echo --------------------------------------------------
@echo
endif
uninstall: busybox.links
rm -f $(PREFIX)/bin/busybox
@@ -65,14 +150,18 @@ uninstall: busybox.links
install-hardlinks: applets/install.sh busybox busybox.links
$(SHELL) $< $(PREFIX) --hardlinks
check: busybox
bindir=$(top_builddir) srcdir=$(top_srcdir)/testsuite \
$(top_srcdir)/testsuite/runtest
# Documentation Targets
doc: docs/busybox.pod docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html
docs/busybox.pod : docs/busybox_header.pod include/usage.h docs/busybox_footer.pod
- ( cat docs/busybox_header.pod; \
docs/autodocifier.pl include/usage.h; \
cat docs/busybox_footer.pod ) > docs/busybox.pod
docs/busybox.pod : $(top_srcdir)/docs/busybox_header.pod $(top_srcdir)/include/usage.h $(top_srcdir)/docs/busybox_footer.pod
-mkdir -p docs
- ( cat $(top_srcdir)/docs/busybox_header.pod; \
$(top_srcdir)/docs/autodocifier.pl $(top_srcdir)/include/usage.h; \
cat $(top_srcdir)/docs/busybox_footer.pod ) > docs/busybox.pod
docs/BusyBox.txt: docs/busybox.pod
@echo
@@ -89,7 +178,7 @@ docs/BusyBox.1: docs/busybox.pod
docs/BusyBox.html: docs/busybox.net/BusyBox.html
- mkdir -p docs
-@ rm -f docs/BusyBox.html
-@ ln -s busybox.net/BusyBox.html docs/BusyBox.html
-@ cp docs/busybox.net/BusyBox.html docs/BusyBox.html
docs/busybox.net/BusyBox.html: docs/busybox.pod
-@ mkdir -p docs/busybox.net
@@ -98,20 +187,19 @@ docs/busybox.net/BusyBox.html: docs/busybox.pod
-@ rm -f pod2htm*
# The nifty new buildsystem stuff
scripts/mkdep: scripts/mkdep.c
$(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
scripts/mkdep: $(top_srcdir)/scripts/mkdep.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
scripts/split-include: scripts/split-include.c
$(HOSTCC) $(HOSTCFLAGS) -o scripts/split-include scripts/split-include.c
scripts/split-include: $(top_srcdir)/scripts/split-include.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
.depend: scripts/mkdep
rm -f .depend .hdepend;
mkdir -p include/config;
$(HOSTCC) $(HOSTCFLAGS) -o scripts/mkdep scripts/mkdep.c
scripts/mkdep -I include -- \
`find -name \*.c -print | sed -e "s,^./,,"` >> .depend;
`find $(top_srcdir) -name \*.c -print | sed -e "s,^./,,"` >> .depend;
scripts/mkdep -I include -- \
`find -name \*.h -print | sed -e "s,^./,,"` >> .hdepend;
`find $(top_srcdir) -name \*.h -print | sed -e "s,^./,,"` >> .hdepend;
depend dep: include/config.h .depend
@@ -120,13 +208,10 @@ include/config/MARKER: depend scripts/split-include
@ touch include/config/MARKER
include/config.h: .config
@if [ ! -x ./scripts/config/conf ] ; then \
@if [ ! -x $(top_builddir)/scripts/config/conf ] ; then \
$(MAKE) -C scripts/config conf; \
fi;
@./scripts/config/conf -o $(CONFIG_CONFIG_IN)
%.o: %.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
@$(top_builddir)/scripts/config/conf -o $(CONFIG_CONFIG_IN)
finished2:
@echo
@@ -140,12 +225,16 @@ all: menuconfig
# configuration
# ---------------------------------------------------------------------------
scripts/config/conf:
$(ALL_MAKEFILES): %/Makefile: $(top_srcdir)/%/Makefile
d=`dirname $@`; [ -d "$$d" ] || mkdir -p "$$d"; cp $< $@
scripts/config/conf: scripts/config/Makefile Rules.mak
$(MAKE) -C scripts/config conf
-@if [ ! -f .config ] ; then \
cp $(CONFIG_DEFCONFIG) .config; \
fi
scripts/config/mconf:
scripts/config/mconf: scripts/config/Makefile Rules.mak
$(MAKE) -C scripts/config ncurses conf mconf
-@if [ ! -f .config ] ; then \
cp $(CONFIG_DEFCONFIG) .config; \
@@ -177,9 +266,6 @@ allnoconfig: scripts/config/conf
defconfig: scripts/config/conf
@./scripts/config/conf -d $(CONFIG_CONFIG_IN)
check: busybox
cd testsuite && ./runtest
clean:
- rm -f docs/busybox.dvi docs/busybox.ps \
docs/busybox.pod docs/busybox.net/busybox.html \
@@ -222,7 +308,8 @@ tags:
endif # ifeq ($(strip $(HAVE_DOT_CONFIG)),y)
endif # ifeq ($(skip-makefile),)
.PHONY: dummy subdirs release distclean clean config oldconfig \
menuconfig tags check test depend
menuconfig tags check test depend buildtree
+13 -11
View File
@@ -31,25 +31,27 @@ If you wish to install hard links, rather than symlinks, you can use
Supported architectures:
BusyBox in general will build on any architecture supported by gcc. It has
a few specialized features added for __sparc__ and __alpha__. insmod
functionality is currently limited to x86, ARM, SH3/4, powerpc, m68k,
MIPS, cris, and v850e.
BusyBox in general will build on any architecture supported by gcc.
Kernel module loading for 2.2 and 2.4 Linux kernels is currently
limited to ARM, CRIS, H8/300, x86, ia64, x86_64, m68k, MIPS, PowerPC,
S390, SH3/4/5, Sparc, v850e, and x86_64 for 2.4.x kernels. For 2.6.x
kernels, kernel module loading support should work on all architectures.
Supported C Libraries:
glibc-2.0.x, glibc-2.1.x, glibc-2.2.x, glibc-2.3.x, uClibc. People
are looking at newlib and diet-libc, but consider them unsupported,
untested, or worse. Linux-libc5 is no longer supported -- you
should probably use uClibc instead if you want a small C library.
uClibc and glibc are supported. People have been looking at newlib and
dietlibc, but they are currently considered unsupported, untested, or
worse. Linux-libc5 is no longer supported -- you should probably use uClibc
instead if you want a small C library.
Supported kernels:
Full functionality requires Linux 2.2.x or better. A large fraction of the
code should run on just about anything. While the current code is fairly
Linux specific, it should be fairly easy to port the majority of the code
to, say, FreeBSD or Solaris, or Mac OS X, or even Windows (if you are into
that sort of thing).
to support, say, FreeBSD or Solaris, or Mac OS X, or even Windows (if you
are into that sort of thing).
----------------
@@ -80,7 +82,7 @@ an example:
With GNU date I get the following output:
$ date
Sat Mar 27 14:19:41 MST 2004
Fri Oct 8 14:19:41 MDT 2004
But when I use BusyBox date I get this instead:
+4 -8
View File
@@ -19,7 +19,7 @@
#--------------------------------------------------------
PROG := busybox
VERSION := 1.00-rc2
VERSION := 1.00
BUILDTIME := $(shell TZ=UTC date -u "+%Y.%m.%d-%H:%M%z")
@@ -42,7 +42,7 @@ LD = $(CROSS)ld
NM = $(CROSS)nm
STRIP = $(CROSS)strip
CPP = $(CC) -E
MAKEFILES = $(TOPDIR).config
# MAKEFILES = $(top_builddir)/.config
# What OS are you compiling busybox for? This allows you to include
# OS specific things, syscall overrides, etc.
@@ -80,7 +80,7 @@ BB_SRC_DIR=
#GCCINCDIR:=$(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
WARNINGS=-Wall -Wstrict-prototypes -Wshadow
CFLAGS=-I$(TOPDIR)include
CFLAGS=-I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir)
ARFLAGS=-r
#--------------------------------------------------------
@@ -102,7 +102,7 @@ endif
# Pull in the user's busybox configuration
ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
-include $(TOPDIR).config
-include $(top_builddir)/.config
endif
# A nifty macro to make testing gcc features easier
@@ -189,12 +189,8 @@ endif
# have a chance of winning.
CFLAGS += $(CFLAGS_EXTRA)
%.o: %.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
.PHONY: dummy
.EXPORT_ALL_VARIABLES:
+7 -5
View File
@@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/applets
APPLETS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir).depend
clean:
rm -f *.o *.a $(AR_TARGET)
+6 -5
View File
@@ -19,18 +19,19 @@
APPLETS_AR:=applets.a
ifndef $(APPLETS_DIR)
APPLETS_DIR:=$(TOPDIR)applets/
APPLETS_DIR:=$(top_builddir)/applets/
endif
srcdir=$(top_srcdir)/applets
APPLET_SRC:=applets.c busybox.c
APPLET_OBJ:= $(patsubst %.c,$(APPLETS_DIR)%.o, $(APPLET_SRC))
libraries-y+=$(APPLETS_DIR)$(APPLETS_AR)
$(APPLET_OBJ): $(TOPDIR).config
$(APPLETS_DIR)$(APPLETS_AR): $(APPLET_OBJ)
$(AR) -ro $@ $(APPLET_OBJ)
$(APPLET_OBJ): $(top_builddir)/.config
$(APPLET_OBJ): $(APPLETS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+7 -5
View File
@@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
ARCHIVAL_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
srcdir=$(top_srcdir)/archival
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)
+5 -1
View File
@@ -19,8 +19,9 @@
ARCHIVAL_AR:=archival.a
ifndef $(ARCHIVAL_DIR)
ARCHIVAL_DIR:=$(TOPDIR)archival/
ARCHIVAL_DIR:=$(top_builddir)/archival/
endif
srcdir=$(top_srcdir)/archival
ARCHIVAL-y:=
ARCHIVAL-$(CONFIG_APT_GET) +=
@@ -42,3 +43,6 @@ libraries-y+=$(ARCHIVAL_DIR)$(ARCHIVAL_AR)
$(ARCHIVAL_DIR)$(ARCHIVAL_AR): $(patsubst %,$(ARCHIVAL_DIR)%, $(ARCHIVAL-y))
$(AR) -ro $@ $(patsubst %,$(ARCHIVAL_DIR)%, $(ARCHIVAL-y))
$(ARCHIVAL_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+10 -6
View File
@@ -50,11 +50,12 @@ static void header_verbose_list_ar(const file_header_t *file_header)
printf("%s %d/%d%7d %s %s\n", &mode[1], file_header->uid, file_header->gid, (int) file_header->size, &mtime[4], file_header->name);
}
#define AR_CTX_PRINT 1
#define AR_CTX_LIST 2
#define AR_CTX_EXTRACT 4
#define AR_OPT_PRESERVE_DATE 8
#define AR_OPT_VERBOSE 16
#define AR_CTX_PRINT 0x01
#define AR_CTX_LIST 0x02
#define AR_CTX_EXTRACT 0x04
#define AR_OPT_PRESERVE_DATE 0x08
#define AR_OPT_VERBOSE 0x10
#define AR_OPT_CREATE 0x20
extern int ar_main(int argc, char **argv)
{
@@ -65,7 +66,7 @@ extern int ar_main(int argc, char **argv)
archive_handle = init_handle();
bb_opt_complementaly = "p~tx:t~px:x~pt";
opt = bb_getopt_ulflags(argc, argv, "ptxov");
opt = bb_getopt_ulflags(argc, argv, "ptxovc");
if ((opt & 0x80000000UL) || (optind == argc)) {
bb_show_usage();
@@ -86,6 +87,9 @@ extern int ar_main(int argc, char **argv)
if (opt & AR_OPT_VERBOSE) {
archive_handle->action_header = header_verbose_list_ar;
}
if (opt & AR_OPT_CREATE) {
bb_error_msg_and_die("Archive creation not supported. Install binutils 'ar'.");
}
archive_handle->src_fd = bb_xopen(argv[optind++], O_RDONLY);
+2
View File
@@ -33,6 +33,8 @@
int bunzip2_main(int argc, char **argv)
{
char *compressed_name;
/* Note: Ignore the warning about save_name being used uninitialized.
* That is not the case, but gcc has trouble working that out... */
char *save_name;
unsigned long opt;
int status;
+7 -5
View File
@@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../../
top_srcdir=../..
top_builddir=../..
srcdir=$(top_srcdir)/archival/libunarchive
LIBUNARCHIVE_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)
+5 -1
View File
@@ -19,8 +19,9 @@
LIBUNARCHIVE_AR:=libunarchive.a
ifndef $(LIBUNARCHIVE_DIR)
LIBUNARCHIVE_DIR:=$(TOPDIR)archival/libunarchive/
LIBUNARCHIVE_DIR:=$(top_builddir)/archival/libunarchive/
endif
srcdir=$(top_srcdir)/archvial/libunarchive
LIBUNARCHIVE-y:= \
\
@@ -78,3 +79,6 @@ libraries-y+=$(LIBUNARCHIVE_DIR)$(LIBUNARCHIVE_AR)
$(LIBUNARCHIVE_DIR)$(LIBUNARCHIVE_AR): $(patsubst %,$(LIBUNARCHIVE_DIR)%, $(LIBUNARCHIVE-y))
$(AR) -ro $@ $(patsubst %,$(LIBUNARCHIVE_DIR)%, $(LIBUNARCHIVE-y))
$(LIBUNARCHIVA_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+1 -1
View File
@@ -35,7 +35,7 @@ extern void data_extract_all(archive_handle_t *archive_handle)
if (archive_handle->flags & ARCHIVE_CREATE_LEADING_DIRS) {
char *name = bb_xstrdup(file_header->name);
bb_make_directory (dirname(name), 0777, FILEUTILS_RECUR);
bb_make_directory (dirname(name), -1, FILEUTILS_RECUR);
free(name);
}
@@ -134,6 +134,8 @@ static unsigned int get_bits(bunzip_data *bd, char bits_wanted)
static int get_next_block(bunzip_data *bd)
{
/* Note: Ignore the warning about hufGroup, base and limit being used uninitialized.
* They will be initialized on the fist pass of the loop. */
struct group_data *hufGroup;
int dbufCount,nextSym,dbufSize,groupCount,*base,*limit,selector,
i,j,k,t,runPos,symCount,symTotal,nSelectors,byteCount[256];
+2 -2
View File
@@ -234,9 +234,9 @@ static inline int writeTarHeader(struct TarBallInfo *tbInfo,
TAR_MAGIC_LEN + TAR_VERSION_LEN);
/* Enter the user and group names (default to root if it fails) */
if (my_getpwuid(header.uname, statbuf->st_uid) == NULL)
if (my_getpwuid(header.uname, statbuf->st_uid, sizeof(header.uname)) == NULL)
strcpy(header.uname, "root");
if (my_getgrgid(header.gname, statbuf->st_gid) == NULL)
if (my_getgrgid(header.gname, statbuf->st_gid, sizeof(header.gname)) == NULL)
strcpy(header.gname, "root");
if (tbInfo->hlInfo) {
+7 -5
View File
@@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/console/tools
CONSOLETOOLS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)
+5 -1
View File
@@ -19,8 +19,9 @@
CONSOLETOOLS_AR:=console-tools.a
ifndef $(CONSOLETOOLS_DIR)
CONSOLETOOLS_DIR:=$(TOPDIR)console-tools/
CONSOLETOOLS_DIR:=$(top_builddir)/console-tools/
endif
srcdir=$(top_srcdir)/console-tools
CONSOLETOOLS_DIR-y:=
CONSOLETOOLS_DIR-$(CONFIG_CHVT) += chvt.o
@@ -38,3 +39,6 @@ libraries-y+=$(CONSOLETOOLS_DIR)$(CONSOLETOOLS_AR)
$(CONSOLETOOLS_DIR)$(CONSOLETOOLS_AR): $(patsubst %,$(CONSOLETOOLS_DIR)%, $(CONSOLETOOLS_DIR-y))
$(AR) -ro $@ $(patsubst %,$(CONSOLETOOLS_DIR)%, $(CONSOLETOOLS_DIR-y))
$(CONSOLETOOLS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+8
View File
@@ -455,6 +455,13 @@ if !CONFIG_ASH && !CONFIG_HUSH && !CONFIG_LASH && !CONFIG_MSH
and bash) have test builtin.
endif
config CONFIG_FEATURE_TEST_64
bool " Extend test to 64 bit"
default n
depends on CONFIG_TEST
help
Enable 64-bit support in test.
config CONFIG_TOUCH
bool "touch"
default n
@@ -538,6 +545,7 @@ config CONFIG_WC
config CONFIG_WHO
bool "who"
default n
select CONFIG_FEATURE_U_W_TMP
help
who is used to show who is logged on.
+7 -5
View File
@@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/coreutils
SHELLUTILS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)
+6 -1
View File
@@ -19,8 +19,9 @@
COREUTILS_AR:=coreutils.a
ifndef $(COREUTILS_DIR)
COREUTILS_DIR:=$(TOPDIR)coreutils/
COREUTILS_DIR:=$(top_builddir)/coreutils/
endif
srcdir=$(top_srcdir)/coreutils
COREUTILS-y:=
COREUTILS-$(CONFIG_BASENAME) += basename.o
@@ -91,3 +92,7 @@ libraries-y+=$(COREUTILS_DIR)$(COREUTILS_AR)
$(COREUTILS_DIR)$(COREUTILS_AR): $(patsubst %,$(COREUTILS_DIR)%, $(COREUTILS-y))
$(AR) -ro $@ $(patsubst %,$(COREUTILS_DIR)%, $(COREUTILS-y))
$(COREUTILS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+9
View File
@@ -47,6 +47,7 @@
static struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
{
int nr;
char *cp;
nr = sscanf(t_string, "%2d%2d%2d%2d%d", &(tm_time->tm_mon),
&(tm_time->tm_mday), &(tm_time->tm_hour), &(tm_time->tm_min),
@@ -56,6 +57,14 @@ static struct tm *date_conv_time(struct tm *tm_time, const char *t_string)
bb_error_msg_and_die(bb_msg_invalid_date, t_string);
}
cp = strchr(t_string, '.');
if (cp) {
nr = sscanf(cp + 1, "%2d", &(tm_time->tm_sec));
if (nr != 1) {
bb_error_msg_and_die(bb_msg_invalid_date, t_string);
}
}
/* correct for century - minor Y2K problem here? */
if (tm_time->tm_year >= 1900) {
tm_time->tm_year -= 1900;
+1 -1
View File
@@ -130,7 +130,7 @@ extern int df_main(int argc, char **argv)
} else if (strcmp(device, "/dev/root") == 0) {
/* Adjusts device to be the real root device,
* or leaves device alone if it can't find it */
if ((device = find_real_root_device_name(device)) == NULL) {
if ((device = find_real_root_device_name()) == NULL) {
goto SET_ERROR;
}
}
+84 -59
View File
@@ -21,90 +21,115 @@
*/
/* BB_AUDIT SUSv3 _NOT_ compliant -- option -G is not currently supported. */
/* Hacked by Tito Ragusa (C) 2004 to handle usernames of whatever length and to
* be more similar to GNU id.
*/
#include "busybox.h"
#include "pwd_.h"
#include <stdio.h>
#include <unistd.h>
#include <getopt.h>
#include <string.h>
#include <sys/types.h>
#ifdef CONFIG_SELINUX
#include <proc_secure.h>
#include <flask_util.h>
#endif
#define JUST_USER 1
#define JUST_GROUP 2
#define PRINT_REAL 4
#define NAME_NOT_NUMBER 8
#define PRINT_REAL 1
#define NAME_NOT_NUMBER 2
#define JUST_USER 4
#define JUST_GROUP 8
static short printf_full(unsigned int id, const char *arg, const char prefix)
{
const char *fmt = "%cid=%u";
short status=EXIT_FAILURE;
if(arg) {
fmt = "%cid=%u(%s)";
status=EXIT_SUCCESS;
}
bb_printf(fmt, prefix, id, arg);
return status;
}
extern int id_main(int argc, char **argv)
{
char user[9], group[9];
long pwnam, grnam;
int uid, gid;
int flags;
struct passwd *p;
uid_t uid;
gid_t gid;
unsigned long flags;
short status;
#ifdef CONFIG_SELINUX
int is_flask_enabled_flag = is_flask_enabled();
#endif
flags = bb_getopt_ulflags(argc, argv, "ugrn");
bb_opt_complementaly = "u~g:g~u";
flags = bb_getopt_ulflags(argc, argv, "rnug");
if (((flags & (JUST_USER | JUST_GROUP)) == (JUST_USER | JUST_GROUP))
|| (argc > optind + 1)
) {
if ((flags & 0x80000000UL)
/* Don't allow -n -r -nr */
|| (flags <= 3 && flags > 0)
/* Don't allow more than one username */
|| (argc > optind + 1))
bb_show_usage();
/* This values could be overwritten later */
uid = geteuid();
gid = getegid();
if (flags & PRINT_REAL) {
uid = getuid();
gid = getgid();
}
if(argv[optind]) {
p=getpwnam(argv[optind]);
/* my_getpwnam is needed because it exits on failure */
uid = my_getpwnam(argv[optind]);
gid = p->pw_gid;
/* in this case PRINT_REAL is the same */
}
if (argv[optind] == NULL) {
if (flags & PRINT_REAL) {
uid = getuid();
gid = getgid();
if(flags & (JUST_GROUP | JUST_USER)) {
/* JUST_GROUP and JUST_USER are mutually exclusive */
if(flags & NAME_NOT_NUMBER) {
/* my_getpwuid and my_getgrgid exit on failure so puts cannot segfault */
puts((flags & JUST_USER) ? my_getpwuid(NULL, uid, -1 ) : my_getgrgid(NULL, gid, -1 ));
} else {
uid = geteuid();
gid = getegid();
bb_printf("%u\n",(flags & JUST_USER) ? uid : gid);
}
my_getpwuid(user, uid);
} else {
safe_strncpy(user, argv[optind], sizeof(user));
gid = my_getpwnamegid(user);
/* exit */
bb_fflush_stdout_and_exit(EXIT_SUCCESS);
}
my_getgrgid(group, gid);
pwnam=my_getpwnam(user);
grnam=my_getgrnam(group);
if (flags & (JUST_GROUP | JUST_USER)) {
char *s = group;
if (flags & JUST_USER) {
s = user;
grnam = pwnam;
}
if (flags & NAME_NOT_NUMBER) {
puts(s);
} else {
printf("%ld\n", grnam);
}
} else {
/* Print full info like GNU id */
/* my_getpwuid doesn't exit on failure here */
status=printf_full(uid, my_getpwuid(NULL, uid, 0), 'u');
putchar(' ');
/* my_getgrgid doesn't exit on failure here */
status|=printf_full(gid, my_getgrgid(NULL, gid, 0), 'g');
#ifdef CONFIG_SELINUX
printf("uid=%ld(%s) gid=%ld(%s)", pwnam, user, grnam, group);
if(is_flask_enabled_flag)
{
security_id_t mysid = getsecsid();
char context[80];
int len = sizeof(context);
context[0] = '\0';
if(security_sid_to_context(mysid, context, &len))
strcpy(context, "unknown");
printf(" context=%s\n", context);
}
else
printf("\n");
#else
printf("uid=%ld(%s) gid=%ld(%s)\n", pwnam, user, grnam, group);
#endif
if(is_flask_enabled_flag) {
security_id_t mysid = getsecsid();
char context[80];
int len = sizeof(context);
context[0] = '\0';
if(security_sid_to_context(mysid, context, &len))
strcpy(context, "unknown");
bb_printf(" context=%s", context);
}
bb_fflush_stdout_and_exit(0);
#endif
putchar('\n');
bb_fflush_stdout_and_exit(status);
}
/* END CODE */
/*
Local Variables:
c-file-style: "linux"
c-basic-offset: 4
tab-width: 4
End:
*/
+8 -5
View File
@@ -17,13 +17,16 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../../
top_srcdir=../..
top_builddir=../..
srcdir=$(top_srcdir)/coreutils/libcoreutils
LIBCOREUTILS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)
+6 -1
View File
@@ -19,8 +19,9 @@
LIBCOREUTILS_AR:=libcoreutils.a
ifndef $(LIBCOREUTILS_DIR)
LIBCOREUTILS_DIR:=$(TOPDIR)coreutils/libcoreutils/
LIBCOREUTILS_DIR:=$(top_builddir)/coreutils/libcoreutils/
endif
srcdir=$(top_srcdir)/coreutils/libcoreutils
LIBCOREUTILS_SRC:= cp_mv_stat.c getopt_mk_fifo_nod.c xgetoptfile_sort_uniq.c
@@ -30,3 +31,7 @@ libraries-y+=$(LIBCOREUTILS_DIR)$(LIBCOREUTILS_AR)
$(LIBCOREUTILS_DIR)$(LIBCOREUTILS_AR): $(LIBCOREUTILS_OBJS)
$(AR) -ro $@ $(LIBCOREUTILS_OBJS)
$(LIBCOREUTILS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+3 -3
View File
@@ -683,9 +683,9 @@ static int list_single(struct dnode *dn)
break;
case LIST_ID_NAME:
#ifdef CONFIG_FEATURE_LS_USERNAME
my_getpwuid(scratch, dn->dstat.st_uid);
my_getpwuid(scratch, dn->dstat.st_uid, sizeof(scratch));
printf("%-8.8s ", scratch);
my_getgrgid(scratch, dn->dstat.st_gid);
my_getgrgid(scratch, dn->dstat.st_gid, sizeof(scratch));
printf("%-8.8s", scratch);
column += 17;
break;
@@ -874,7 +874,7 @@ static const char ls_options[]="Cadil1gnsxAk" \
LS_STR_SELINUX \
LS_STR_AUTOWIDTH;
#define LIST_MASK_TRIGGER LIST_SHORT
#define LIST_MASK_TRIGGER 0
#define STYLE_MASK_TRIGGER STYLE_MASK
#define SORT_MASK_TRIGGER SORT_MASK
#define DISP_MASK_TRIGGER DISP_ROWS
+21 -133
View File
@@ -58,68 +58,19 @@
#include <assert.h>
#include "busybox.h"
#ifndef S_IFMT
static const int S_IFMT = 0170000;
#endif
#if !defined(S_ISBLK) && defined(S_IFBLK)
# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
#endif
#if !defined(S_ISCHR) && defined(S_IFCHR)
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
#endif
#if !defined(S_ISDIR) && defined(S_IFDIR)
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
#if !defined(S_ISREG) && defined(S_IFREG)
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif
#if !defined(S_ISFIFO) && defined(S_IFIFO)
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
#endif
#if !defined(S_ISLNK) && defined(S_IFLNK)
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
#endif
#if !defined(S_ISSOCK) && defined(S_IFSOCK)
# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
#endif
#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
#endif
#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
#endif
#define IN_CTYPE_DOMAIN(c) 1
#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c))
#define ISDIGIT_LOCALE(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
#define ISDIGIT(c) (((unsigned char) (c)) - '0' <= 9)
#define isodigit(c) ((c) >= '0' && (c) <= '7')
#define hextobin(c) ((c)>='a'&&(c)<='f' ? (c)-'a'+10 : (c)>='A'&&(c)<='F' ? (c)-'A'+10 : (c)-'0')
#define octtobin(c) ((c) - '0')
static double xstrtod __P((char *s));
static int print_esc __P((char *escstart));
static int print_formatted __P((char *format, int argc, char **argv));
static long xstrtol __P((char *s));
static unsigned long xstrtoul __P((char *s));
static void print_esc_string __P((char *str));
static int print_formatted __P((char *format, int argc, char **argv));
static void print_direc __P( (char *start, size_t length,
int field_width, int precision, char *argument));
static void print_esc_char __P((int c));
static void print_esc_string __P((char *str));
/* The value to return to the calling program. */
static int exit_status;
int printf_main(int argc, char **argv)
{
char *format;
int args_used;
exit_status = 0;
if (argc <= 1 || **(argv + 1) == '-') {
bb_show_usage();
}
@@ -140,7 +91,7 @@ int printf_main(int argc, char **argv)
fprintf(stderr, "excess args ignored");
*/
return(exit_status);
return EXIT_SUCCESS;
}
/* Print the text in FORMAT, using ARGV (with ARGC elements) for
@@ -188,7 +139,7 @@ static int print_formatted(char *format, int argc, char **argv)
} else
field_width = 0;
} else
while (ISDIGIT(*f)) {
while (isdigit(*f)) {
++f;
++direc_length;
}
@@ -205,7 +156,7 @@ static int print_formatted(char *format, int argc, char **argv)
} else
precision = 0;
} else
while (ISDIGIT(*f)) {
while (isdigit(*f)) {
++f;
++direc_length;
}
@@ -230,7 +181,10 @@ static int print_formatted(char *format, int argc, char **argv)
break;
case '\\':
f += print_esc(f);
if (*++f == 'c')
exit(0);
putchar(bb_process_escape_sequence((const char **)&f));
f--;
break;
default:
@@ -241,84 +195,6 @@ static int print_formatted(char *format, int argc, char **argv)
return save_argc - argc;
}
/* Print a \ escape sequence starting at ESCSTART.
Return the number of characters in the escape sequence
besides the backslash. */
static int print_esc(char *escstart)
{
register char *p = escstart + 1;
int esc_value = 0; /* Value of \nnn escape. */
int esc_length; /* Length of \nnn escape. */
/* \0ooo and \xhhh escapes have maximum length of 3 chars. */
if (*p == 'x') {
for (esc_length = 0, ++p;
esc_length < 3 && ISXDIGIT(*p); ++esc_length, ++p)
esc_value = esc_value * 16 + hextobin(*p);
/* if (esc_length == 0)
fprintf(stderr, "missing hex in esc");
*/
putchar(esc_value);
} else if (*p == '0') {
for (esc_length = 0, ++p;
esc_length < 3 && isodigit(*p); ++esc_length, ++p)
esc_value = esc_value * 8 + octtobin(*p);
putchar(esc_value);
} else if (strchr("\"\\abcfnrtv", *p))
print_esc_char(*p++);
/* else
fprintf(stderr, "\\%c: invalid esc", *p);
*/
return p - escstart - 1;
}
/* Output a single-character \ escape. */
static void print_esc_char(int c)
{
switch (c) {
case 'a': /* Alert. */
putchar(7);
break;
case 'b': /* Backspace. */
putchar(8);
break;
case 'c': /* Cancel the rest of the output. */
exit(0);
break;
case 'f': /* Form feed. */
putchar(12);
break;
case 'n': /* New line. */
putchar(10);
break;
case 'r': /* Carriage return. */
putchar(13);
break;
case 't': /* Horizontal tab. */
putchar(9);
break;
case 'v': /* Vertical tab. */
putchar(11);
break;
default:
putchar(c);
break;
}
}
/* Print string STR, evaluating \ escapes. */
static void print_esc_string(char *str)
{
for (; *str; str++)
if (*str == '\\')
str += print_esc(str);
else
putchar(*str);
}
static void
print_direc(char *start, size_t length, int field_width, int precision,
char *argument)
@@ -426,3 +302,15 @@ static double xstrtod(char *arg)
return result;
}
static void print_esc_string(char *str)
{
for (; *str; str++) {
if (*str == '\\') {
str++;
putchar(bb_process_escape_sequence((const char **)&str));
} else {
putchar(*str);
}
}
}
+1
View File
@@ -980,6 +980,7 @@ set_window_size(int rows, int cols, int fd)
if ((ioctl(fd, TIOCSWINSZ, (char *) &win) != 0)
|| (ioctl(fd, TIOCSSIZE, (char *) &ttysz) != 0)) {
perror_on_device("%s");
}
return;
}
# endif
+1
View File
@@ -228,6 +228,7 @@ int tail_main(int argc, char **argv)
buf = tailbuf;
taillen = 0;
seen = 1;
newline = 0;
while ((nread = tail_read(fds[i], buf, tailbufsize-taillen)) > 0) {
if (from_top) {
+28 -14
View File
@@ -155,19 +155,25 @@ static const struct t_op {
0, 0, 0}
};
#ifdef CONFIG_FEATURE_TEST_64
typedef int64_t arith_t;
#else
typedef int arith_t;
#endif
static char **t_wp;
static struct t_op const *t_wp_op;
static gid_t *group_array = NULL;
static int ngroups;
static enum token t_lex(char *s);
static int oexpr(enum token n);
static int aexpr(enum token n);
static int nexpr(enum token n);
static arith_t oexpr(enum token n);
static arith_t aexpr(enum token n);
static arith_t nexpr(enum token n);
static int binop(void);
static int primary(enum token n);
static arith_t primary(enum token n);
static int filstat(char *nm, enum token mode);
static int getn(const char *s);
static arith_t getn(const char *s);
static int newerf(const char *f1, const char *f2);
static int olderf(const char *f1, const char *f2);
static int equalf(const char *f1, const char *f2);
@@ -232,9 +238,9 @@ static void syntax(const char *op, const char *msg)
}
}
static int oexpr(enum token n)
static arith_t oexpr(enum token n)
{
int res;
arith_t res;
res = aexpr(n);
if (t_lex(*++t_wp) == BOR) {
@@ -244,9 +250,9 @@ static int oexpr(enum token n)
return res;
}
static int aexpr(enum token n)
static arith_t aexpr(enum token n)
{
int res;
arith_t res;
res = nexpr(n);
if (t_lex(*++t_wp) == BAND)
@@ -255,16 +261,16 @@ static int aexpr(enum token n)
return res;
}
static int nexpr(enum token n)
static arith_t nexpr(enum token n)
{
if (n == UNOT)
return !nexpr(t_lex(*++t_wp));
return primary(n);
}
static int primary(enum token n)
static arith_t primary(enum token n)
{
int res;
arith_t res;
if (n == EOI) {
syntax(NULL, "argument expected");
@@ -441,13 +447,21 @@ static enum token t_lex(char *s)
}
/* atoi with error detection */
static int getn(const char *s)
static arith_t getn(const char *s)
{
char *p;
#ifdef CONFIG_FEATURE_TEST_64
long long r;
#else
long r;
#endif
errno = 0;
#ifdef CONFIG_FEATURE_TEST_64
r = strtoll(s, &p, 10);
#else
r = strtol(s, &p, 10);
#endif
if (errno != 0)
bb_error_msg_and_die("%s: out of range", s);
@@ -456,7 +470,7 @@ static int getn(const char *s)
if (*(bb_skip_whitespace(p)))
bb_error_msg_and_die("%s: bad number", s);
return (int) r;
return r;
}
static int newerf(const char *f1, const char *f2)
+1 -1
View File
@@ -36,7 +36,7 @@ static const char uniq_opts[] = "f:s:cdu\0\7\3\5\1\2\4";
int uniq_main(int argc, char **argv)
{
FILE *in, *out;
/* Note: Ignore the warning about dups and e0 possibly being uninitialized.
/* Note: Ignore the warning about dups and e0 being used uninitialized.
* They will be initialized on the fist pass of the loop (since s0 is NULL). */
unsigned long dups, skip_fields, skip_chars, i;
const char *s0, *e0, *s1, *e1, *input_filename;
+3 -9
View File
@@ -29,16 +29,10 @@
extern int whoami_main(int argc, char **argv)
{
char user[9];
uid_t uid;
if (argc > 1)
bb_show_usage();
uid = geteuid();
if (my_getpwuid(user, uid)) {
puts(user);
bb_fflush_stdout_and_exit(EXIT_SUCCESS);
}
bb_error_msg_and_die("cannot find username for UID %u", (unsigned) uid);
puts(my_getpwuid(NULL, geteuid(), -1));
/* exits on error */
bb_fflush_stdout_and_exit(EXIT_SUCCESS);
}
+7 -5
View File
@@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/debianutils
DEBIANUTILS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)
+5 -2
View File
@@ -19,9 +19,9 @@
DEBIANUTILS_AR:=debianutils.a
ifndef $(DEBIANUTILS_DIR)
DEBIANUTILS_DIR:=$(TOPDIR)debianutils/
DEBIANUTILS_DIR:=$(top_builddir)/debianutils/
endif
srcdir=$(top_srcdir)/debianutils
DEBIANUTILS-y:=
DEBIANUTILS-$(CONFIG_MKTEMP) += mktemp.o
@@ -36,3 +36,6 @@ libraries-y+=$(DEBIANUTILS_DIR)$(DEBIANUTILS_AR)
$(DEBIANUTILS_DIR)$(DEBIANUTILS_AR): $(patsubst %,$(DEBIANUTILS_DIR)%, $(DEBIANUTILS-y))
$(AR) -ro $@ $(patsubst %,$(DEBIANUTILS_DIR)%, $(DEBIANUTILS-y))
$(DEBIANUTILS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+324
View File
@@ -0,0 +1,324 @@
<!--#include file="header.html" -->
<h3>Frequently Asked Questions</h3>
This is a collection of some of the more frequently asked questions
about BusyBox. Some of the questions even have answers. If you
have additions to this FAQ document, we would love to add them,
<ol>
<li><a href="#kernel">Which Linux kernel versions are supported?</a>
<li><a href="#arch">Which architectures does BusyBox run on?</a>
<li><a href="#libc">Which C libraries are supported?</a>
<li><a href="#commercial">Can I include BusyBox as part of the software on my device?</a>
<li><a href="#bugs">I think I found a bug in BusyBox! What should I do?!</a>
<li><a href="#job_control">Why do I keep getting "sh: can't access tty; job control
turned off" errors? Why doesn't Control-C work within my shell?</a>
<li><a href="#demanding">I demand that you to add &lt;favorite feature&gt; right now! How come
you don't answer all my questions on the mailing list instantly? I demand
that you help me with all of my problems <em>Right Now</em>!</a>
<li><a href="#getting_started">How can I get started using BusyBox?</a>
<li><a href="#helpme">I need help with BusyBox! What should I do?</a>
<li><a href="#contracts">I need you to add &lt;favorite feature&gt;! Are the BusyBox developers willing to
be paid in order to fix bugs or add in &lt;favorite feature&gt;? Are you willing to provide
support contracts?</a>
<li><a href="#support">I think you guys are great and I want to help support your work!</a>
</ol>
<hr />
<p>
<h2><a name="kernel">Which Linux kernel versions are supported?</a></h2>
<p>
Full functionality requires Linux 2.2.x or better. A large fraction of the
code should run on just about anything. While the current code is fairly
Linux specific, it should be fairly easy to port the majority of the code
to support, say, FreeBSD or Solaris, or Mac OS X, or even Windows (if you
are into that sort of thing).
<hr />
<p>
<h2><a name="arch">Which architectures does BusyBox run on?</a></h2>
<p>
BusyBox in general will build on any architecture supported by gcc.
Kernel module loading for 2.2 and 2.4 Linux kernels is currently
limited to ARM, CRIS, H8/300, x86, ia64, x86_64, m68k, MIPS, PowerPC,
S390, SH3/4/5, Sparc, v850e, and x86_64 for 2.4.x kernels.
With 2.6.x kernels, module loading support should work on all architectures.
<hr />
<p>
<h2><a name="libc">Which C libraries are supported?</a></h2>
<p>
uClibc and glibc are supported. People have been looking at newlib and
dietlibc, but they are currently considered unsupported, untested, or
worse. Linux-libc5 is no longer supported. If you require a small C
library, you should probably use uClibc.
<hr />
<p>
<h2><a name="commercial">Can I include BusyBox as part of the software on my device?</h2>
Yes. As long as you <a href="http://busybox.net/license.html">fully comply
with the generous terms of the GPL BusyBox license</a> you can ship BusyBox
as part of the software on your device.
<a href="#support">Please consider sharing some of the money you make.</a>
<hr />
<p>
<h2><a name="bugs">I think I found a bug in BusyBox! What should I do?</h2>
<p>
If you find a problem with BusyBox, please submit a detailed bug report to
the BusyBox mailing list at <a href="mailto:busybox@mail.busybox.net">
busybox@mail.busybox.net</a>. Please do not send private email to Erik
(the maintainer of BusyBox) asking for private help unless you are planning
on paying for consulting services. When we answer questions on the BusyBox
mailing list, it helps everyone, while private answers help only you...
<p>
If you find bugs, please submit a detailed bug report to the BusyBox mailing
list at busybox@mail.busybox.net. A well-written bug report should include a
transcript of a shell session that demonstrates the bad behavior and enables
anyone else to duplicate the bug on their own machine. The following is such
an example:
<pre>
To: busybox@mail.busybox.net
From: diligent@testing.linux.org
Subject: /bin/date doesn't work
Package: BusyBox
Version: 1.00
When I execute BusyBox 'date' it produces unexpected results.
With GNU date I get the following output:
$ date
Fri Oct 8 14:19:41 MDT 2004
But when I use BusyBox date I get this instead:
$ date
illegal instruction
I am using Debian unstable, kernel version 2.4.27 on a x86 system,
and the latest uClibc from CVS. Thanks for the wonderful program!
-Diligent
</pre>
Note the careful description and use of examples showing not only what BusyBox
does, but also a counter example showing what an equivalent GNU app does. Bug
reports lacking proper detail may never be fixed... Thanks for understanding.
<hr />
<p>
<h2><a name="job_control">Why do I keep getting "sh: can't access tty; job control
turned off" errors? Why doesn't Control-C work within my shell?</a></h2>
<p>
Job control will be turned off since your shell can not obtain a controlling
terminal. This typically happens when you run your shell on /dev/console.
The kernel will not provide a controlling terminal on the /dev/console
device. Your should run your shell on a normal tty such as tty1 or ttyS0
and everything will work perfectly. If you <em>REALLY</em> want your shell
to run on /dev/console, then you can hack your kernel (if you are into that
sortof thing) by changing drivers/char/tty_io.c to change the lines where
it sets "noctty = 1;" to instead set it to "0". I recommend you instead
run your shell on a real console...
<hr />
<p>
<h2><a name="getting_started">How can I get started using BusyBox?</a></h2>
<p>
An easy method to build your own basic BusyBox based system, is to
follow these simple steps:
<ul>
<li> Point your web browser <a href="/cgi-bin/cvsweb/buildroot/">here</a>
<li> Click on "Download tarball"
<li> Unpack the tarball on your Linux system somewhere
<li> run 'make' and configure things to taste.
<li> run 'unset CC'. Some Linux systems (i.e. Gentoo) set 'CC'
in the system environment which messes up cross compiles.
<li> run 'make'
<li> go have lunch, drink a pop, call a friend, play a video game, etc
till it finishes downloading software and compiling things.
<li> You should now have a shiny new BusyBox based system.
</ul>
<hr />
<p>
<h2><a name="demanding">I demand that you to add &lt;favorite feature&gt; right now! How come
you don't answer all my questions on the mailing list instantly? I demand
that you help me with all of my problems <em>Right Now</em>!</a></h2>
<p>
You have not paid us a single cent and yet you still have the product of
many years of our work. We are not your slaves! We work on BusyBox
because we find it useful and interesting. If you go off flaming us, we
will ignore you.
<hr />
<p>
<h2><a name="helpme">I need help with BusyBox! What should I do?</a></h2>
<p>
If you find that you need help with BusyBox, you can ask for help on the
BusyBox mailing list at busybox@mail.busybox.net. In addition to the BusyBox
mailing list, Erik (andersee), Manuel (mjn3) and others are known to hang out
on the uClibc IRC channel: #uclibc on irc.freenode.net.
<p>
<b>Please do not send private email to Erik, Manuel, or the other BusyBox
contributors asking for private help unless you are planning on paying for
consulting services.</b>
<p>
When we answer questions on the BusyBox mailing list, it helps everyone
since people with similar problems in the future will be able to get help
by searching the mailing list archives. Private help is reserved as a paid
service. If you need to use private communication, or if you are serious
about getting timely assistance with BusyBox, you should seriously consider
paying for consulting services.
<p>
<hr />
<p>
<h2><a name="contracts">I need you to add &lt;favorite feature&gt;! Are the BusyBox
developers willing to be paid in order to fix bugs or add in &lt;favorite feature&gt;?
Are you willing to provide support contracts?</a></h2>
<p>
Sure! Now you have our attention! What you should do is contact <a
href="mailto:andersen@codepoet.org">Erik Andersen</a> of <a
href="http://codepoet-consulting.com/">CodePoet Consulting</a> to bid
on your project. If Erik is too busy to personally add your feature, there
are many other active BusyBox contributors who will almost certainly be able
to help you out. Erik can contact them privatly, and may even let you to
post your request for services on the mailing list.
<hr />
<p>
<h2><a name="support">I think you guys are great and I want to help support your work!</a></h2>
<p>
Wow, that would be great! Erik personally pays for all the bandwidth, and
all servers used for busybox.net out of his own pocket. If you would like
to make a donation to help support BusyBox, and/or request features, you
can click here:
<!-- Begin PayPal Logo -->
<center>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="andersen@codepoet.org">
<input type="hidden" name="item_name" value="Support BusyBox">
<input type="hidden" name="image_url" value="http://codepoet-consulting.com/images/codepoet.png">
<input type="hidden" name="no_shipping" value="1">
<input type="image" src="images/donate.png" name="submit" alt="Make donation using PayPal">
</form>
</center>
<!-- End PayPal Logo -->
If you prefer to contact Erik directly to make a donation, donate hardware,
request support, etc, you can contact
<a href="http://codepoet-consulting.com/">CodePoet Consulting</a> here.
CodePoet Consulting can accept both Visa and MasterCard for those that do not
trust PayPal...
<hr />
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<!--#include file="footer.html" -->
+1 -1
View File
@@ -25,7 +25,7 @@ to you, but not store it).
<p>
Note that if you would prefer to keep your communications with me
private, you can encrypt your email using my
<a href="http://www.codepoet.org/~andersen/erik/gpg.asc">public key</a>.
<a href="http://www.codepoet.org/andersen/erik/gpg.asc">public key</a>.
<!--#include file="footer.html" -->
+1
View File
@@ -48,6 +48,7 @@
<br><a href="/lists.html">Mailing Lists</a>
<br><a href="/news.html">Latest News</a>
<br><a href="/download.html">Download</a>
<br><a href="/FAQ.html">FAQ</a>
<br><a href="/cvs_anon.html">Accessing CVS</a>
<br><a href="/cgi-bin/cvsweb/busybox/">Browse CVS</a>
<br><a href="/docs.html">Documentation</a>
+45 -22
View File
@@ -10,12 +10,32 @@ whatsoever, this page attempts to summarize what you should do to
ensure you do not accidentally violate the law.
<p>
<h3>Complying with the BusyBox license is easy and completely free.</h3>
U.S. and International Law protects copyright owners from the unauthorized
reproduction, adaptation, display, distribution, etc of copyright protected
works. Copyright violations (such as shipping BusyBox in a manner contrary to
its license) are subject to severe penalties. The courts can award up to
$150,000 per product shipped without even showing any actual loss by the
copyright holder. Criminal penalties are available for intentional acts
undertaken for purposes of "commercial advantage" or "private financial gain."
In addition, if it comes to my attention that you are violating the BusyBox
license, I will list you on the <a href="/shame.html">BusyBox Hall of Shame</a>
webpage.
<p>
Nobody wants that to happen. Do everyone a favor and don't break the law -- if
you use BusyBox, you <b>must comply with the BusyBox license</b>.
<p>
<h3>BusyBox is licensed under the GNU General Public License</h3>
BusyBox is licensed under the GNU General Public License , which
is generally just abbreviated simply as the GPL license, or
just the GPL. <a href="/products.html">Anyone thinking of shipping
is generally just abbreviated as the GPL license, or
just the GPL.
<p>
<a href="/products.html">Anyone thinking of shipping
BusyBox as part of a product</a> should be familiar with the
licensing terms under which they are allowed to use and
distribute BusyBox. You are advised to take a look over the
@@ -53,37 +73,39 @@ applications such as BusyBox is mandatory.
<p>
<b>Accompanied by source</b> generally means you place the full
source code for all GPL'd products such as BusyBox on a driver CD
somewhere. Full source code includes the BusyBox ".config" file
used when your shipping BusyBox binary was compiled.
<b>Accompanied by source</b> generally means you distribute the full
source code for all GPL'd products including BusyBox along with your
product, such as by placing it somewhere on a driver CD. Full source
code includes the BusyBox ".config" file used when your shipping BusyBox
binary was compiled, and any and all modifications you made to the
BusyBox source code.
<p>
<b>A written offer</b> generally means that somewhere in the
docs for your product, you write something like
documentation for your product, you write something like
<blockquote>
The GPL source code contained in this product is available as a
free download from http://blah.blah.blah/
</blockquote>
Or you can offer source by writing
somewhere in the docs for your product something like
Alternatively, you can offer the source code by writing
somewhere in the documentation for your product something like
<blockquote>
If you would like a copy of the GPL source code in this product
on a CD, please send $9.99 to &lt;address&gt; for the costs of
preparing and mailing a CD to you.
If you would like a copy of the GPL source code contained in this
product shipped to you on CD, please send $9.99 to &lt;address&gt;
which covers the cost of preparing and mailing a CD to you.
</blockquote>
<p>
Keep in mind though that if you distribute GPL'd binaries online
(as is often done when supplying firmware updates), it is highly
recommended that you make the corresponding source available online
at the same place. Regardless, you <b>must</b> either make source
available online (i.e. <b>accompanied by source</b>) and/or inform
those downloading firmware updates of their right to obtain source
(i.e. <b>a written offer</b>). Failure to do so is a violation of
your licensing obligations.
Keep in mind though that if you distribute GPL'd binaries online (as is often
done when supplying firmware updates), it is <b>highly</b> recommended that you
make the corresponding source available online at the same place. Regardless,
if you distribute a binary copy of BusyBox online (such as part of a firmware
update) you <b>must</b> either make source available online (i.e.
<b>accompanied by source</b>) and/or inform those downloading firmware updates
of their right to obtain source (i.e. <b>a written offer</b>). Failure to do
so is a violation of your licensing obligations.
<p>
@@ -97,6 +119,7 @@ If you distribute any GPL'd binaries, you must also make source available
as discussed on this webpage.
<p>
<h3>A Good Example</h3>
These days, <a href="http://www.linksys.com/">Linksys</a> is
doing a good job at complying with the GPL, they get to be an
@@ -104,8 +127,8 @@ example of how to do things right. Please take a moment and
check out what they do with
<a href="http://www.linksys.com/download/firmware.asp?fwid=178">
distributing the firmware for their WRT54G Router.</a>
Following their example would be a fine way to ensure you have
fulfilled your licensing obligations.
Following their example would be a fine way to ensure that you
have also fulfilled your licensing obligations.
<!--#include file="footer.html" -->
+33 -135
View File
@@ -3,146 +3,44 @@
<ul>
<li><b>26 July 2004 -- BusyBox 1.0.0-rc2 released</b><p>
<li><b>13 October 2004 -- BusyBox 1.00 released</b><p>
When you take a careful look at nearly every embedded Linux device or
software distribution shipping today, you will find a copy of BusyBox.
With countless routers, set top boxes, wireless access points, PDAs, and
who knows what else, the future for Linux and BusyBox on embedded devices
is looking very bright.
Here goes release candidate 2...
<p>
The <a href="downloads/Changelog">changelog</a> has all the details.
And as usual you can <a href="downloads">download busybox here</a>.
It is therefore with great satisfaction that I declare each and every
device already shipping with BusyBox is now officially out of date.
The highly anticipated release of BusyBox 1.00 has arrived!
<p>
Over three years in development, BusyBox 1.00 represents a tremendous
improvement over the old 0.60.x stable series. Now featuring a Linux
KernelConf based configuration system (as used by the Linux kernel),
Linux 2.6 kernel support, many many new applets, and the development
work and testing of thousands of people from around the world.
<p>
If you are already using BusyBox, you are strongly encouraged to upgrade to
BusyBox 1.00. If you are considering developing an embedded Linux device
or software distribution, you may wish to investigate if using BusyBox is
right for your application. If you need help getting started using
BusyBox, if you wish to donate to help cover expenses, or if you find a bug
and need help reporting it, you are invited to visit the <a
href="FAQ.html">BusyBox FAQ</a>.
<p>
As usual you can <a href="downloads">download busybox here</a>.
<p>Have Fun!
<p>
On a less happy note, My 92 year old grandmother (my dad's mom) passed away
yesterday (June 19th). The funeral will be Thursday in a little town about
2 hours south of my home. I've checked and there is absolutely no way I
could be back in time for the funeral if I attend <a
href="http://www.linuxsymposium.org/2004/">OLS</a> and give my presentation
as scheduled.
<p>
As such, it is with great reluctance and sadness that I have come
to the conclusion I will have to make my appologies and skip OLS
this year.
<p>
<p>
<li><b>20 July 2004 -- BusyBox 1.0.0-rc1 released</b><p>
Here goes release candidate 1... This fixes all (most?) of the problems
that have turned up since -pre10. In particular, loading and unloading of
kernel modules with 2.6.x kernels should be working much better.
<p>
I <b>really</b> want to get BusyBox 1.0.0 released soon and I see no real
reason why the 1.0.0 release shouldn't happen with things pretty much as
is. BusyBox is in good shape at the moment, and it works nicely for
everything that I'm doing with it. And from the reports I've been getting,
it works nicely for what most everyone else is doing with it as well.
There will eventually be a 1.0.1 anyway, so we might as well get on with
it. No BusyBox is not perfect. No piece of software ever is. And while
there is still plenty that can be done to improve things, most of that work
is waiting till we can get a solid 1.0.0 release out the door....
<p>
Please do not bother to send in patches adding cool new features at this
time. Only bug-fix patches will be accepted. If you have submitted a
bug-fixing patch to the busybox mailing list and no one has emailed you
explaining why your patch was rejected, it is safe to say that your patch
has been lost or forgotten. That happens sometimes. Please re-submit your
bug-fixing patch to the BusyBox mailing list, and be sure to put "[PATCH]"
at the beginning of the email subject line!
<p>
The <a href="downloads/Changelog">changelog</a> has all the details.
And as usual you can <a href="downloads">download busybox here</a>.
<p>Have Fun!
<p>
On a less happy note, My 92 year old grandmother (my dad's mom) passed away
yesterday (June 19th). The funeral will be Thursday in a little town about
2 hours south of my home. I've checked and there is absolutely no way I
could be back in time for the funeral if I attend <a
href="http://www.linuxsymposium.org/2004/">OLS</a> and give my presentation
as scheduled.
<p>
As such, it is with great reluctance and sadness that I have come
to the conclusion I will have to make my appologies and skip OLS
this year.
<p>
<p>
<li><b>13 April 2004 -- BusyBox 1.0.0-pre10 released</b><p>
Ok, I lied. It turns out that -pre9 will not be the final BusyBox
pre-release. With any luck however -pre10 will be, since I <b>really</b>
want to get BusyBox 1.0.0 released very soon. As usual, please do not
bother to send in patches adding cool new features at this time. Only
bug-fix patches will be accepted. It would also be <b>very</b> helpful if
people could continue to review the BusyBox documentation and submit
improvements.
<p>
The <a href="downloads/Changelog">changelog</a> has all the details.
And as usual you can <a href="downloads">download busybox here</a>.
<p>Have Fun!
<p>
<p>
<li><b>6 April 2004 -- BusyBox 1.0.0-pre9 released</b><p>
Here goes the final BusyBox pre-release... This is your last chance for
bug fixes. With luck this will be released as BusyBox 1.0.0 later this
week. Please do not bother to send in patches adding cool new features at
this time. Only bug-fix patches will be accepted. It would also be
<b>very</b> helpful if people could help review the BusyBox documentation
and submit improvements. I've spent a lot of time updating the
documentation to make it better match reality, but I could really use some
assistance in checking that the features supported by the various applets
match the features listed in the documentation.
<p>
I had hoped to get this released a month ago, but
<a href="http://codepoet.org/gallery/baby_peter/img_1796">
another release on 1 March 2004</a> has kept me busy...
<p>
The <a href="downloads/Changelog">changelog</a> has all the details.
And as usual you can <a href="downloads">download busybox here</a>.
<p>Have Fun!
<p>
<p>
<li><b>23 February 2004 -- BusyBox 1.0.0-pre8 released</b><p>
Here goes yet another BusyBox pre-release... Please do not bother to send
in patches supplying new features at this time. Only bug-fix patches will
be accepted. If you have a cool new feature you would like to see
supported, or if you have an amazing new applet you would like to submit,
please wait and submit such things later. We really want to get a release
out we can all be proud of. We are still aiming to finish off the -pre
series in February and move on to the final 1.0.0 release... So if you
spot any bugs, now would be an excellent time to send in a fix to the
busybox mailing list. It would also be <b>very</b> helpful if people could
help review the BusyBox documentation and submit improvements. It would be
especially helpful if people could check that the features supported by the
various applets match the features listed in the documentation.
<p>
The <a href="downloads/Changelog">changelog</a> has all the details.
And as usual you can <a href="downloads">download busybox here</a>.
<p>Have Fun!
<p>
<p>
<li><b>Old News</b><p>
<a href="/oldnews.html">Click here to read older news</a>
+136
View File
@@ -3,6 +3,142 @@
<ul>
<li><b>16 August 2004 -- BusyBox 1.0.0-rc3 released</b><p>
Here goes release candidate 3...
<p>
The <a href="downloads/Changelog">changelog</a> has all the details.
And as usual you can <a href="downloads">download busybox here</a>.
<p>Have Fun!
<p>
<li><b>26 July 2004 -- BusyBox 1.0.0-rc2 released</b><p>
Here goes release candidate 2...
<p>
The <a href="downloads/Changelog">changelog</a> has all the details.
And as usual you can <a href="downloads">download busybox here</a>.
<p>Have Fun!
<p>
<li><b>20 July 2004 -- BusyBox 1.0.0-rc1 released</b><p>
Here goes release candidate 1... This fixes all (most?) of the problems
that have turned up since -pre10. In particular, loading and unloading of
kernel modules with 2.6.x kernels should be working much better.
<p>
I <b>really</b> want to get BusyBox 1.0.0 released soon and I see no real
reason why the 1.0.0 release shouldn't happen with things pretty much as
is. BusyBox is in good shape at the moment, and it works nicely for
everything that I'm doing with it. And from the reports I've been getting,
it works nicely for what most everyone else is doing with it as well.
There will eventually be a 1.0.1 anyway, so we might as well get on with
it. No, BusyBox is not perfect. No piece of software ever is. And while
there is still plenty that can be done to improve things, most of that work
is waiting till we can get a solid 1.0.0 release out the door....
<p>
Please do not bother to send in patches adding cool new features at this
time. Only bug-fix patches will be accepted. If you have submitted a
bug-fixing patch to the busybox mailing list and no one has emailed you
explaining why your patch was rejected, it is safe to say that your patch
has been lost or forgotten. That happens sometimes. Please re-submit your
bug-fixing patch to the BusyBox mailing list, and be sure to put "[PATCH]"
at the beginning of the email subject line!
<p>
The <a href="downloads/Changelog">changelog</a> has all the details.
And as usual you can <a href="downloads">download busybox here</a>.
<p>Have Fun!
<p>
On a less happy note, My 92 year old grandmother (my dad's mom) passed away
yesterday (June 19th). The funeral will be Thursday in a little town about
2 hours south of my home. I've checked and there is absolutely no way I
could be back in time for the funeral if I attend <a
href="http://www.linuxsymposium.org/2004/">OLS</a> and give my presentation
as scheduled.
<p>
As such, it is with great reluctance and sadness that I have come
to the conclusion I will have to make my appologies and skip OLS
this year.
<p>
<p>
<li><b>13 April 2004 -- BusyBox 1.0.0-pre10 released</b><p>
Ok, I lied. It turns out that -pre9 will not be the final BusyBox
pre-release. With any luck however -pre10 will be, since I <b>really</b>
want to get BusyBox 1.0.0 released very soon. As usual, please do not
bother to send in patches adding cool new features at this time. Only
bug-fix patches will be accepted. It would also be <b>very</b> helpful if
people could continue to review the BusyBox documentation and submit
improvements.
<p>
The <a href="downloads/Changelog">changelog</a> has all the details.
And as usual you can <a href="downloads">download busybox here</a>.
<p>Have Fun!
<p>
<p>
<li><b>6 April 2004 -- BusyBox 1.0.0-pre9 released</b><p>
Here goes the final BusyBox pre-release... This is your last chance for
bug fixes. With luck this will be released as BusyBox 1.0.0 later this
week. Please do not bother to send in patches adding cool new features at
this time. Only bug-fix patches will be accepted. It would also be
<b>very</b> helpful if people could help review the BusyBox documentation
and submit improvements. I've spent a lot of time updating the
documentation to make it better match reality, but I could really use some
assistance in checking that the features supported by the various applets
match the features listed in the documentation.
<p>
I had hoped to get this released a month ago, but
<a href="http://codepoet.org/gallery/baby_peter/img_1796">
another release on 1 March 2004</a> has kept me busy...
<p>
The <a href="downloads/Changelog">changelog</a> has all the details.
And as usual you can <a href="downloads">download busybox here</a>.
<p>Have Fun!
<p>
<p>
<li><b>23 February 2004 -- BusyBox 1.0.0-pre8 released</b><p>
Here goes yet another BusyBox pre-release... Please do not bother to send
in patches supplying new features at this time. Only bug-fix patches will
be accepted. If you have a cool new feature you would like to see
supported, or if you have an amazing new applet you would like to submit,
please wait and submit such things later. We really want to get a release
out we can all be proud of. We are still aiming to finish off the -pre
series in February and move on to the final 1.0.0 release... So if you
spot any bugs, now would be an excellent time to send in a fix to the
busybox mailing list. It would also be <b>very</b> helpful if people could
help review the BusyBox documentation and submit improvements. It would be
especially helpful if people could check that the features supported by the
various applets match the features listed in the documentation.
<p>
The <a href="downloads/Changelog">changelog</a> has all the details.
And as usual you can <a href="downloads">download busybox here</a>.
<p>Have Fun!
<p>
<li><b>4 February 2004 -- BusyBox 1.0.0-pre7 released</b><p>
There was a bug in -pre6 that broke argument parsing for a
+17 -9
View File
@@ -26,7 +26,7 @@ Debian installer (boot floppies) project</a>
</li><li><a href="http://redhat.com/">Red Hat installer</a>
</li><li><a href=
"http://distro.ibiblio.org/pub/Linux/distributions/slackware/source/rootdsks/">
"http://distro.ibiblio.org/pub/Linux/distributions/slackware/slackware-current/source/rootdisks/">
Slackware Installer</a>
</li><li><a href="http://www.gentoo.org/">Gentoo Linux install/boot CDs</a>
@@ -71,17 +71,13 @@ nanoEngine</a>
</li><li><a href="http://www.ltsp.org/">Linux Terminal
Server Project</a>
</li><li><a href=
"http://www.devil-linux.org/">Devil-Linux</a>
</li><li><a href="http://www.devil-linux.org/">Devil-Linux</a>
</li><li><a href=
"http://dutnux.sourceforge.net/">DutNux</a>
</li><li><a href="http://dutnux.sourceforge.net/">DutNux</a>
</li><li><a href=
"http://www.microwerks.net/~hugo/mindi/">Mindi</a>
</li><li><a href="http://www.microwerks.net/~hugo/mindi/">Mindi</a>
</li><li><a href=
"http://www.tzi.de/~pharao90/ttylinux">ttylinux</a>
</li><li><a href="http://www.minimalinux.org/ttylinux/">ttylinux</a>
</li><li><a href="http://www.coyotelinux.com/">Coyote Linux</a>
@@ -93,6 +89,7 @@ Image</a>
</li><li><a href="http://tinfoilhat.cultists.net/">Tinfoil
Hat Linux</a>
</li><li><a href="http://sourceforge.net/projects/gp32linux/">gp32linux</a>
</li><li><a href="http://familiar.handhelds.org/">Familiar Linux</a><br>A linux distribution for handheld computers
</li><li><a href="http://rescuecd.sourceforge.net/">Timo's Rescue CD Set</a>
</li><li><a href="http://sf.net/projects/netstation/">Netstation</a>
@@ -149,6 +146,17 @@ Hat Linux</a>
</li><li><a href="http://www.actiontec.com/products/broadband/54mbps_wireless_gateway_1p/index.html">
ActionTec GT701-WG Wireless Gateway/DSL Modem</a>
with source <a href="http://128.121.226.214/gtproducts/index.html">here</a>
</li><li><a href="http://smartlinux.sourceforge.net/">S.M.A.R.T. Linux</a>
</li><li><a href="http://www.dlink.com/">DLink - Model GSL-G604T, DSL-300T, and possibly other models</a>
with source <a href="ftp://ftp.dlink.co.uk/dsl_routers_modems/">here,</a>
with source <a href="ftp://ftp.dlink.de/dsl-products/">and here,</a>
and quite possibly other places as well. You may need to dig down a bit
to find the source, but it does seem to be there.
</li><li><a href="http://www.siemens-mobile.de/cds/frontdoor/0,2241,de_de_0_42931_rArNrNrNrN,00.html">Siemens SE515 DSL router</a>
with source <a href="http://now-portal.c-lab.de/projects/gigaset/">here, I think...</a>
with some details <a href="http://heinz.hippenstiel.org/familie/hp/hobby/gigaset_se515dsl.html">here.</a>
</li><li><a href="http://frwt.stim.ru/">Free Remote Windows Terminal</a>
</li>
</ul>
+6 -6
View File
@@ -13,7 +13,7 @@ font-family: monospace; font-size: smaller;" width="100">
$ ./busybox
BusyBox v1.00 (2004.04.06-14:56+0000) multi-call binary
BusyBox v1.00 (2004.10.13-04:49+0000) multi-call binary
Usage: busybox [function] [arguments]...
or: [function] [arguments]...
@@ -33,11 +33,11 @@ Currently defined functions:
fgrep, find, fold, free, freeramdisk, fsck.minix, ftpget, ftpput, getopt,
getty, grep, gunzip, gzip, halt, hdparm, head, hexdump, hostid, hostname,
httpd, hush, hwclock, id, ifconfig, ifdown, ifup, inetd, init, insmod,
install, ip, ipcalc, iplink, iproute, iptunnel, kill, killall, klogd, lash,
last, length, linuxrc, ln, loadfont, loadkmap, logger, login, logname,
logread, losetup, ls, lsmod, makedevs, md5sum, mesg, mkdir, mkfifo,
mkfs.minix, mknod, mkswap, mktemp, modprobe, more, mount, msh, mt, mv,
nameif, nc, netstat, nslookup, od, openvt, passwd, patch, pidof, ping,
install, ip, ipaddr, ipcalc, iplink, iproute, iptunnel, kill, killall,
klogd, lash, last, length, linuxrc, ln, loadfont, loadkmap, logger, login,
logname, logread, losetup, ls, lsmod, makedevs, md5sum, mesg, mkdir,
mkfifo, mkfs.minix, mknod, mkswap, mktemp, modprobe, more, mount, msh, mt,
mv, nameif, nc, netstat, nslookup, od, openvt, passwd, patch, pidof, ping,
ping6, pipe_progress, pivot_root, poweroff, printf, ps, pwd, rdate,
readlink, realpath, reboot, renice, reset, rm, rmdir, rmmod, route, rpm,
rpm2cpio, run-parts, rx, sed, seq, setkeycodes, sha1sum, sleep, sort,
+10 -4
View File
@@ -22,9 +22,13 @@ companies listed below should be ashamed of themselves. Furthermore, each
product listed here is subject to being legally ordered to cease and desist
distribution for violation of copyright law, and the distributor of each
product is subject to being sued for statutory copyright infringement damages
plus legal fees. Nobody wants to be sued, and <a
href="mailto:andersen@codepoet.org">Erik</a> certainly has better things to do
than sue people. But he will sue if forced to do so to maintain compliance.
of up to $150,000 per work plus legal fees. Nobody wants to be sued, and <a
href="mailto:andersen@codepoet.org">Erik</a> certainly would prefer to spend
his time doing better things than sue people. But he will sue if forced to
do so to maintain compliance.
<p>
Do everyone a favor and don't break the law -- if you use busybox, comply with
the busybox license by releasing the source code with your product.
@@ -32,7 +36,6 @@ the busybox license by releasing the source code with your product.
<ul>
<li><a href="http://www.dlink.com/"> DLink - Model GSL-G604T, DSL-300T, and possibly other models</a>
<li><a href="http://www.trittontechnologies.com/products.html">Tritton Technologies NAS120</a>
<br>see <a href="http://www.ussg.iu.edu/hypermail/linux/kernel/0404.0/1611.html">here for details</a>
<li><a href="http://www.macsense.com/product/homepod/">Macsense HomePod</a>
@@ -62,6 +65,9 @@ the busybox license by releasing the source code with your product.
</li><li><a href="http://www.vinc.us/">Bravo DVD players using the Sigma Designs EM8500</a>
</li><li><a href="http://www.hb-direct.com/">H&B DX3110 Divx player based on Sigma Designs EM8500</a>
</li><li><a href="http://www.recospa.it/mdpro1/index.php">United *DVX4066 mpeg4 capable DVD players</a>
</li><li><a href="http://www.a-link.com/RR64AP.html">Avaks alink Roadrunner 64</a>
<br> Partial source available, based on source distributed under NDA from <a href="http://www.lsilogic.com/products/dsl_platform_solutions/hb_linuxr2_2.html"> LSILogic</a>. Why the NDA LSILogic, what are you hiding ?
<br>To verify the Avaks infrigment see my slashdot <a href="http://slashdot.org/~bug1/journal/">journal</a>.
</li><li>Undoubtedly there are others... Please report them so we can shame them (or if necessary sue them) into compliance.
</ul>
+5 -5
View File
@@ -89,11 +89,11 @@ Currently defined functions include:
fgrep, find, fold, free, freeramdisk, fsck.minix, ftpget, ftpput, getopt,
getty, grep, gunzip, gzip, halt, hdparm, head, hexdump, hostid, hostname,
httpd, hush, hwclock, id, ifconfig, ifdown, ifup, inetd, init, insmod,
install, ip, ipcalc, iplink, iproute, iptunnel, kill, killall, klogd, lash,
last, length, linuxrc, ln, loadfont, loadkmap, logger, login, logname,
logread, losetup, ls, lsmod, makedevs, md5sum, mesg, mkdir, mkfifo,
mkfs.minix, mknod, mkswap, mktemp, modprobe, more, mount, msh, mt, mv,
nameif, nc, netstat, nslookup, od, openvt, passwd, patch, pidof, ping,
install, ip, ipaddr, ipcalc, iplink, iproute, iptunnel, kill, killall,
klogd, lash, last, length, linuxrc, ln, loadfont, loadkmap, logger, login,
logname, logread, losetup, ls, lsmod, makedevs, md5sum, mesg, mkdir,
mkfifo, mkfs.minix, mknod, mkswap, mktemp, modprobe, more, mount, msh, mt,
mv, nameif, nc, netstat, nslookup, od, openvt, passwd, patch, pidof, ping,
ping6, pipe_progress, pivot_root, poweroff, printf, ps, pwd, rdate,
readlink, realpath, reboot, renice, reset, rm, rmdir, rmmod, route, rpm,
rpm2cpio, run-parts, rx, sed, seq, setkeycodes, sha1sum, sleep, sort,
+7 -5
View File
@@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/editors
EDITOR_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)
+5 -1
View File
@@ -19,8 +19,9 @@
EDITOR_AR:=editors.a
ifndef $(EDITOR_DIR)
EDITOR_DIR:=$(TOPDIR)editors/
EDITOR_DIR:=$(top_builddir)/editors/
endif
srcdir=$(top_srcdir)/editors
EDITOR-y:=
EDITOR-$(CONFIG_AWK) += awk.o
@@ -42,3 +43,6 @@ endif
$(EDITOR_DIR)$(EDITOR_AR): $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
$(AR) -ro $@ $(patsubst %,$(EDITOR_DIR)%, $(EDITOR-y))
$(EDITOR_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+6 -1
View File
@@ -1554,7 +1554,7 @@ static void handle_special(var *v) {
memcpy(b+len, s, l);
len += l;
}
b[len] = '\0';
if (b) b[len] = '\0';
setvar_p(V[F0], b);
is_f0_split = TRUE;
@@ -2551,6 +2551,7 @@ static int awk_exit(int r) {
if (! exiting) {
exiting = TRUE;
nextrec = FALSE;
evaluate(endseq.first, &tv);
}
@@ -2670,8 +2671,12 @@ extern int awk_main(int argc, char **argv) {
for (envp=environ; *envp; envp++) {
s = bb_xstrdup(*envp);
s1 = strchr(s, '=');
if (!s1) {
goto keep_going;
}
*(s1++) = '\0';
setvar_u(findvar(iamarray(V[ENVIRON]), s), s1);
keep_going:
free(s);
}
+4 -4
View File
@@ -19,7 +19,7 @@
*/
static const char vi_Version[] =
"$Id: vi.c,v 1.37 2004/07/20 06:44:46 andersen Exp $";
"$Id: vi.c,v 1.38 2004/08/19 19:15:06 andersen Exp $";
/*
* To compile for standalone use:
@@ -507,7 +507,6 @@ static void edit_file(Byte * fn)
#endif /* CONFIG_FEATURE_VI_DOT_CMD */
redraw(FALSE); // dont force every col re-draw
show_status_line();
fflush(stdout);
//------This is the main Vi cmd handling loop -----------------------
while (editing > 0) {
@@ -676,7 +675,7 @@ static void colon(Byte * buf)
Byte c, *orig_buf, *buf1, *q, *r;
Byte *fn, cmd[BUFSIZ], args[BUFSIZ];
int i, l, li, ch, st, b, e;
int useforce, forced;
int useforce = FALSE, forced = FALSE;
struct stat st_buf;
// :3154 // if (-e line 3154) goto it else stay put
@@ -693,7 +692,6 @@ static void colon(Byte * buf)
// :s/find/replace/ // substitute pattern "find" with "replace"
// :!<cmd> // run <cmd> then return
//
forced = useforce = FALSE;
if (strlen((char *) buf) <= 0)
goto vc1;
@@ -2661,6 +2659,7 @@ static void show_status_line(void)
static int last_cksum;
int l, cnt, cksum;
edit_status();
cnt = strlen((char *) status_buffer);
for (cksum= l= 0; l < cnt; l++) { cksum += (int)(status_buffer[l]); }
// don't write the status line unless it changes
@@ -2671,6 +2670,7 @@ static void show_status_line(void)
clear_to_eol();
place_cursor(crow, ccol, FALSE); // put cursor back in correct place
}
fflush(stdout);
}
//----- format the status buffer, the bottom line of screen ------
+2 -1
View File
@@ -15,9 +15,10 @@ then
do :
done
metric=0
for i in $router
do
/sbin/route add default gw $i dev $interface
/sbin/route add default gw $i dev $interface metric $((metric++))
done
fi
+2 -1
View File
@@ -15,9 +15,10 @@ then
do :
done
metric=0
for i in $router
do
/sbin/route add default gw $i dev $interface
/sbin/route add default gw $i dev $interface metric $((metric++))
done
fi
+2 -1
View File
@@ -22,8 +22,9 @@ case "$1" in
:
done
metric=0
for i in $router ; do
route add default gw $i dev $interface
route add default gw $i dev $interface metric $((metric++))
done
fi
+7
View File
@@ -114,3 +114,10 @@ option lease 864000 # 10 days of seconds
#opt ntpsrv
#opt tftp
#opt bootfile
# Static leases map
#static_lease 00:60:08:11:CE:4E 192.168.0.54
#static_lease 00:60:08:11:CE:3E 192.168.0.44
+7 -5
View File
@@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/findutils
FINDUTILS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)
+5 -1
View File
@@ -19,8 +19,9 @@
FINDUTILS_AR:=findutils.a
ifndef $(FINDUTILS_DIR)
FINDUTILS_DIR:=$(TOPDIR)findutils/
FINDUTILS_DIR:=$(top_builddir)/findutils/
endif
srcdir=$(top_srcdir)/findutils
FINDUTILS-y:=
FINDUTILS-$(CONFIG_FIND) += find.o
@@ -32,3 +33,6 @@ libraries-y+=$(FINDUTILS_DIR)$(FINDUTILS_AR)
$(FINDUTILS_DIR)$(FINDUTILS_AR): $(patsubst %,$(FINDUTILS_DIR)%, $(FINDUTILS-y))
$(AR) -ro $@ $(patsubst %,$(FINDUTILS_DIR)%, $(FINDUTILS-y))
$(FINDUTILS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+4 -4
View File
@@ -249,9 +249,9 @@ static void load_regexes_from_file(llist_t *fopt)
fopt = cur->link;
free(cur);
f = bb_xfopen(ffile, "r");
while ((line = bb_get_chomped_line_from_file(f)) != NULL) {
pattern_head = llist_add_to(pattern_head, line);
}
while ((line = bb_get_chomped_line_from_file(f)) != NULL) {
pattern_head = llist_add_to(pattern_head, line);
}
}
}
@@ -261,7 +261,7 @@ extern int grep_main(int argc, char **argv)
FILE *file;
int matched;
unsigned long opt;
llist_t *fopt;
llist_t *fopt = NULL;
/* do normal option parsing */
#ifdef CONFIG_FEATURE_GREP_CONTEXT
+1 -1
View File
@@ -341,7 +341,7 @@
APPLET(logger, logger_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
#endif
#ifdef CONFIG_LOGIN
APPLET(login, login_main, _BB_DIR_BIN, _BB_SUID_NEVER)
APPLET(login, login_main, _BB_DIR_BIN, _BB_SUID_ALWAYS)
#endif
#ifdef CONFIG_LOGNAME
APPLET(logname, logname_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
+4 -4
View File
@@ -134,7 +134,7 @@ extern void write_mtab(char* blockDevice, char* directory,
char* filesystemType, long flags, char* string_flags);
extern void erase_mtab(const char * name);
extern long *find_pid_by_name( const char* pidName);
extern char *find_real_root_device_name(const char* name);
extern char *find_real_root_device_name(void);
extern char *bb_get_line_from_file(FILE *file);
extern char *bb_get_chomped_line_from_file(FILE *file);
extern int bb_copyfd_size(int fd1, int fd2, const off_t size);
@@ -230,9 +230,9 @@ extern unsigned long bb_xparse_number(const char *numstr,
* increases target size and is often not needed embedded systems. */
extern long my_getpwnam(const char *name);
extern long my_getgrnam(const char *name);
extern char * my_getpwuid(char *name, long uid);
extern char * my_getgrgid(char *group, long gid);
extern long my_getpwnamegid(const char *name);
extern char * my_getug(char *buffer, char *idname, long id, int bufsize, char prefix);
extern char * my_getpwuid(char *name, long uid, int bufsize);
extern char * my_getgrgid(char *group, long gid, int bufsize);
extern char *bb_askpass(int timeout, const char * prompt);
extern int device_open(const char *device, int mode);
+61 -40
View File
@@ -4,14 +4,14 @@
#define addgroup_trivial_usage \
"[-g GID] group_name [user_name]"
#define addgroup_full_usage \
"Adds a group to the system" \
"Adds a group to the system\n\n" \
"Options:\n" \
"\t-g GID\t\tspecify gid"
#define adduser_trivial_usage \
"[OPTIONS] user_name"
#define adduser_full_usage \
"Adds a user to the system" \
"Adds a user to the system\n\n" \
"Options:\n" \
"\t-h DIR\t\tAssign home directory DIR\n" \
"\t-g GECOS\tAssign gecos field GECOS\n" \
@@ -219,6 +219,7 @@
"\ti\t\textract\n" \
"\tm\t\tpreserve mtime\n" \
"\tt\t\tlist\n" \
"\tv\t\tverbose\n" \
"\tu\t\tunconditional overwrite\n" \
"\tF\t\tinput from file"
@@ -281,6 +282,7 @@
"\t\t\t`hours', `minutes', or `seconds' for date and,\n" \
"\t\t\ttime to the indicated precision.\n") \
"\t-s\t\tSets time described by STRING\n" \
"\t-r FILE\t\tDisplays the last modification time of FILE\n" \
"\t-u\t\tPrints or sets Coordinated Universal Time"
#define date_example_usage \
"$ date\n" \
@@ -299,15 +301,15 @@
"o - Pops the value off the top of the stack and uses it to set the output radix.\n" \
" Only 10 and 16 are supported."
#define dc_example_usage \
"$ dc 2 2 +\n" \
"$ dc 2 2 + p\n" \
"4\n" \
"$ dc 8 8 * 2 2 + /\n" \
"$ dc 8 8 \\* 2 2 + / p\n" \
"16\n" \
"$ dc 0 1 and\n" \
"$ dc 0 1 and p\n" \
"0\n" \
"$ dc 0 1 or\n" \
"$ dc 0 1 or p\n" \
"1\n" \
"$ echo 72 9 div 8 mul | dc\n" \
"$ echo 72 9 div 8 mul p | dc\n" \
"64\n"
#define dd_trivial_usage \
@@ -423,15 +425,17 @@
"\t-d\toutput will be in DOS format"
#define dpkg_trivial_usage \
"[-iCPru] package_name"
"[-ilCPru] [-F option] package_name"
#define dpkg_full_usage \
"dpkg is a utility to install, remove and manage Debian packages.\n\n" \
"Options:\n" \
"\t-i\tInstall the package\n" \
"\t-C\tConfigure an unpackaged package\n" \
"\t-P\tPurge all files of a package\n" \
"\t-r\tRemove all but the configuration files for a package\n" \
"\t-u\tUnpack a package, but don't configure it"
"\t-i\t\tInstall the package\n" \
"\t-l\t\tList of installed packages\n" \
"\t-C\t\tConfigure an unpackaged package\n" \
"\t-F depends\tIgnore depency problems\n" \
"\t-P\t\tPurge all files of a package\n" \
"\t-r\t\tRemove all but the configuration files for a package\n" \
"\t-u\t\tUnpack a package, but don't configure it"
#define dpkg_deb_trivial_usage \
"[-cefxX] FILE [argument]"
@@ -606,7 +610,7 @@
"\t-n\tDon't verify after format"
#define fdisk_trivial_usage \
"[-l] [-v] [-b SSZ] [-u] DISK"
"[-luv] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SSZ] DISK"
#define fdisk_full_usage \
"Change partition table\n" \
"Options:\n" \
@@ -614,6 +618,9 @@
"\t-u Give Start and End in sector (instead of cylinder) units\n" \
"\t-s PARTITION Give partition size(s) in blocks\n" \
"\t-b 2048: (for certain MO disks) use 2048-byte sectors\n" \
"\t-C CYLINDERS Set the number of cylinders\n" \
"\t-H HEADS Set the number of heads\n" \
"\t-S SECTORS Set the number of sectors\n" \
"\t-v Give fdisk version"
#ifdef CONFIG_FEATURE_FIND_TYPE
@@ -739,7 +746,7 @@
"\t-Q, --quiet-output No normal output\n" \
"\t-s, --shell=shell Set shell quoting conventions\n" \
"\t-T, --test Test for getopt(1) version\n" \
"\t-u, --unqote Do not quote the output"
"\t-u, --unquoted Do not quote the output"
#define getopt_example_usage \
"$ cat getopt.test\n" \
"#!/bin/sh\n" \
@@ -804,6 +811,7 @@
"Uncompress FILE (or standard input if FILE is '-').\n\n" \
"Options:\n" \
"\t-c\tWrite output to standard output\n" \
"\t-f\tForce read when source is a terminal\n" \
"\t-t\tTest compressed file integrity"
#define gunzip_example_usage \
"$ ls -la /tmp/BusyBox*\n" \
@@ -819,7 +827,8 @@
"When FILE is '-' or unspecified, reads standard input. Implies -c.\n\n" \
"Options:\n" \
"\t-c\tWrite output to standard output instead of FILE.gz\n" \
"\t-d\tdecompress"
"\t-d\tDecompress\n" \
"\t-f\tForce write when destination is a terminal"
#define gzip_example_usage \
"$ ls -la /tmp/busybox*\n" \
"-rw-rw-r-- 1 andersen andersen 1761280 Apr 14 17:47 /tmp/busybox.tar\n" \
@@ -1271,6 +1280,7 @@
"\t-f\tForce module to load into the wrong kernel version.\n" \
"\t-k\tMake module autoclean-able.\n" \
"\t-v\tverbose output\n" \
"\t-q\tquiet output\n" \
"\t-L\tLock to prevent simultaneous loads of a module\n" \
USAGE_INSMOD_MAP("\t-m\tOutput load map to stdout\n") \
"\t-o NAME\tSet internal module name to NAME\n" \
@@ -1282,6 +1292,7 @@
"Copies files and set attributes\n\n" \
"Options:\n" \
"\t-c\tcopy the file, default\n" \
"\t-d\tcreate directories\n" \
"\t-g\tset group ownership\n" \
"\t-m\tset permission modes\n" \
"\t-o\tset ownership\n" \
@@ -1371,11 +1382,12 @@
"$ kill 252\n"
#define killall_trivial_usage \
"[-signal] process-name [process-name ...]"
"[-q] [-signal] process-name [process-name ...]"
#define killall_full_usage \
"Send a signal (default is SIGTERM) to the specified process(es).\n\n"\
"Options:\n" \
"\t-l\tList all signal names and numbers."
"\t-l\tList all signal names and numbers.\n"\
"\t-q\tDo not complain if no processes were killed."
#define killall_example_usage \
"$ killall apache\n"
@@ -1651,10 +1663,13 @@
"\tblock-count\tNumber of block to use (default is entire partition)."
#define mktemp_trivial_usage \
"[-q] TEMPLATE"
"[-dq] TEMPLATE"
#define mktemp_full_usage \
"Creates a temporary file with its name based on TEMPLATE.\n" \
"TEMPLATE is any name with six `Xs' (i.e., /tmp/temp.XXXXXX)."
"TEMPLATE is any name with six `Xs' (i.e., /tmp/temp.XXXXXX).\n\n" \
"Options:\n" \
"\t-d\t\tMake a directory instead of a file\n" \
"\t-q\t\tFail silently if an error occurs"
#define mktemp_example_usage \
"$ mktemp /tmp/temp.XXXXXX\n" \
"/tmp/temp.mWiLjM\n" \
@@ -1662,9 +1677,16 @@
"-rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM\n"
#define modprobe_trivial_usage \
"[FILE ...]"
"[-knqrsv] [MODULE ...]"
#define modprobe_full_usage \
"Used for high level module loading and unloading."
"Used for high level module loading and unloading.\n\n" \
"Options:\n" \
"\t-k\tMake module autoclean-able.\n" \
"\t-n\tJust show what would be done.\n" \
"\t-q\tQuiet output.\n" \
"\t-r\tRemove module (stacks) or do autoclean.\n" \
"\t-s\tReport via syslog instead of stderr.\n" \
"\t-v\tVerbose output."
#define modprobe_example_usage \
"$ modprobe cdrom\n"
@@ -1734,10 +1756,13 @@
"setpart tell unload unlock weof wset"
#define mv_trivial_usage \
"SOURCE DEST\n" \
"or: mv SOURCE... DIRECTORY"
"[OPTION]... SOURCE DEST\n" \
"or: mv [OPTION]... SOURCE... DIRECTORY"
#define mv_full_usage \
"Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY."
"Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.\n\n" \
"Options:\n" \
"\t-f\tdon't prompt before overwriting\n" \
"\t-i\tinteractive, prompt before overwrite"
#define mv_example_usage \
"$ mv /tmp/foo /bin/bar\n"
@@ -1952,12 +1977,6 @@
"$ pwd\n" \
"/root\n"
#define raid_start_trivial_usage \
"MD_DEVICE DISK_DEVICE"
#define raid_start_full_usage \
"Start MD_DEVICE, taking superblock from DISK_DEVICE.\n" \
"Example: raid_start /dev/md0 /dev/sdb"
#define rdate_trivial_usage \
"[-sp] HOST"
#define rdate_full_usage \
@@ -2290,17 +2309,16 @@
"sysctl - configure kernel parameters at runtime\n\n" \
"Options:\n" \
"\t-n\tUse this option to disable printing of the key name when printing values.\n" \
"\t-e\tUse this option to ignore errors about unknown keys.\n" \
"\t-w\tUse this option when you want to change a sysctl setting.\n" \
"\t-p\tLoad in sysctl settings from the file specified or /etc/sysctl.conf if none given.\n" \
"\t-a\tDisplay all values currently available.\n" \
"\t-A\tDisplay all values currently available in table form."
#define sysctl_example_usage
"sysctl [-n] [-e] variable ...\n" \
"sysctl [-n] [-e] -w variable=value ...\n" \
"sysctl [-n] [-e] -a\n" \
"sysctl [-n] [-e] -p <file>\t(default /etc/sysctl.conf)\n" \
"sysctl [-n] [-e] -A\n"
"sysctl [-n] variable ...\n" \
"sysctl [-n] -w variable=value ...\n" \
"sysctl [-n] -a\n" \
"sysctl [-n] -p <file>\t(default /etc/sysctl.conf)\n" \
"sysctl [-n] -A\n"
#endif
#define syslogd_trivial_usage \
@@ -2311,7 +2329,8 @@
"Options:\n" \
"\t-m MIN\t\tMinutes between MARK lines (default=20, 0=off)\n" \
"\t-n\t\tRun as a foreground process\n" \
"\t-O FILE\t\tUse an alternate log file (default=/var/log/messages)" \
"\t-O FILE\t\tUse an alternate log file (default=/var/log/messages)\n" \
"\t-S\t\tMake logging output smaller." \
USAGE_ROTATE_LOGFILE( \
"\n\t-s SIZE\t\tMax size (KB) before rotate (default=200KB, 0=off)\n" \
"\t-b NUM\t\tNumber of rotated logs to keep (default=1, max=99, 0=purge)") \
@@ -2442,7 +2461,8 @@
#define telnetd_full_usage \
"Telnetd uses incoming TELNET connections via inetd.\n"\
"Options:\n" \
"\t-l LOGIN\texec LOGIN on connect (default /bin/sh)"
"\t-l LOGIN\texec LOGIN on connect (default /bin/sh)\n" \
"\t-f issue_file\tDisplay issue_file instead of /etc/issue."
#else
#define telnetd_trivial_usage \
"[OPTION]"
@@ -2450,7 +2470,8 @@
"Telnetd listens for incoming TELNET connections on PORT.\n"\
"Options:\n" \
"\t-p PORT\tlisten for connections on PORT (default 23)\n"\
"\t-l LOGIN\texec LOGIN on connect (default /bin/sh)"
"\t-l LOGIN\texec LOGIN on connect (default /bin/sh)\n"\
"\t-f issue_file\tDisplay issue_file instead of /etc/issue."
#endif
#define test_trivial_usage \
+7 -5
View File
@@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/init
INIT_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include Makefile.in
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include $(srcdir)/Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)
+5 -1
View File
@@ -19,8 +19,9 @@
INIT_AR:=init.a
ifndef $(INIT_DIR)
INIT_DIR:=$(TOPDIR)init/
INIT_DIR:=$(top_builddir)/init/
endif
srcdir=$(top_srcdir)/init
INIT-y:=
INIT-$(CONFIG_HALT) += halt.o
@@ -56,3 +57,6 @@ libraries-y+=$(INIT_DIR)$(INIT_AR)
$(INIT_DIR)$(INIT_AR): $(patsubst %,$(INIT_DIR)%, $(INIT-y))
$(AR) -ro $@ $(patsubst %,$(INIT_DIR)%, $(INIT-y))
$(INIT_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+38 -13
View File
@@ -53,10 +53,6 @@
#endif
#if defined(__UCLIBC__) && !defined(__ARCH_HAS_MMU__)
#define fork vfork
#endif
#define INIT_BUFFS_SIZE 256
/* From <linux/vt.h> */
@@ -580,6 +576,7 @@ static pid_t run(const struct init_action *a)
}
}
#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
if (a->action & ASKFIRST) {
char c;
/*
@@ -597,6 +594,7 @@ static pid_t run(const struct init_action *a)
while(read(0, &c, 1) == 1 && c != '\n')
;
}
#endif
/* Log the process name and args */
message(LOG, "Starting pid %d, console %s: '%s'",
@@ -848,7 +846,7 @@ static void cont_handler(int sig)
static void new_init_action(int action, const char *command, const char *cons)
{
struct init_action *new_action, *a;
struct init_action *new_action, *a, *last;
if (*cons == '\0')
cons = console;
@@ -866,16 +864,19 @@ static void new_init_action(int action, const char *command, const char *cons)
}
/* Append to the end of the list */
for (a = init_action_list; a && a->next; a = a->next) {
/* don't enter action if it's already in the list */
for (a = last = init_action_list; a; a = a->next) {
/* don't enter action if it's already in the list,
* but do overwrite existing actions */
if ((strcmp(a->command, command) == 0) &&
(strcmp(a->terminal, cons) ==0)) {
a->action = action;
free(new_action);
return;
}
last = a;
}
if (a) {
a->next = new_action;
if (last) {
last->next = new_action;
} else {
init_action_list = new_action;
}
@@ -1048,14 +1049,33 @@ static void parse_inittab(void)
#endif /* CONFIG_FEATURE_USE_INITTAB */
}
#ifdef CONFIG_FEATURE_USE_INITTAB
static void reload_signal(int sig)
{
message(LOG, "Reloading /etc/inittab");
parse_inittab();
struct init_action *a, *tmp;
message(LOG, "Reloading /etc/inittab");
/* disable old entrys */
for (a = init_action_list; a; a = a->next ) {
a->action = ONCE;
}
parse_inittab();
/* remove unused entrys */
for (a = init_action_list; a; a = tmp) {
tmp = a->next;
if (a->action & (ONCE | SYSINIT | WAIT ) &&
a->pid == 0 ) {
delete_init_action(a);
}
}
run_actions(RESPAWN);
return;
return;
}
#endif /* CONFIG_FEATURE_USE_INITTAB */
extern int init_main(int argc, char **argv)
{
struct init_action *a;
@@ -1146,8 +1166,13 @@ extern int init_main(int argc, char **argv)
/* Next run anything to be run only once */
run_actions(ONCE);
#ifdef CONFIG_FEATURE_USE_INITTAB
/* Redefine SIGHUP to reread /etc/inittab */
signal(SIGHUP, reload_signal);
#else
signal(SIGHUP, SIG_IGN);
#endif /* CONFIG_FEATURE_USE_INITTAB */
/* Now run the looping stuff for the rest of forever */
while (1) {
+1 -1
View File
@@ -32,7 +32,7 @@ extern int mesg_main(int argc, char *argv[])
{
struct stat sb;
char *tty;
char c;
char c = 0;
if ((--argc == 0)
|| ((argc == 1) && (((c = **++argv) == 'y') || (c == 'n')))) {
+6 -4
View File
@@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/libbb
LIBBB_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)
+11 -9
View File
@@ -16,12 +16,11 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
LIBBB_AR:=libbb.a
ifndef $(LIBBB_DIR)
LIBBB_DIR:=$(TOPDIR)libbb/
LIBBB_DIR:=$(top_builddir)/libbb/
endif
srcdir=$(top_srcdir)/libbb
LIBBB_SRC:= \
bb_asprintf.c ask_confirmation.c change_identity.c chomp.c \
@@ -34,7 +33,7 @@ LIBBB_SRC:= \
human_readable.c inet_common.c inode_hash.c interface.c isdirectory.c \
kernel_version.c last_char_is.c llist_add_to.c login.c loop.c \
make_directory.c mode_string.c module_syscalls.c mtab.c mtab_file.c \
my_getgrgid.c my_getgrnam.c my_getpwnam.c my_getpwnamegid.c \
my_getgrgid.c my_getgrnam.c my_getpwnam.c my_getug.c\
my_getpwuid.c obscure.c parse_mode.c parse_number.c perror_msg.c \
perror_msg_and_die.c print_file.c get_console.c \
process_escape_sequence.c procps.c pwd2spwd.c pw_encrypt.c qmodule.c \
@@ -51,7 +50,7 @@ LIBBB_SRC:= \
LIBBB_OBJS=$(patsubst %.c,$(LIBBB_DIR)%.o, $(LIBBB_SRC))
LIBBB_MSRC0:=$(LIBBB_DIR)messages.c
LIBBB_MSRC0:=$(srcdir)/messages.c
LIBBB_MOBJ0:=full_version.o \
memory_exhausted.o invalid_date.o io_error.o \
write_error.o name_longer_than_foo.o unknown.o \
@@ -60,19 +59,19 @@ LIBBB_MOBJ0:=full_version.o \
securetty_file.o motd_file.o \
msg_standard_input.o msg_standard_output.o shell_file.o
LIBBB_MSRC1:=$(LIBBB_DIR)xfuncs.c
LIBBB_MSRC1:=$(srcdir)/xfuncs.c
LIBBB_MOBJ1:=xmalloc.o xrealloc.o xcalloc.o xstrdup.o xstrndup.o \
xfopen.o xopen.o xread.o xread_all.o xread_char.o \
xferror.o xferror_stdout.o xfflush_stdout.o strlen.o
LIBBB_MSRC2:=$(LIBBB_DIR)printf.c
LIBBB_MSRC2:=$(srcdir)/printf.c
LIBBB_MOBJ2:=bb_vfprintf.o bb_vprintf.o bb_fprintf.o bb_printf.o
LIBBB_MSRC3:=$(LIBBB_DIR)xgetularg.c
LIBBB_MSRC3:=$(srcdir)/xgetularg.c
LIBBB_MOBJ3:=xgetularg_bnd_sfx.o xgetlarg_bnd_sfx.o getlarg10_sfx.o \
xgetularg_bnd.o xgetularg10_bnd.o xgetularg10.o
LIBBB_MSRC4:=$(LIBBB_DIR)/safe_strtol.c
LIBBB_MSRC4:=$(srcdir)/safe_strtol.c
LIBBB_MOBJ4:=safe_strtoi.o safe_strtod.o safe_strtol.o safe_strtoul.o
LIBBB_MOBJS0=$(patsubst %,$(LIBBB_DIR)%, $(LIBBB_MOBJ0))
@@ -88,6 +87,9 @@ $(LIBBB_DIR)$(LIBBB_AR): $(LIBBB_OBJS) $(LIBBB_MOBJS0) $(LIBBB_MOBJS1) \
$(AR) -ro $@ $(LIBBB_OBJS) $(LIBBB_MOBJS0) $(LIBBB_MOBJS1) \
$(LIBBB_MOBJS2) $(LIBBB_MOBJS3) $(LIBBB_MOBJS4)
$(LIBBB_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
$(LIBBB_MOBJS0): $(LIBBB_MSRC0)
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DL_$(notdir $*) -c $< -o $@
-1
View File
@@ -69,7 +69,6 @@ int correct_password ( const struct passwd *pw )
unencrypted = bb_askpass ( 0, "Password: " );
if ( !unencrypted )
{
fputs ( "cannot open /dev/tty\n", stderr );
return 0;
}
encrypted = crypt ( unencrypted, correct );
+6 -2
View File
@@ -27,7 +27,7 @@
extern char *find_real_root_device_name(const char* name)
extern char *find_real_root_device_name(void)
{
DIR *dir;
struct dirent *entry;
@@ -54,7 +54,11 @@ extern char *find_real_root_device_name(const char* name)
* would get a false positive on ".." */
if (myname[0] == '.' && myname[1] == '.' && !myname[2])
continue;
#ifdef CONFIG_FEATURE_DEVFS
/* if there is a link named /dev/root skip that too */
if (strcmp(myname, "root")==0)
continue;
#endif
fileName = concat_path_file("/dev", myname);
/* Some char devices have the same dev_t as block
+29 -24
View File
@@ -15,7 +15,7 @@
* that either displays or sets the characteristics of
* one or more of the system's networking interfaces.
*
* Version: $Id: interface.c,v 1.23 2004/07/23 01:49:46 bug1 Exp $
* Version: $Id: interface.c,v 1.25 2004/08/26 21:45:21 andersen Exp $
*
* Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
* and others. Copyright 1993 MicroWalt Corporation
@@ -986,32 +986,37 @@ static int if_readconf(void)
return err;
}
static char *get_name(char *name, char *p)
char *get_name(char *name, char *p)
{
while (isspace(*p))
p++;
while (*p) {
if (isspace(*p))
break;
if (*p == ':') { /* could be an alias */
char *dot = p, *dotname = name;
*name++ = *p++;
while (isdigit(*p))
*name++ = *p++;
if (*p != ':') { /* it wasn't, backup */
p = dot;
name = dotname;
}
if (*p == '\0')
return NULL;
p++;
break;
/* Extract <name>[:<alias>] from nul-terminated p where p matches
<name>[:<alias>]: after leading whitespace.
If match is not made, set name empty and return unchanged p */
int namestart=0, nameend=0, aliasend;
while (isspace(p[namestart]))
namestart++;
nameend=namestart;
while (p[nameend] && p[nameend]!=':' && !isspace(p[nameend]))
nameend++;
if (p[nameend]==':') {
aliasend=nameend+1;
while (p[aliasend] && isdigit(p[aliasend]))
aliasend++;
if (p[aliasend]==':') {
nameend=aliasend;
}
*name++ = *p++;
if ((nameend-namestart)<IFNAMSIZ) {
memcpy(name,&p[namestart],nameend-namestart);
name[nameend-namestart]='\0';
p=&p[nameend];
} else {
/* Interface name too large */
name[0]='\0';
}
} else {
/* first ':' not found - return empty */
name[0]='\0';
}
*name++ = '\0';
return p;
return p + 1;
}
/* If scanf supports size qualifiers for %n conversions, then we can
+2 -2
View File
@@ -32,9 +32,9 @@
#include <linux/version.h>
#include <asm/posix_types.h>
#if LINUX_VERSION_CODE >= 132608
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#define __bb_kernel_dev_t __kernel_old_dev_t
#elif LINUX_VERSION_CODE >= 0x20600
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
#define __bb_kernel_dev_t __kernel_dev_t
#else
#define __bb_kernel_dev_t unsigned short
+13 -2
View File
@@ -37,6 +37,7 @@
#include <errno.h>
#include <unistd.h>
#include <sys/stat.h>
#include "libbb.h"
int bb_make_directory (char *path, long mode, int flags)
@@ -45,9 +46,17 @@ int bb_make_directory (char *path, long mode, int flags)
const char *fail_msg;
char *s = path;
char c;
struct stat st;
mask = umask(0);
umask(mask & ~0300);
if (mode == -1) {
umask(mask);
mode = (S_IXUSR | S_IXGRP | S_IXOTH |
S_IWUSR | S_IWGRP | S_IWOTH |
S_IRUSR | S_IRGRP | S_IROTH) & ~mask;
} else {
umask(mask & ~0300);
}
do {
c = 0;
@@ -70,7 +79,9 @@ int bb_make_directory (char *path, long mode, int flags)
if (mkdir(path, 0777) < 0) {
/* If we failed for any other reason than the directory
* already exists, output a diagnostic and return -1.*/
if (errno != EEXIST) {
if (errno != EEXIST
|| !(flags & FILEUTILS_RECUR)
|| (stat(path, &st) < 0 || !S_ISDIR(st.st_mode))) {
fail_msg = "create";
umask(mask);
break;
+4 -2
View File
@@ -27,11 +27,12 @@
#include <mntent.h>
#include "libbb.h"
#define MTAB_MAX_ENTRIES 40
static const int MS_RDONLY = 1; /* Mount read-only. */
void erase_mtab(const char *name)
{
struct mntent entries[20];
struct mntent entries[MTAB_MAX_ENTRIES];
int count = 0;
FILE *mountTable = setmntent(bb_path_mtab_file, "r");
struct mntent *m;
@@ -44,7 +45,8 @@ void erase_mtab(const char *name)
return;
}
while ((m = getmntent(mountTable)) != 0) {
while (((m = getmntent(mountTable)) != 0) && (count < MTAB_MAX_ENTRIES))
{
entries[count].mnt_fsname = strdup(m->mnt_fsname);
entries[count].mnt_dir = strdup(m->mnt_dir);
entries[count].mnt_type = strdup(m->mnt_type);
+19 -13
View File
@@ -19,25 +19,31 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <string.h>
/* Hacked by Tito Ragusa (c) 2004 <farmatito@tiscali.it> to make it more
* flexible :
*
* if bufsize is > 0 char *group cannot be set to NULL.
* On success groupname is written on static allocated buffer group
* (and a pointer to it is returned).
* On failure gid as string is written to static allocated buffer
* group and NULL is returned.
* if bufsize is = 0 char *group can be set to NULL.
* On success groupname is returned.
* On failure NULL is returned.
* if bufsize is < 0 char *group can be set to NULL.
* On success groupname is returned.
* On failure an error message is printed and the program exits.
*/
#include "libbb.h"
#include "pwd_.h"
#include "grp_.h"
/* gets a groupname given a gid */
char * my_getgrgid(char *group, long gid)
char * my_getgrgid(char *group, long gid, int bufsize)
{
struct group *mygroup;
struct group *mygroup = getgrgid(gid);
mygroup = getgrgid(gid);
if (mygroup==NULL) {
sprintf(group, "%ld", gid);
return NULL;
} else {
return strcpy(group, mygroup->gr_name);
}
return my_getug(group, (mygroup) ? mygroup->gr_name : (char *)mygroup, gid, bufsize, 'g');
}
-55
View File
@@ -1,55 +0,0 @@
/* vi: set sw=4 ts=4: */
/*
* Utility routines.
*
* Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <string.h>
#include "libbb.h"
#include "pwd_.h"
#include "grp_.h"
/* gets a gid given a user name */
long my_getpwnamegid(const char *name)
{
struct group *mygroup;
struct passwd *myuser;
myuser=getpwnam(name);
if (myuser==NULL)
bb_error_msg_and_die("unknown user name: %s", name);
mygroup = getgrgid(myuser->pw_gid);
if (mygroup==NULL)
bb_error_msg_and_die("unknown gid %ld", (long)myuser->pw_gid);
return mygroup->gr_gid;
}
/* END CODE */
/*
Local Variables:
c-file-style: "linux"
c-basic-offset: 4
tab-width: 4
End:
*/
+19 -14
View File
@@ -19,26 +19,31 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <string.h>
/* Hacked by Tito Ragusa (c) 2004 <farmatito@tiscali.it> to make it more
* flexible :
*
* if bufsize is > 0 char *name can not be set to NULL.
* On success username is written on the static allocated buffer name
* (and a pointer to it is returned).
* On failure uid as string is written to the static allocated buffer name
* and NULL is returned.
* if bufsize is = 0 char *name can be set to NULL.
* On success username is returned.
* On failure NULL is returned.
* if bufsize is < 0 char *name can be set to NULL
* On success username is returned.
* On failure an error message is printed and the program exits.
*/
#include "libbb.h"
#include "pwd_.h"
#include "grp_.h"
/* gets a username given a uid */
char * my_getpwuid(char *name, long uid)
char * my_getpwuid(char *name, long uid, int bufsize)
{
struct passwd *myuser;
struct passwd *myuser = getpwuid(uid);
myuser = getpwuid(uid);
if (myuser==NULL) {
sprintf(name, "%ld", (long)uid);
return NULL;
} else {
return strcpy(name, myuser->pw_name);
}
return my_getug(name, (myuser) ? myuser->pw_name : (char *)myuser , uid, bufsize, 'u');
}
/* END CODE */
+64
View File
@@ -0,0 +1,64 @@
/* vi: set sw=4 ts=4: */
/*
* Utility routines.
*
* Copyright (C) 2004 by Tito Ragusa <farmatito@tiscali.it>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
*
* if bufsize is > 0 char *buffer can not be set to NULL.
* If idname is not NULL it is written on the static allocated buffer
* (and a pointer to it is returned).
* if idname is NULL, id as string is written to the static allocated buffer
* and NULL is returned.
* if bufsize is = 0 char *buffer can be set to NULL.
* If idname exists a pointer to it is returned,
* else NULL is returned.
* if bufsize is < 0 char *buffer can be set to NULL.
* If idname exists a pointer to it is returned,
* else an error message is printed and the program exits.
*/
#include <stdio.h>
#include <assert.h>
#include "libbb.h"
/* internal function for my_getpwuid and my_getgrgid */
char * my_getug(char *buffer, char *idname, long id, int bufsize, char prefix)
{
if(bufsize > 0 ) {
assert(buffer!=NULL);
if(idname) {
return safe_strncpy(buffer, idname, bufsize);
}
snprintf(buffer, bufsize, "%ld", id);
} else if(bufsize < 0 && !idname) {
bb_error_msg_and_die("unknown %cid %ld", prefix, id);
}
return idname;
}
/* END CODE */
/*
Local Variables:
c-file-style: "linux"
c-basic-offset: 4
tab-width: 4
End:
*/
+43 -19
View File
@@ -22,46 +22,69 @@
*
*/
#include <string.h>
#include <stdio.h>
#include <limits.h>
#include <ctype.h>
#include "libbb.h"
#define isodigit(c) ((c) >= '0' && (c) <= '7')
#define hextobin(c) ((c)>='a'&&(c)<='f' ? (c)-'a'+10 : (c)>='A'&&(c)<='F' ? (c)-'A'+10 : (c)-'0')
#define octtobin(c) ((c) - '0')
#define WANT_HEX_ESCAPES 1
/* Usual "this only works for ascii compatible encodings" disclaimer. */
#undef _tolower
#define _tolower(X) ((X)|((char) 0x20))
char bb_process_escape_sequence(const char **ptr)
{
const char *p, *q;
unsigned int num_digits, r, n, hexescape;
static const char charmap[] = {
'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', 0,
'\a', '\b', '\f', '\n', '\r', '\t', '\v', '\\', '\\' };
n = r = hexescape = num_digits = 0;
const char *p;
const char *q;
unsigned int num_digits;
unsigned int r;
unsigned int n;
unsigned int d;
unsigned int base;
num_digits = n = 0;
base = 8;
q = *ptr;
#ifdef WANT_HEX_ESCAPES
if (*q == 'x') {
hexescape++;
++q;
base = 16;
++num_digits;
}
#endif
do {
if (hexescape && isxdigit(*q)) {
r = n * 16 + hextobin(*q);
} else if (isodigit(*q)) {
r = n * 8 + octtobin(*q);
d = (unsigned int)(*q - '0');
#ifdef WANT_HEX_ESCAPES
if (d >= 10) {
d = ((unsigned int)(_tolower(*q) - 'a')) + 10;
}
if (r <= UCHAR_MAX) {
n = r;
++q;
if (++num_digits < 3) {
continue;
#endif
if (d >= base) {
#ifdef WANT_HEX_ESCAPES
if ((base == 16) && (!--num_digits)) {
/* return '\\'; */
--q;
}
#endif
break;
}
break;
} while (1);
r = n * base + d;
if (r > UCHAR_MAX) {
break;
}
n = r;
++q;
} while (++num_digits < 3);
if (num_digits == 0) { /* mnemonic escape sequence? */
p = charmap;
@@ -75,6 +98,7 @@ char bb_process_escape_sequence(const char **ptr)
}
*ptr = q;
return (char) n;
}
+1 -1
View File
@@ -57,7 +57,7 @@ extern procps_status_t * procps_scan(int save_user_arg0
sprintf(status, "/proc/%d", pid);
if(stat(status, &sb))
continue;
my_getpwuid(curstatus.user, sb.st_uid);
my_getpwuid(curstatus.user, sb.st_uid, sizeof(curstatus.user));
sprintf(status, "/proc/%d/stat", pid);
if((fp = fopen(status, "r")) == NULL)
+3 -2
View File
@@ -24,8 +24,9 @@ extern char *xreadlink(const char *path)
buf = xrealloc(buf, bufsize += GROWBY);
readsize = readlink(path, buf, bufsize); /* 1st try */
if (readsize == -1) {
bb_perror_msg("%s", path);
return NULL;
bb_perror_msg("%s", path);
free(buf);
return NULL;
}
}
while (bufsize < readsize + 1);
+6 -4
View File
@@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/libpwgrp
LIBPWDGRP_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)
+4 -3
View File
@@ -19,11 +19,12 @@
LIBPWDGRP_AR:=libpwdgrp.a
ifndef $(LIBPWDGRP_DIR)
LIBPWDGRP_DIR:=$(TOPDIR)libpwdgrp/
LIBPWDGRP_DIR:=$(top_builddir)/libpwdgrp/
endif
srcdir=$(top_srcdir)/libpwdgrp
LIBPWDGRP_MSRC0:=$(LIBPWDGRP_DIR)pwd_grp.c
LIBPWDGRP_MSRC0:=$(srcdir)/pwd_grp.c
LIBPWDGRP_MOBJ0-$(CONFIG_USE_BB_PWD_GRP):= fgetpwent_r.o fgetgrent_r.o \
fgetpwent.o fgetgrent.o getpwnam_r.o getgrnam_r.o getpwuid_r.o \
getgrgid_r.o getpwuid.o getgrgid.o getpwnam.o getgrnam.o getpw.o \
@@ -31,7 +32,7 @@ LIBPWDGRP_MOBJ0-$(CONFIG_USE_BB_PWD_GRP):= fgetpwent_r.o fgetgrent_r.o \
initgroups.o putpwent.o putgrent.o
LIBPWDGRP_MOBJS0=$(patsubst %,$(LIBPWDGRP_DIR)%, $(LIBPWDGRP_MOBJ0-y))
LIBPWDGRP_MSRC1:=$(LIBPWDGRP_DIR)pwd_grp.c
LIBPWDGRP_MSRC1:=$(srcdir)/pwd_grp.c
LIBPWDGRP_MOBJ1-$(CONFIG_USE_BB_PWD_GRP):= __parsepwent.o __parsegrent.o \
__pgsreader.o fgetspent_r.o fgetspent.o sgetspent_r.o getspnam_r.o \
getspnam.o getspent_r.o getspent.o sgetspent.o \
+25
View File
@@ -57,12 +57,25 @@ config CONFIG_GETTY
help
getty lets you log in on a tty, it is normally invoked by init.
config CONFIG_FEATURE_U_W_TMP
bool " Support utmp and wtmp files"
depends on CONFIG_GETTY || CONFIG_LOGIN || CONFIG_SU || CONFIG_WHO || CONFIG_LAST
default n
help
The files /var/run/utmp and /var/run/wtmp can be used to track when
user's have logged into and logged out of the system, allowing programs
such as 'who' and 'last' to list who is currently logged in.
config CONFIG_LOGIN
bool "login"
default n
select CONFIG_FEATURE_SUID
help
login is used when signing onto a system.
Note that Busybox binary must be setuid root for this applet to
work properly.
config CONFIG_FEATURE_SECURETTY
bool " Support for /etc/securetty"
default y
@@ -75,19 +88,27 @@ config CONFIG_FEATURE_SECURETTY
config CONFIG_PASSWD
bool "passwd"
default n
select CONFIG_FEATURE_SUID
help
passwd changes passwords for user and group accounts. A normal user
may only change the password for his/her own account, the super user
may change the password for any account. The administrator of a group
may change the password for the group.
Note that Busybox binary must be setuid root for this applet to
work properly.
config CONFIG_SU
bool "su"
default n
select CONFIG_FEATURE_SUID
help
su is used to become another user during a login session.
Invoked without a username, su defaults to becoming the super user.
Note that Busybox binary must be setuid root for this applet to
work properly.
config CONFIG_SULOGIN
bool "sulogin"
default n
@@ -98,9 +119,13 @@ config CONFIG_SULOGIN
config CONFIG_VLOCK
bool "vlock"
default n
select CONFIG_FEATURE_SUID
help
Build the "vlock" applet which allows you to lock (virtual) terminals.
Note that Busybox binary must be setuid root for this applet to
work properly.
comment "Common options for adduser, deluser, login, su"
depends on CONFIG_ADDUSER || CONFIG_DELUSER || CONFIG_LOGIN || CONFIG_SU
+6 -4
View File
@@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/loginutils
LOGINUTILS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)
+5 -1
View File
@@ -19,8 +19,9 @@
LOGINUTILS_AR:=loginutils.a
ifndef LOGINUTILS_DIR
LOGINUTILS_DIR:=$(TOPDIR)loginutils/
LOGINUTILS_DIR:=$(top_builddir)/loginutils/
endif
srcdir=$(top_srcdir)/loginutils
LOGINUTILS-y:=
LOGINUTILS-$(CONFIG_ADDGROUP) += addgroup.o
@@ -51,3 +52,6 @@ endif
$(LOGINUTILS_DIR)$(LOGINUTILS_AR): $(patsubst %,$(LOGINUTILS_DIR)%, $(LOGINUTILS-y))
$(AR) -ro $@ $(patsubst %,$(LOGINUTILS_DIR)%, $(LOGINUTILS-y))
$(LOGINUTILS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+2 -2
View File
@@ -148,7 +148,7 @@ int addgroup_main(int argc, char **argv)
/* get remaining args */
if(bb_getopt_ulflags(argc, argv, "g:", &group)) {
gid = strtol(group, NULL, 10);
gid = bb_xgetlarg(group, 10, 0, LONG_MAX);
}
if (optind < argc) {
@@ -160,10 +160,10 @@ int addgroup_main(int argc, char **argv)
if (optind < argc) {
user = argv[optind];
optind++;
} else {
user = "";
}
if_i_am_not_root();
/* werk */
+4 -9
View File
@@ -238,8 +238,8 @@ void if_i_am_not_root(void)
}
}
#define SETPASS 1
#define MAKEHOME 4
#define SETPASS (1 << 4)
#define MAKEHOME (1 << 6)
/*
* adduser will take a login_name as its first parameter.
@@ -305,13 +305,8 @@ int adduser_main(int argc, char **argv)
if (usegroup) {
/* Add user to a group that already exists */
struct group *g;
g = getgrnam(usegroup);
if (g == NULL)
bb_error_msg_and_die("group %s does not exist", usegroup);
pw.pw_gid = g->gr_gid;
pw.pw_gid = my_getgrnam(usegroup);
/* exits on error */
}
/* grand finale */
+8 -2
View File
@@ -228,7 +228,7 @@ static void termio_final(struct options *op, struct termio *tp,
struct chardata *cp);
static int caps_lock(const char *s);
static int bcode(const char *s);
static int bcode(char *s);
static void error(const char *fmt, ...) __attribute__ ((noreturn));
#ifdef CONFIG_FEATURE_U_W_TMP
@@ -503,6 +503,9 @@ static void update_utmp(char *line)
* utmp file can be opened for update, and if we are able to find our
* entry in the utmp file.
*/
if (access(_PATH_UTMP, R_OK|W_OK) == -1) {
close(creat(_PATH_UTMP, 0664));
}
utmpname(_PATH_UTMP);
setutent();
while ((utp = getutent())
@@ -531,6 +534,9 @@ static void update_utmp(char *line)
endutent();
{
if (access(_PATH_WTMP, R_OK|W_OK) == -1) {
close(creat(_PATH_WTMP, 0664));
}
updwtmp(_PATH_WTMP, &ut);
}
}
@@ -953,7 +959,7 @@ static int caps_lock(const char *s)
}
/* bcode - convert speed string to speed code; return 0 on failure */
static int bcode(const char *s)
static int bcode(char *s)
{
int r;
unsigned long value;
+4 -3
View File
@@ -403,8 +403,6 @@ static void motd ( )
#ifdef CONFIG_FEATURE_U_W_TMP
// vv Taken from tinylogin utmp.c vv
#define _WTMP_FILE "/var/log/wtmp"
#define NO_UTENT \
"No utmp entry. You must exec \"login\" from the lowest level \"sh\""
#define NO_TTY \
@@ -480,6 +478,9 @@ static void setutmp(const char *name, const char *line)
setutent();
pututline(&utent);
endutent();
updwtmp(_WTMP_FILE, &utent);
if (access(_PATH_WTMP, R_OK|W_OK) == -1) {
close(creat(_PATH_WTMP, 0664));
}
updwtmp(_PATH_WTMP, &utent);
}
#endif /* CONFIG_FEATURE_U_W_TMP */
+6 -12
View File
@@ -38,7 +38,6 @@ extern int update_passwd(const struct passwd *pw, char *crypt_pw)
char buffer[80];
char username[32];
char *pw_rest;
int has_shadow = 0;
int mask;
int continued;
FILE *fp;
@@ -46,12 +45,12 @@ extern int update_passwd(const struct passwd *pw, char *crypt_pw)
struct stat sb;
struct flock lock;
#ifdef CONFIG_FEATURE_SHADOWPASSWDS
if (access(bb_path_shadow_file, F_OK) == 0) {
has_shadow = 1;
}
if (has_shadow) {
snprintf(filename, sizeof filename, "%s", bb_path_shadow_file);
} else {
} else
#endif
{
snprintf(filename, sizeof filename, "%s", bb_path_passwd_file);
}
@@ -145,7 +144,6 @@ extern int passwd_main(int argc, char **argv)
int uflg = 0; /* -u - unlock account */
int dflg = 0; /* -d - delete password */
const struct passwd *pw;
unsigned short ruid;
#ifdef CONFIG_FEATURE_SHADOWPASSWDS
const struct spwd *sp;
@@ -170,12 +168,8 @@ extern int passwd_main(int argc, char **argv)
bb_show_usage();
}
}
ruid = getuid();
pw = (struct passwd *) getpwuid(ruid);
if (!pw) {
bb_error_msg_and_die("Cannot determine your user name.");
}
myname = (char *) bb_xstrdup(pw->pw_name);
myname = (char *) bb_xstrdup(my_getpwuid(NULL, getuid(), -1));
/* exits on error */
if (optind < argc) {
name = argv[optind];
} else {
+4
View File
@@ -15,6 +15,7 @@ config CONFIG_ADJTIMEX
config CONFIG_CROND
bool "crond"
default n
select CONFIG_FEATURE_SUID
help
Crond is a background daemon that parses individual crontab
files and executes commands on behalf of the users in question.
@@ -23,6 +24,8 @@ config CONFIG_CROND
$ cat /var/spool/cron/crontabs/root
# Run daily cron jobs at 4:40 every day:
40 4 * * * /etc/cron/daily > /dev/null 2>&1
Note that Busybox binary must be setuid root for this applet to
work properly.
config CONFIG_FEATURE_CROND_CALL_SENDMAIL
bool " Using /usr/sbin/sendmail?"
@@ -83,6 +86,7 @@ config CONFIG_DEVFSD_VERBOSE
config CONFIG_LAST
bool "last"
default n
select CONFIG_FEATURE_U_W_TMP
help
'last' displays a list of the last users that logged into the system.
+6 -4
View File
@@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/miscutils
MISCUTILS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)
+5 -2
View File
@@ -19,9 +19,9 @@
MISCUTILS_AR:=miscutils.a
ifndef $(MISCUTILS_DIR)
MISCUTILS_DIR:=$(TOPDIR)miscutils/
MISCUTILS_DIR:=$(top_builddir)/miscutils/
endif
srcdir=$(top_srcdir)/miscutils
MISCUTILS-y:=
MISCUTILS-$(CONFIG_ADJTIMEX) += adjtimex.o
@@ -50,3 +50,6 @@ endif
$(MISCUTILS_DIR)$(MISCUTILS_AR): $(patsubst %,$(MISCUTILS_DIR)%, $(MISCUTILS-y))
$(AR) -ro $@ $(patsubst %,$(MISCUTILS_DIR)%, $(MISCUTILS-y))
$(MISCUTILS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+1 -1
View File
@@ -1547,7 +1547,7 @@ static int make_dir_tree (const char *path)
#ifdef CONFIG_DEBUG
msg_logger( NO_DIE, LOG_INFO, "make_dir_tree()\n");
#endif
if (bb_make_directory( dirname((char *)path), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH ,FILEUTILS_RECUR )==-1)
if (bb_make_directory( dirname((char *)path), -1, FILEUTILS_RECUR )==-1)
{
#ifdef CONFIG_DEBUG
msg_logger( NO_DIE, LOG_ERR, "make_dir_tree(): %s: %m\n", path);
+3 -3
View File
@@ -27,8 +27,8 @@ int makedevs_main(int argc, char **argv)
basedev = argv[1];
type = argv[2];
Smajor = major(atoi(argv[3]));
Sminor = minor(atoi(argv[4]));
Smajor = atoi(argv[3]);
Sminor = atoi(argv[4]);
S = atoi(argv[5]);
E = atoi(argv[6]);
nodname = argc == 8 ? basedev : buf;
@@ -58,7 +58,7 @@ int makedevs_main(int argc, char **argv)
/* if mode != S_IFCHR and != S_IFBLK third param in mknod() ignored */
if (mknod(nodname, mode, Smajor | Sminor))
if (mknod(nodname, mode, makedev(Smajor, Sminor)))
bb_error_msg("Failed to create: %s", nodname);
if (nodname == basedev) /* ex. /dev/hda - to /dev/hda1 ... */
+6 -4
View File
@@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/modutils
MODUTILS_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)
+5 -1
View File
@@ -19,8 +19,9 @@
MODUTILS_AR:=modutils.a
ifndef $(MODUTILS_DIR)
MODUTILS_DIR:=$(TOPDIR)modutils/
MODUTILS_DIR:=$(top_builddir)/modutils/
endif
srcdir=$(top_srcdir)/modutils
MODUTILS-y:=
MODUTILS-$(CONFIG_INSMOD) += insmod.o
@@ -33,3 +34,6 @@ libraries-y+=$(MODUTILS_DIR)$(MODUTILS_AR)
$(MODUTILS_DIR)$(MODUTILS_AR): $(patsubst %,$(MODUTILS_DIR)%, $(MODUTILS-y))
$(AR) -ro $@ $(patsubst %,$(MODUTILS_DIR)%, $(MODUTILS-y))
$(MODUTILS_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
+90 -72
View File
@@ -2,12 +2,15 @@
/*
* Mini insmod implementation for busybox
*
* This version of insmod supports x86, ARM, SH3/4/5, powerpc, m68k,
* MIPS, v850e, and H8/300.
* This version of insmod supports ARM, CRIS, H8/300, x86, ia64, x86_64,
* m68k, MIPS, PowerPC, S390, SH3/4/5, Sparc, v850e, and x86_64.
*
* Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
* and Ron Alder <alder@lineo.com>
*
* Rodney Radford <rradford@mindspring.com> 17-Aug-2004.
* Added x86_64 support.
*
* Miles Bader <miles@gnu.org> added NEC V850E support.
*
* Modified by Bryan Rittmeyer <bryan@ixiacom.com> to support SH4
@@ -106,60 +109,82 @@ extern int insmod_ng_main( int argc, char **argv);
#endif
/* ARM support */
#if defined(__arm__)
#define CONFIG_USE_PLT_ENTRIES
#define CONFIG_PLT_ENTRY_SIZE 8
#define CONFIG_USE_GOT_ENTRIES
#define CONFIG_GOT_ENTRY_SIZE 8
#define CONFIG_USE_SINGLE
#define MATCH_MACHINE(x) (x == EM_ARM)
#define SHT_RELM SHT_REL
#define Elf32_RelM Elf32_Rel
#define ELFCLASSM ELFCLASS32
#endif
#if defined(__s390__)
#define CONFIG_USE_PLT_ENTRIES
#define CONFIG_PLT_ENTRY_SIZE 8
#define CONFIG_USE_GOT_ENTRIES
#define CONFIG_GOT_ENTRY_SIZE 8
#define CONFIG_USE_SINGLE
#endif
#define MATCH_MACHINE(x) (x == EM_S390)
/* CRIS */
#if defined(__cris__)
#define MATCH_MACHINE(x) (x == EM_CRIS)
#define SHT_RELM SHT_RELA
#define Elf32_RelM Elf32_Rela
#define ELFCLASSM ELFCLASS32
#ifndef EM_CRIS
#define EM_CRIS 76
#define R_CRIS_NONE 0
#define R_CRIS_32 3
#endif
#endif
#if defined(__i386__)
#define CONFIG_USE_GOT_ENTRIES
#define CONFIG_GOT_ENTRY_SIZE 4
/* H8/300 */
#if defined(__H8300H__) || defined(__H8300S__)
#define MATCH_MACHINE(x) (x == EM_H8_300)
#define SHT_RELM SHT_RELA
#define Elf32_RelM Elf32_Rela
#define ELFCLASSM ELFCLASS32
#define CONFIG_USE_SINGLE
#define SYMBOL_PREFIX "_"
#endif
/* x86 */
#if defined(__i386__)
#ifndef EM_486
#define MATCH_MACHINE(x) (x == EM_386)
#else
#define MATCH_MACHINE(x) (x == EM_386 || x == EM_486)
#endif
#define SHT_RELM SHT_REL
#define Elf32_RelM Elf32_Rel
#define ELFCLASSM ELFCLASS32
#endif
#if defined(__mc68000__)
#define CONFIG_USE_GOT_ENTRIES
#define CONFIG_GOT_ENTRY_SIZE 4
#define CONFIG_USE_SINGLE
#endif
/* IA64, aka Itanium */
#if defined(__ia64__)
#define MATCH_MACHINE(x) (x == EM_IA_64)
#define SHT_RELM SHT_RELA
#define Elf64_RelM Elf64_Rela
#define ELFCLASSM ELFCLASS64
#endif
/* m68k */
#if defined(__mc68000__)
#define MATCH_MACHINE(x) (x == EM_68K)
#define SHT_RELM SHT_RELA
#define Elf32_RelM Elf32_Rela
#define ELFCLASSM ELFCLASS32
#define CONFIG_USE_GOT_ENTRIES
#define CONFIG_GOT_ENTRY_SIZE 4
#define CONFIG_USE_SINGLE
#endif
/* MIPS */
#if defined(__mips__)
#define MATCH_MACHINE(x) (x == EM_MIPS || x == EM_MIPS_RS3_LE)
#define SHT_RELM SHT_REL
#define Elf32_RelM Elf32_Rel
#define ELFCLASSM ELFCLASS32
/* Account for ELF spec changes. */
#ifndef EM_MIPS_RS3_LE
#ifdef EM_MIPS_RS4_BE
@@ -168,94 +193,87 @@ extern int insmod_ng_main( int argc, char **argv);
#define EM_MIPS_RS3_LE 10
#endif
#endif /* !EM_MIPS_RS3_LE */
#define MATCH_MACHINE(x) (x == EM_MIPS || x == EM_MIPS_RS3_LE)
#define SHT_RELM SHT_REL
#define Elf32_RelM Elf32_Rel
#define ELFCLASSM ELFCLASS32
#define ARCHDATAM "__dbe_table"
#endif
/* PowerPC */
#if defined(__powerpc__)
#define MATCH_MACHINE(x) (x == EM_PPC)
#define SHT_RELM SHT_RELA
#define Elf32_RelM Elf32_Rela
#define ELFCLASSM ELFCLASS32
#define CONFIG_USE_PLT_ENTRIES
#define CONFIG_PLT_ENTRY_SIZE 16
#define CONFIG_USE_PLT_LIST
#define CONFIG_LIST_ARCHTYPE ElfW(Addr)
#define CONFIG_USE_LIST
#define MATCH_MACHINE(x) (x == EM_PPC)
#define SHT_RELM SHT_RELA
#define Elf32_RelM Elf32_Rela
#define ELFCLASSM ELFCLASS32
#define ARCHDATAM "__ftr_fixup"
#endif
#if defined(__sh__)
/* S390 */
#if defined(__s390__)
#define MATCH_MACHINE(x) (x == EM_S390)
#define SHT_RELM SHT_RELA
#define Elf32_RelM Elf32_Rela
#define ELFCLASSM ELFCLASS32
#define CONFIG_USE_PLT_ENTRIES
#define CONFIG_PLT_ENTRY_SIZE 8
#define CONFIG_USE_GOT_ENTRIES
#define CONFIG_GOT_ENTRY_SIZE 4
#define CONFIG_GOT_ENTRY_SIZE 8
#define CONFIG_USE_SINGLE
#endif
/* SuperH */
#if defined(__sh__)
#define MATCH_MACHINE(x) (x == EM_SH)
#define SHT_RELM SHT_RELA
#define Elf32_RelM Elf32_Rela
#define ELFCLASSM ELFCLASS32
#define CONFIG_USE_GOT_ENTRIES
#define CONFIG_GOT_ENTRY_SIZE 4
#define CONFIG_USE_SINGLE
/* the SH changes have only been tested in =little endian= mode */
/* I'm not sure about big endian, so let's warn: */
#if defined(__sh__) && defined(__BIG_ENDIAN__)
#error insmod.c may require changes for use on big endian SH
#endif
/* it may or may not work on the SH1/SH2... So let's error on those
also */
#if ((!(defined(__SH3__) || defined(__SH4__) || defined(__SH5__)))) && \
(defined(__sh__))
/* it may or may not work on the SH1/SH2... Error on those also */
#if ((!(defined(__SH3__) || defined(__SH4__) || defined(__SH5__)))) && (defined(__sh__))
#error insmod.c may require changes for SH1 or SH2 use
#endif
#endif
#if defined (__v850e__)
#define CONFIG_USE_PLT_ENTRIES
#define CONFIG_PLT_ENTRY_SIZE 8
#define CONFIG_USE_SINGLE
#ifndef EM_CYGNUS_V850 /* grumble */
#define EM_CYGNUS_V850 0x9080
/* Sparc */
#if defined(__sparc__)
#define MATCH_MACHINE(x) (x == EM_SPARC)
#define SHT_RELM SHT_RELA
#define Elf32_RelM Elf32_Rela
#define ELFCLASSM ELFCLASS32
#endif
/* v850e */
#if defined (__v850e__)
#define MATCH_MACHINE(x) ((x) == EM_V850 || (x) == EM_CYGNUS_V850)
#define SHT_RELM SHT_RELA
#define Elf32_RelM Elf32_Rela
#define ELFCLASSM ELFCLASS32
#define SYMBOL_PREFIX "_"
#endif
#if defined(__cris__)
#ifndef EM_CRIS
#define EM_CRIS 76
#define R_CRIS_NONE 0
#define R_CRIS_32 3
#endif
#define MATCH_MACHINE(x) (x == EM_CRIS)
#define SHT_RELM SHT_RELA
#define Elf32_RelM Elf32_Rela
#define ELFCLASSM ELFCLASS32
#endif
#if defined(__H8300H__) || defined(__H8300S__)
#define CONFIG_USE_PLT_ENTRIES
#define CONFIG_PLT_ENTRY_SIZE 8
#define CONFIG_USE_SINGLE
#define MATCH_MACHINE(x) (x == EM_H8_300)
#define SHT_RELM SHT_RELA
#define Elf32_RelM Elf32_Rela
#define ELFCLASSM ELFCLASS32
#ifndef EM_CYGNUS_V850 /* grumble */
#define EM_CYGNUS_V850 0x9080
#endif
#define SYMBOL_PREFIX "_"
#endif
/* X86_64 */
#if defined(__x86_64__)
#define MATCH_MACHINE(x) (x == EM_X86_64)
#define SHT_RELM SHT_REL
#define Elf64_RelM Elf64_Rel
#define ELFCLASSM ELFCLASS64
#endif
#ifndef SHT_RELM
#error Sorry, but insmod.c does not yet support this architecture...
#endif
@@ -290,7 +308,7 @@ extern int insmod_ng_main( int argc, char **argv);
#ifndef MODUTILS_MODULE_H
static const int MODUTILS_MODULE_H = 1;
#ident "$Id: insmod.c,v 1.122 2004/07/20 15:43:57 sandman Exp $"
#ident "$Id: insmod.c,v 1.125 2004/09/02 23:03:25 andersen Exp $"
/*======================================================================*/
/* For sizeof() which are related to the module platform and not to the
@@ -448,7 +466,7 @@ int delete_module(const char *);
#ifndef MODUTILS_OBJ_H
static const int MODUTILS_OBJ_H = 1;
#ident "$Id: insmod.c,v 1.122 2004/07/20 15:43:57 sandman Exp $"
#ident "$Id: insmod.c,v 1.125 2004/09/02 23:03:25 andersen Exp $"
/* The relocatable object is manipulated using elfin types. */
@@ -1963,7 +1981,7 @@ add_symbols_from( struct obj_file *f,
if (strncmp((char *)s->name, "GPLONLY_", 8) == 0) {
#ifdef CONFIG_FEATURE_CHECK_TAINTED_MODULE
if (gpl)
((char *)s->name) += 8;
s->name += 8;
else
#endif
continue;
+57 -71
View File
@@ -34,7 +34,8 @@
struct dep_t {
char * m_module;
char * m_name;
char * m_path;
char * m_options;
int m_isalias : 1;
@@ -47,7 +48,8 @@ struct dep_t {
};
struct mod_list_t {
char * m_module;
char * m_name;
char * m_path;
char * m_options;
struct mod_list_t * m_prev;
@@ -115,7 +117,7 @@ static struct dep_t *build_dep ( void )
struct utsname un;
struct dep_t *first = 0;
struct dep_t *current = 0;
char buffer[256];
char buffer[2048];
char *filename = buffer;
int continuation_line = 0;
@@ -159,11 +161,12 @@ static struct dep_t *build_dep ( void )
if ( !continuation_line ) {
char *col = strchr ( buffer, ':' );
char *dot = col;
if ( col ) {
char *mods;
char *modpath;
char *mod;
int ext = 0;
*col = 0;
mods = strrchr ( buffer, '/' );
@@ -173,16 +176,19 @@ static struct dep_t *build_dep ( void )
else
mods++;
modpath = strchr ( buffer, '/' );
if ( !modpath )
modpath = buffer;
#if defined(CONFIG_FEATURE_2_6_MODULES)
if ((k_version > 4) && ( *(col-3) == '.' ) &&
( *(col-2) == 'k' ) && ( *(col-1) == 'o' ))
ext = 3;
dot = col - 3;
else
#endif
if (( *(col-2) == '.' ) && ( *(col-1) == 'o' ))
ext = 2;
dot = col - 2;
mod = bb_xstrndup ( buffer, col - buffer );
mod = bb_xstrndup ( mods, dot - mods );
if ( !current ) {
first = current = (struct dep_t *) xmalloc ( sizeof ( struct dep_t ));
@@ -191,7 +197,8 @@ static struct dep_t *build_dep ( void )
current-> m_next = (struct dep_t *) xmalloc ( sizeof ( struct dep_t ));
current = current-> m_next;
}
current-> m_module = mod;
current-> m_name = mod;
current-> m_path = bb_xstrdup(modpath);
current-> m_options = 0;
current-> m_isalias = 0;
current-> m_depcnt = 0;
@@ -317,7 +324,7 @@ static struct dep_t *build_dep ( void )
current-> m_next = (struct dep_t *) xcalloc ( 1, sizeof ( struct dep_t ));
current = current-> m_next;
}
current-> m_module = bb_xstrdup ( alias );
current-> m_name = bb_xstrdup ( alias );
current-> m_isalias = 1;
if (( strcmp ( mod, "off" ) == 0 ) || ( strcmp ( mod, "null" ) == 0 )) {
@@ -339,14 +346,14 @@ static struct dep_t *build_dep ( void )
struct dep_t *dt;
for ( dt = first; dt; dt = dt-> m_next ) {
if ( strcmp ( dt-> m_module, mod ) == 0 )
if ( strcmp ( dt-> m_name, mod ) == 0 )
break;
}
if ( dt ) {
dt-> m_options = xrealloc ( dt-> m_options, bb_strlen( opt ) + 1 );
strcpy ( dt-> m_options, opt );
// fprintf ( stderr, "OPTION: '%s' -> '%s'\n", dt-> m_module, dt-> m_options );
// fprintf ( stderr, "OPTION: '%s' -> '%s'\n", dt-> m_name, dt-> m_options );
}
}
}
@@ -357,33 +364,11 @@ static struct dep_t *build_dep ( void )
return first;
}
/* check if /lib/modules/bar/foo.ko belongs to module foo */
/* return 1 = found, 0 = not found */
static int mod_strcmp ( const char *mod_path, const char *mod_name )
{
#if defined(CONFIG_FEATURE_2_6_MODULES)
#define MODULE_EXTENSION ".ko"
#define MOD_EXTENSION_LEN 3
#else
#define MODULE_EXTENSION ".o"
#define MOD_EXTENSION_LEN 2
#endif
if ((strstr (mod_path, mod_name) ==
(mod_path + strlen(mod_path) -
strlen(mod_name) - MOD_EXTENSION_LEN))
&& (!strcmp(mod_path + strlen(mod_path) -
MOD_EXTENSION_LEN, MODULE_EXTENSION)))
{
return 1;
}
return 0;
}
/* return 1 = loaded, 0 = not loaded, -1 = can't tell */
static int already_loaded (const char *name)
{
int fd;
char buffer[256];
char buffer[4096];
fd = open ("/proc/modules", O_RDONLY);
if (fd < 0)
@@ -395,7 +380,7 @@ static int already_loaded (const char *name)
p = strchr (buffer, ' ');
if (p) {
*p = 0;
if (mod_strcmp (name, buffer)) {
if (strcmp (name, buffer) == 0) {
close (fd);
return 1;
}
@@ -408,31 +393,38 @@ static int already_loaded (const char *name)
static int mod_process ( struct mod_list_t *list, int do_insert )
{
char lcmd [256];
int rc = 1;
char lcmd [4096];
int rc = 0;
while ( list ) {
*lcmd = '\0';
if ( do_insert ) {
if (already_loaded (list->m_module) != 1)
if (already_loaded (list->m_name) != 1)
snprintf ( lcmd, sizeof( lcmd ) - 1, "insmod %s %s %s %s %s",
do_syslog ? "-s" : "", autoclean ? "-k" : "",
quiet ? "-q" : "", list-> m_module, list-> m_options ?
quiet ? "-q" : "", list-> m_path, list-> m_options ?
list-> m_options : "" );
} else {
if (already_loaded (list->m_module) != 0)
/* modutils uses short name for removal */
if (already_loaded (list->m_name) != 0)
snprintf ( lcmd, sizeof( lcmd ) - 1, "rmmod %s %s",
do_syslog ? "-s" : "", list-> m_module );
do_syslog ? "-s" : "", list-> m_name );
}
if ( verbose )
printf ( "%s\n", lcmd );
if ( !show_only && *lcmd) {
int rc2 = system ( lcmd );
if (do_insert) rc = rc2; /* only last module matters */
else if (!rc2) rc = 0; /* success if remove any mod */
if (*lcmd) {
if (verbose) {
printf("%s\n", lcmd);
}
if (!show_only) {
int rc2 = system(lcmd);
if (do_insert) {
rc = rc2; /* only last module matters */
}
else if (!rc2) {
rc = 0; /* success if remove any mod */
}
}
}
list = do_insert ? list-> m_prev : list-> m_next;
}
return (show_only) ? 0 : rc;
@@ -443,24 +435,13 @@ static void check_dep ( char *mod, struct mod_list_t **head, struct mod_list_t *
struct mod_list_t *find;
struct dep_t *dt;
char *opt = 0;
int lm;
// remove .o extension
lm = bb_strlen ( mod );
#if defined(CONFIG_FEATURE_2_6_MODULES)
if ((k_version > 4) && ( mod [lm-3] == '.' ) &&
( mod [lm-2] == 'k' ) && ( mod [lm-1] == 'o' ))
mod [lm-3] = 0;
else
#endif
if (( mod [lm-2] == '.' ) && ( mod [lm-1] == 'o' ))
mod [lm-2] = 0;
char *path = 0;
// check dependencies
for ( dt = depend; dt; dt = dt-> m_next ) {
if ( mod_strcmp ( dt-> m_module, mod )) {
mod = dt-> m_module;
if ( strcmp ( dt-> m_name, mod ) == 0) {
mod = dt-> m_name;
path = dt-> m_path;
opt = dt-> m_options;
break;
}
@@ -472,12 +453,13 @@ static void check_dep ( char *mod, struct mod_list_t **head, struct mod_list_t *
struct dep_t *adt;
for ( adt = depend; adt; adt = adt-> m_next ) {
if ( strcmp ( adt-> m_module, dt-> m_deparr [0] ) == 0 )
if ( strcmp ( adt-> m_name, dt-> m_deparr [0] ) == 0 )
break;
}
if ( adt ) {
dt = adt;
mod = dt-> m_module;
mod = dt-> m_name;
path = dt-> m_path;
if ( !opt )
opt = dt-> m_options;
}
@@ -488,9 +470,14 @@ static void check_dep ( char *mod, struct mod_list_t **head, struct mod_list_t *
return;
}
if ( !path ) {
bb_error_msg ("module %s not found.", mod);
return;
}
// search for duplicates
for ( find = *head; find; find = find-> m_next ) {
if ( !strcmp ( mod, find-> m_module )) {
if ( !strcmp ( mod, find-> m_name )) {
// found -> dequeue it
if ( find-> m_prev )
@@ -509,7 +496,8 @@ static void check_dep ( char *mod, struct mod_list_t **head, struct mod_list_t *
if ( !find ) { // did not find a duplicate
find = (struct mod_list_t *) xmalloc ( sizeof(struct mod_list_t));
find-> m_module = mod;
find-> m_name = mod;
find-> m_path = path;
find-> m_options = opt;
}
@@ -543,6 +531,7 @@ static int mod_insert ( char *mod, int argc, char **argv )
check_dep ( mod, &head, &tail );
if ( head && tail ) {
#if defined(CONFIG_FEATURE_2_6_MODULES)
if ( argc ) {
int i;
int l = 0;
@@ -559,6 +548,7 @@ static int mod_insert ( char *mod, int argc, char **argv )
strcat ( head-> m_options, " " );
}
}
#endif
// process tail ---> head
rc = mod_process ( tail, 1 );
@@ -590,8 +580,6 @@ static int mod_remove ( char *mod )
}
extern int modprobe_main(int argc, char** argv)
{
int opt;
@@ -664,5 +652,3 @@ extern int modprobe_main(int argc, char** argv)
return EXIT_SUCCESS;
}
+36 -2
View File
@@ -492,11 +492,45 @@ config CONFIG_FEATURE_TELNET_AUTOLOGIN
config CONFIG_TELNETD
bool "telnetd"
default n
select CONFIG_LOGIN
help
A daemon for the TELNET protocol, allowing you to log onto the host
running the daemon. Please keep in mind that the TELNET protocol
sends passwords in plain text. If you can't afford the space for
any SSH daemon and you trust your network, you may say 'y' here.
sends passwords in plain text. If you can't afford the space for an
SSH daemon and you trust your network, you may say 'y' here. As a
more secure alternative, you should seriously consider installing the
very small Dropbear SSH daemon instead:
http://matt.ucc.asn.au/dropbear/dropbear.html
Note that for busybox telnetd to work you need several things:
First of all, your kernel needs:
CONFIG_UNIX98_PTYS=y
CONFIG_DEVPTS_FS=y
Next, you need a /dev/pts directory on your root filesystem:
$ ls -ld /dev/pts
drwxr-xr-x 2 root root 0 Sep 23 13:21 /dev/pts/
Next you need the pseudo terminal master multiplexer /dev/ptmx:
$ ls -la /dev/ptmx
crw-rw-rw- 1 root tty 5, 2 Sep 23 13:55 /dev/ptmx
Any /dev/ttyp[0-9]* files you may have can be removed.
Next, you need to mount the devpts filesystem on /dev/pts using:
mount -t devpts devpts /dev/pts
You need to be sure that Busybox has CONFIG_LOGIN and
CONFIG_FEATURE_SUID enabled. And finally, you should make
certain that Busybox has been installed setuid root:
chown root.root /bin/busybox
chmod 4755 /bin/busybox
with all that done, telnetd _should_ work....
config CONFIG_FEATURE_TELNETD_INETD
bool " Support call from inetd only"
+6 -4
View File
@@ -17,13 +17,15 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
TOPDIR:= ../
top_srcdir=..
top_builddir=..
srcdir=$(top_srcdir)/networking
NETWORKING_DIR:=./
include $(TOPDIR).config
include $(TOPDIR)Rules.mak
include $(top_builddir)/Rules.mak
include $(top_builddir)/.config
include Makefile.in
all: $(libraries-y)
-include $(TOPDIR).depend
-include $(top_builddir)/.depend
clean:
rm -f *.o *.a $(AR_TARGET)
+5 -2
View File
@@ -19,9 +19,9 @@
NETWORKING_AR:=networking.a
ifndef $(NETWORKING_DIR)
NETWORKING_DIR:=$(TOPDIR)networking/
NETWORKING_DIR:=$(top_builddir)/networking/
endif
srcdir=$(top_srcdir)/networking
NETWORKING-y:=
NETWORKING-$(CONFIG_ARPING) += arping.o
NETWORKING-$(CONFIG_FTPGET) += ftpgetput.o
@@ -63,3 +63,6 @@ endif
$(NETWORKING_DIR)$(NETWORKING_AR): $(patsubst %,$(NETWORKING_DIR)%, $(NETWORKING-y))
$(AR) -ro $@ $(patsubst %,$(NETWORKING_DIR)%, $(NETWORKING-y))
$(NETWORKING_DIR)%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
Loaded 100 of 164 files, more files were not shown because too many files have changed in this diff. Show more