Commit Graph

580 Commits

Author SHA1 Message Date
Rob Landley
081d6d4380 getdomainname() isn't guaranteed to null terminate the string if it was
truncated for length.  SVN 14135 made sure that the truncated version would
always be null terminated.  SVN 14144 broke this for no readily apparent
reason, and I have no idea what it was even trying to accomplish.  Reverted.
2006-02-20 16:31:44 +00:00
"Vladimir N. Oleynik"
0c6ff43a0c remove #undef strlen, use #define strlen always but without xfunc/BB_STRLEN_IMPLEMENTATION 2006-02-20 12:15:10 +00:00
"Vladimir N. Oleynik"
d24d083061 correction get(host/domain)name usage, revert 742 bug 2006-02-20 10:44:02 +00:00
Rob Landley
4e9deec8bf svn 14077 was completely broken and apparently never tested. 2006-02-20 02:44:30 +00:00
Mike Frysinger
dce17c6268 rfelker writes in Bug 742: make sure string is null terminated after calling gethostname 2006-02-19 23:03:31 +00:00
Mike Frysinger
294254ce6b rfelker writes in Bug 740: s/u_char/unsigned char/ 2006-02-19 22:59:12 +00:00
"Vladimir N. Oleynik"
06776b3650 type typo. Thanks, Devin Bayer 2006-02-17 09:33:22 +00:00
"Vladimir N. Oleynik"
dd1ccddf1b moved BB_BANNER to applets/version.c file: make kernel like version,
removed depend loop: busybox.h depend with BB_BT, and all sources depend with busybox.h
2006-02-16 15:40:24 +00:00
"Vladimir N. Oleynik"
21e68703ce removed #undef strlen, use builtins and prototuped strlen from xfunc file (only\!) 2006-02-16 14:38:41 +00:00
"Vladimir N. Oleynik"
465300ced9 cleanups after changes by Denis Vlasenko. Size optimization 2006-02-14 10:17:09 +00:00
Rob Landley
b2804551a0 Cleanups from Denis Vlasenko. 2006-02-13 22:04:27 +00:00
Rob Landley
90632d021c Bug fix from Kim B. Heino, manifested via:
echo > foo && zip foo.zip foo && ./busybox unzip foo.zip
2006-02-13 19:40:43 +00:00
Rob Landley
bec26527a1 Save a few bytes in error message. 2006-02-05 03:31:44 +00:00
"Vladimir N. Oleynik"
4fc92206ed destroy bug 679, use getopt_ulflags with new feature: usage option. Removed two strdup 2006-02-02 14:48:54 +00:00
Mike Frysinger
b38673fb9f make the build system puuuuuuuuuuurty 2006-02-02 01:41:53 +00:00
Bernhard Reutner-Fischer
3038557649 - bzero -> memset
text    data     bss     dec     hex filename
1652855   14444 1215616 2882915  2bfd63 busybox.oorig.gcc-3.3
1652823   14444 1215616 2882883  2bfd43 busybox.gcc-3.3
1603655   14412 1215552 2833619  2b3cd3 busybox.oorig.gcc-3.4
1603655   14412 1215552 2833619  2b3cd3 busybox.gcc-3.4
1609755   14508 1215744 2840007  2b55c7 busybox.oorig.gcc-4.0
1609755   14508 1215744 2840007  2b55c7 busybox.gcc-4.0
1590495   13516 1215392 2819403  2b054b busybox.oorig.gcc-4.1-HEAD
1590495   13516 1215392 2819403  2b054b busybox.gcc-4.1-HEAD
1589079   13036 1213248 2815363  2af583 busybox.oorig.gcc-4.2-HEAD
1589079   13036 1213248 2815363  2af583 busybox.gcc-4.2-HEAD
2006-01-31 17:57:48 +00:00
"Vladimir N. Oleynik"
1f17d3287a more obscure 2006-01-31 12:36:51 +00:00
"Vladimir N. Oleynik"
7600eec732 avoid signed<->unsigned warning 2006-01-31 12:12:15 +00:00
Bernhard Reutner-Fischer
cd98555dfa - fix typo i introduced yesterday. 2006-01-31 08:17:13 +00:00
Eric Andersen
76b24270d4 with 2.4 kernel headers, lo_file_name is char, but with 2.6
headers we get a u8 for lo_file_name, so always cast to (char *)
when treating it as such.
2006-01-30 17:30:22 +00:00
Bernhard Reutner-Fischer
20f4000086 - add some ATTRIBUTE_UNUSED.
- use shorter boilerplate while at it.
2006-01-30 17:17:14 +00:00
Bernhard Reutner-Fischer
0e8727d93b - make linking against libcrypt optional by looking if pw_encrypt() or
correct_password() is configured. Fixes allnoconfig pulling in -lcrypt.
2006-01-30 15:29:55 +00:00
Tim Riker
c1ef7bdd8d just whitespace 2006-01-25 00:08:53 +00:00
Rob Landley
b70ccd9509 Close bug 644: loop incrementing twice, skipping ever other device. 2006-01-22 23:17:18 +00:00
Bernhard Reutner-Fischer
37dec0e9e9 - make CONFIG_MD5SUM_SIZE_VS_SPEED configurable via menuconfig.
- use shorter boilerplate.
2006-01-17 12:07:03 +00:00
Bernhard Reutner-Fischer
7ca61b6f33 - shared libbusybox.
- IMA compilation option (aka IPO, IPA,..)
Please holler if i broke something..
2006-01-15 14:04:57 +00:00
Bernhard Reutner-Fischer
853c44b798 - correct definitions. 2006-01-13 12:03:26 +00:00
Bernhard Reutner-Fischer
dd9dce104d - shrink simple obscure stuff a tiny bit:
text    data     bss     dec     hex filename
    789       0       0     789     315 obscure.o.oorig
    771       0       0     771     303 obscure.o
- replace bzero by memset while at it.
2006-01-12 15:38:12 +00:00
"Vladimir N. Oleynik"
f01e1784e5 removed a warning about an unused pargv in bb_getopt_ulflags. Noticed by Tito 2006-01-09 13:28:31 +00:00
Rob Landley
3d1bbf0a5f Minor cosmetic fix from Tito. 2006-01-09 01:07:24 +00:00
Rob Landley
84cb76733f patch from tito: consolidate delay functions as bb_do_delay() 2006-01-06 20:59:09 +00:00
Rob Landley
9085467970 Trying to losetup a device as a regular user shouldn't result in an endless
loop, and the error messages should display correctly now.
2005-12-21 16:53:57 +00:00
Rob Landley
e422af6bcb Flush input when prompting for a password (bug 373). 2005-12-12 07:02:15 +00:00
"Vladimir N. Oleynik"
bf968f71f1 reduce signedness warning 2005-12-02 10:10:28 +00:00
Rob Landley
1d589b2e2d Fix losetup so that it A) actually works again, B) has much better error
messages, C) can show the current association (if any) when called
with only one argument.  Update the documentation a lot too.

Remind me to add a test suite for this thing.  I think I've figured out
how to handle root-only testsuites...
2005-11-29 23:47:10 +00:00
"Vladimir N. Oleynik"
cc34344d91 change the interface of libbb/compare_string_array (unsigned short to int), usaging for e2fsprogs/fsck 2005-11-26 10:45:26 +00:00
"Vladimir N. Oleynik"
61ff4b3973 more use const for interface of libbb/compare_string_array, example usage for e2fsprogs/fsck 2005-11-26 10:33:55 +00:00
"Vladimir N. Oleynik"
4eb2fd6826 more use libbb/bb_msg_read_error 2005-11-25 11:36:36 +00:00
Rob Landley
b4c823211d Move interface.c to networking directory since it's only used by ifconfig. 2005-11-22 07:52:54 +00:00
Rob Landley
9033453c18 My last change to this file broke tar x. Sigh. (Trying to make sure we work
on file sizes between 2 and 4 gigs on 32 bit machines.  For supporting >4 gigs,
just use a 64 bit machine already...)
2005-11-12 11:04:11 +00:00
Rob Landley
3fc4ad1478 Fix bug 424: doing full_read breaks things like cat which should return a
chunk of data when they get it and not block until they've buffered 4k.

The use case was cat /proc/psaux, but you can also reproduce this by
running non-busybox cat by itself and typing things at the command line.
Then run busybox cat.  Notice how cat is _supposed_ to echo each line back
to us as we hit enter?
2005-11-04 01:54:15 +00:00
Rob Landley
21ccbb6c0e When cp ran out of space it didn't return a nonzero error code. Fixes bug 493. 2005-11-04 01:20:46 +00:00
Rob Landley
2f30932eca Fix cp /dev/null filename, and a few in-passing cleanups. 2005-11-01 21:55:14 +00:00
Rob Landley
2454ebd85d Somebody suggested this, but I've forgotten who. 2005-10-27 22:50:04 +00:00
Rob Landley
3c6bfe3e33 Shaun Jackman noted that limits.h defines path_max and isn't included from
find_root_device.c.  (We #include it in busybox.h but not libbb.h, it seems.
Someday, someone's going to have to clarify for me the difference between
those two...)
2005-10-25 02:22:13 +00:00
"Vladimir N. Oleynik"
0fa9deda17 more const 2005-10-20 09:48:28 +00:00
Bernhard Reutner-Fischer
7547a6e2f6 - don't update copyright years. He might release it, but apparently will have
to update the year himself.
2005-10-15 20:56:31 +00:00
Bernhard Reutner-Fischer
94c3331d47 - an empty middle term in ?: violates ISO C
- use shorter boilerplate and use C89 style comments
2005-10-15 14:13:09 +00:00
"Vladimir N. Oleynik"
6f347ef9dc common BUFSIZ BSS buffer, small reduce code, data and bss 2005-10-15 10:23:55 +00:00
"Vladimir N. Oleynik"
f704b27b5b - new bb_opt_complementally syntax, use [-:?] only - 'free' chars
- new bb_getopt_ulflags features: check max and min args, convert first argv to options special for ar and tar applets
- use bb_default_error_retval for env applet
2005-10-14 09:56:52 +00:00
"Vladimir N. Oleynik"
6c35c7c976 usage bb_dev_null 2005-10-12 15:34:25 +00:00
"Vladimir N. Oleynik"
86a1073e0b bb_dev_null 2005-10-12 15:21:32 +00:00
"Vladimir N. Oleynik"
064f04e7e2 - use complementally '!' to '?' - 'ask' is best 'free' char for this.
- more long opt compatibility, can set flag for long opt struct now
- more logic: check opt-depend requires and global requires, special for 'id' and 'start-stop-daemon' applets.
2005-10-11 14:38:01 +00:00
Rob Landley
ff567f7943 The check for EROFS was wrong. For example, if you try to mount a filesystem
appended to an executable that's being run (yes, I'm doing this) you get
EPERM, but mounting readonly fixes it.  Doing the fallback all the time
shouldn't hurt, and is one less test.
2005-10-11 07:26:15 +00:00
"Vladimir N. Oleynik"
083d3f49c2 bb_mkdep: Rewroted. removed problem "include name must uniq", speed up * 3.
e2fsprogs: remove confuse bb_mkdep. Use internal e2fsprogs includes only.
other: remove confuse bb_mkdep.
2005-10-10 11:35:17 +00:00
Bernhard Reutner-Fischer
ab52db8d5e - size reduction of pidof
- fix typo in reverse_pidlist
2005-10-07 15:44:37 +00:00
Bernhard Reutner-Fischer
cf95e0b2d5 - add llist_free_one() and llist_free() to libbb 2005-10-06 12:12:51 +00:00
Bernhard Reutner-Fischer
56b217117a - add llist_free_one() and llist_free() to libbb; Add a bit of documentation.
- change llist_add_to_end as proposed by vodz in http://busybox.net/lists/busybox/2005-September/016411.html
- remove unneeded includes, add short boilerplate and copyright to llist.c
- move COMM_LEN from find_pid_by_name to libbb.h and use it in procps_status_t
- add reverse_pidlist() to find_pid_by_name. Will be needed for pidof.
2005-10-06 12:10:48 +00:00
"Vladimir N. Oleynik"
4a5ce08688 another more correction for getopt_ulflags() documentation (examples) 2005-10-05 13:58:40 +00:00
"Vladimir N. Oleynik"
d1b6078e5d more correction for getopt_ulflags() documentation by author of this fuck logic 2005-10-05 12:44:52 +00:00
Bernhard Reutner-Fischer
120513c29f - add proper separators. sorry for the noise.. 2005-10-05 12:28:55 +00:00
Bernhard Reutner-Fischer
43fb3fcb2f - add a bit more documentation to vodz' recent additions. 2005-10-05 12:23:13 +00:00
"Vladimir N. Oleynik"
35939d9378 update bb_getopt_ulflags special for 'ps' applet, usaging '-' as first group char from bb_opt_complementally is new feature: set argv is options;
use new bb_getopt_ulflags for ps
# define terminal_width 80->79 for unwide
use stdout file descriptor for get_terminal_width_height. (its must)
2005-10-05 10:52:47 +00:00
"Vladimir N. Oleynik"
be0ed3d0b9 use updated bb_getopt_ulflags() for ps applet 2005-10-04 16:48:26 +00:00
"Vladimir N. Oleynik"
39a841cecf change interface to bb_xasprintf() - more perfect for me.
ln.c: error_msg(str)->error_msg(%s, str) - remove standart "feature" for hackers
reduce 100 bytes don't care in sum
2005-09-29 16:18:57 +00:00
Bernhard Reutner-Fischer
bee9eb1a9d - rename llist_add_to.c to llist.c
- move llist_add_to_end() from ifupdown.c to libbb/llist.c
2005-09-29 12:55:10 +00:00
"Vladimir N. Oleynik"
5f46010ab7 spwd bulid now, (typo) 2005-09-26 12:58:24 +00:00
Rob Landley
5246063a7b Patch from Amir Shalem to make busybox compile on a uClibc that has no shadow
password support.
2005-09-25 23:36:12 +00:00
Mike Frysinger
62f18e1f20 use the shorter license header 2005-09-24 07:16:29 +00:00
Mike Frysinger
0d4ee68be5 use brief license line 2005-09-24 06:01:57 +00:00
Bernhard Reutner-Fischer
c5280e8885 - consolidated password helpers 2005-09-20 21:09:31 +00:00
Bernhard Reutner-Fischer
f56b8e4b00 - consolidated password helpers into bb_pwd.c 2005-09-20 21:08:10 +00:00
Bernhard Reutner-Fischer
d5bd137a24 - rename libbb's password helpers as suggested in libbb.h
my_getpwnam -> bb_xgetpwnam  /* dies on error */
  my_getgrnam -> bb_xgetgrnam  /* dies on error */
  my_getgrgid -> bb_getgrgid
  my_getpwuid -> bb_getpwuid
  my_getug    -> bb_getug
2005-09-20 21:06:17 +00:00
"Vladimir N. Oleynik"
f246dc7f57 ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE->CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE 2005-09-16 12:55:29 +00:00
"Vladimir N. Oleynik"
23f62fc6f3 split libbb: moved xregcomp separatelly for speed up recompile 2005-09-14 16:59:11 +00:00
"Vladimir N. Oleynik"
1e07f852e0 FEATURE->ENABLE_FEATURE loses one for 'top' applet 2005-09-14 16:08:06 +00:00
Rob Landley
90ca6b2878 This code exists to compensate for ancient broken build environments which,
as far as I can tell, are no longer relevant.  Modern busybox refuses to
build under libc5 (there's a specific test and #error for that), and
I'm not sure building against 2.1 kernel headers on Alpha was ever relevant.

I'm happy to put any of this back if anybody can point to a real need for it,
but if so we need to specifically document what environment is being
compensated for.  (And we should quarrantine the build environment code
into one place, anyway.  Maybe "quirks.h" for known compiler and
libc quirks?)
2005-09-07 06:39:02 +00:00
Mike Frysinger
99f61719cb Amir Shalem writes:
this patch fix syscall names mix-up in libb/syscalls.c
2005-09-06 21:53:21 +00:00
"Vladimir N. Oleynik"
45a8ed89c6 - sync traceroute with Slackware-10.1
(support -FIl -g gw -i if -z pt now).
- libbb/getopt_ulflags.c support bb_opt_complementally="x-x" as trigger now
2005-09-06 16:08:33 +00:00
Rob Landley
9955c45907 get_terminal_width_height.c was in there twice. 2005-09-05 18:42:18 +00:00
"Vladimir N. Oleynik"
27421a1878 1) bb_opt_complementaly -> bb_opt_complementally
2) better support long options
3) new flag '!' for bb_opt_complementally: produce bb_show_usage() if BB_GETOPT_ERROR internally
2005-09-05 14:46:07 +00:00
Rob Landley
cc1669bcde Actually returning ret might be good. 2005-09-05 05:36:15 +00:00
Rob Landley
828548ab56 According to bug #63, crond is unhappy with crontab lines that don't end in a
newline, or lines that have trailing spaces.
2005-09-01 10:23:57 +00:00
Rob Landley
e0537f6194 Bernhard Fischer suggested that get_terminal_width_height() should return
the result of the ioctl so callers can tell if we have a tty.  (0 means
we have a tty, nonzero means the ioctl couldn't find size info and we
fake 80x24.  Really we should fake 80x25, but oh well...)
2005-09-01 02:57:45 +00:00
Mike Frysinger
ddddb94f05 make sure __NF_sysfs exists before trying to use it 2005-08-27 18:19:01 +00:00
Rob Landley
6417564eeb Two FEATURE_CLEAN_UP patches from Shaun Jackman, closing filehandles. 2005-08-22 15:57:50 +00:00
Mike Frysinger
6ebbc7414e the () around isspace actually matters 2005-08-16 05:39:07 +00:00
Mike Frysinger
71224980e1 Bernhard Fischer says: fix comment typo 2005-08-16 05:27:51 +00:00
Rob Landley
6a6798b8e4 Major rewrite of mount, umount, losetup. Untangled lots of code, shrunk
things down a bit, fixed a number of funky corner cases, added support for
several new features (things like mount --move, mount --bind, lazy unounts,
automatic detection of loop mounts, and so on).  Probably broke several
other things, but it's fixable.  (Bang on it, tell me what doesn't work for
you...)

Note: you no longer need to say "-o loop".  It does that for you when
necessary.

Still need to add "user mount" support, which involves making mount suid.  Not
too hard to do under the new infrastructure, just haven't done it yet...

The previous code had the following notes, that belong in the version
control comments:

- * 3/21/1999   Charles P. Wright <cpwright@cpwright.com>
- *             searches through fstab when -a is passed
- *             will try mounting stuff with all fses when passed -t auto
- *
- * 1999-04-17  Dave Cinege...Rewrote -t auto. Fixed ro mtab.
- *
- * 1999-10-07  Erik Andersen <andersen@codepoet.org>.
- *              Rewrite of a lot of code. Removed mtab usage (I plan on
- *              putting it back as a compile-time option some time),
- *              major adjustments to option parsing, and some serious
- *              dieting all around.
- *
- * 1999-11-06  mtab support is back - andersee
- *
- * 2000-01-12   Ben Collins <bcollins@debian.org>, Borrowed utils-linux's
- *              mount to add loop support.
- *
- * 2000-04-30  Dave Cinege <dcinege@psychosis.com>
- *             Rewrote fstab while loop and lower mount section. Can now do
- *             single mounts from fstab. Can override fstab options for single
- *             mount. Common mount_one call for single mounts and 'all'. Fixed
- *             mtab updating and stale entries. Removed 'remount' default.
- *
2005-08-10 20:35:54 +00:00
Paul Fox
0b62158475 implemented a builtin echo command in ash. moved the guts of the
echo applet into libbb, and now call bb_echo() from both echo.c
and ash.c
2005-08-09 19:38:05 +00:00
Mike Frysinger
b953134bba apgo in Bug 322 writes: kill off CONFIG_FEATURE_MTAB_FILENAME 2005-07-30 08:48:10 +00:00
Paul Fox
e5ba382b99 move the ifdef to after libbb.h include, so it can do some good. 2005-07-27 14:20:52 +00:00
Mike Frysinger
4d00896d05 use toplevel ARFLAGS and update default ARFLAGS to be quiet 2005-07-27 01:09:24 +00:00
Mike Frysinger
6fafa5aa9f 2005-04-05 Shaun Jackman <sjackman@gmail.com>
* libbb/printf.c: Check for __NEWLIB_H__ before __GLIBC__.
2005-07-26 23:05:03 +00:00
Mike Frysinger
6e05312ba9 no longer used as reported by apgo in Bug 348 2005-07-26 22:51:57 +00:00
Paul Fox
1429017968 ifdef all of loop.c with CONFIG_FEATURE_MOUNT_LOOP. won't
compile due to CONFIG_FEATURE_MOUNT_LOOP_MAX otherwise.  reported
by Stephane Billiart.
2005-07-22 19:58:32 +00:00
Paul Fox
c337d29550 applying fix for:
0000117: Remove linefeed after overwrite prompt using cp -i
	  User input not on the same line as the prompt when about to
	  overwrite a file.
2005-07-19 21:31:05 +00:00
Paul Fox
3f6f3174e9 applying fix from:
0000068: mount limited to max 8 loop devices (patch provided)  

(made minor wording change for config help message)
2005-07-19 20:55:37 +00:00
Paul Fox
0a92bbf349 applying fix from:
0000067: cp -p produces misleading error message
2005-07-19 20:47:33 +00:00
Mike Frysinger
348e84c202 change the hardcoded error constant (0x80000000UL) to a nice flexible define (BB_GETOPT_ERROR) 2005-05-11 00:39:03 +00:00