aboutsummaryrefslogtreecommitdiff
path: root/include/libbb.h
AgeCommit message (Collapse)Author
2005-10-06- add llist_free_one() and llist_free() to libbb; Add a bit of documentation.Bernhard Reutner-Fischer
- 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-04- add prototype for llist_add_to_end to libbb.hBernhard Reutner-Fischer
2005-09-29change interface to bb_xasprintf() - more perfect for me."Vladimir N. Oleynik"
ln.c: error_msg(str)->error_msg(%s, str) - remove standart "feature" for hackers reduce 100 bytes don't care in sum
2005-09-24add a attribute_noreturn macroMike Frysinger
2005-09-21- make sure to include dmalloc.h at the very end of busybox.h or libbb.h.Bernhard Reutner-Fischer
2005-09-20- rename libbb's password helpers as suggested in libbb.hBernhard Reutner-Fischer
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- Remove unnecessary warning from libbb and move bb_wfopen_input near bb_wfopenBernhard Reutner-Fischer
2005-09-20This is strange typically modern mistake. Learn please: stat(2) used ↵"Vladimir N. Oleynik"
sys/types.h and not reverse
2005-09-16ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE->CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE"Vladimir N. Oleynik"
2005-09-14split libbb: moved xregcomp separatelly for speed up recompile"Vladimir N. Oleynik"
2005-09-14FEATURE->ENABLE_FEATURE loses one for 'top' applet"Vladimir N. Oleynik"
2005-09-051) bb_opt_complementaly -> bb_opt_complementally"Vladimir N. Oleynik"
2) better support long options 3) new flag '!' for bb_opt_complementally: produce bb_show_usage() if BB_GETOPT_ERROR internally
2005-09-01Bernhard Fischer suggested that get_terminal_width_height() should returnRob Landley
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-08-10Major rewrite of mount, umount, losetup. Untangled lots of code, shrunkRob Landley
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-09implemented a builtin echo command in ash. moved the guts of thePaul Fox
echo applet into libbb, and now call bb_echo() from both echo.c and ash.c
2005-07-27#ifdef reduction infrastructure, based on an argument between Shaun Jackman,Rob Landley
Rob Landley, and others. Currently CONFIG options are defined or undefined, so we chop out code with #ifdefs, ala: #ifdef CONFIG_THING stuff(); #endif This creates a new header file, bb_config.h, which sets the CONFIG entry to 1 or 0, and lets us do: if(CONFIG_THING) stuff(); And let the compiler do dead code elimination to get rid of it. (Note: #ifdef will still work because for the 1 case it's a static const int, not a #define.)
2005-05-11change the hardcoded error constant (0x80000000UL) to a nice flexible define ↵Mike Frysinger
(BB_GETOPT_ERROR)
2005-05-03A patch from Takeharu KATO to update/fix SE-Linux support.Rob Landley
2005-05-03Revert Tito's patch to zcip. My bad, David Brownell had objected and I missedRob Landley
it...
2005-05-01On Tuesday 19 April 2005 21:10, Tito wrote and today added:Rob Landley
> Hi, > this is a first attempt of size optimization for zcip taking into account all > the hints given so far on the list. > I've applied just the more obvious busyboxifications so maybe it could be > optimized more. BTW: I've ripped out a lot of debug code and changed c++ // comments to /* */ as both were rather confusing for a newbie like me. ;-) Sorry to the author for that. I know that this makes mantaining the code easier, but I'm simple minded....
2005-04-16Add bb_msg_read_errorEric Andersen
2005-01-24Sort rewrite to be SUSv3 compliant. New config option, updated help, andRob Landley
a couple of infrastructure bits.
2004-09-15Tito writes,Glenn L McGrath
"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-02Tito writes:Eric Andersen
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-08-26Tito writes:Eric Andersen
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-03Tito, farmatito at tiscali dot it writes:Eric Andersen
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-06-22Patch from Bastian Blank:Eric Andersen
On Sat, Jun 19, 2004 at 10:57:37PM +0200, Bastian Blank wrote: > The following patch changes klogd to use openlog/syslog themself > instead of calling syslog_msg which always calls the triple > openlog/syslog/closelog. Updated patch: get rid of syslog_msg entirely. Request from Erik Andersen. Bastian
2004-06-22Patch from Bastian Blank:Eric Andersen
The updated patch adds a config option to explicitely enable 64 bit arithmetic. Also it removes the arith prototype from libbb.h as it is not used outside of ash. Bastian this patch has been slightly modified by Erik for cleanliness.
2004-05-01Do not use getpass(3)Eric Andersen
2004-03-15Remove trailing whitespace. Update copyright to include 2004.Eric Andersen
2004-03-12Add prototypes for safe_strtol and friendsEric Andersen
2004-02-21Sometimes i get carried away with the use of function pointers, im sureGlenn L McGrath
it seemed like a good idea at the time.
2004-02-05Make sure stdlib.h is always included before dmalloc.h to avoid problemsManuel Novoa III
parsing problems.
2004-01-17Modify bb_lookup_port to allow the protocol to be specified, allowingGlenn L McGrath
/etc/services support for inetd, netcat and tftp.
2003-12-20Change interface to bb_lookup_host, dont try and set port inside thisGlenn L McGrath
function as there is no gracefull way of handling failures. Rename bb_getport to bb_lookup_port, allow a default port to be specified so it always returns a correct value. Modify ftpgetput/rdate/wget to use the new interface. wget/rdate now use etc/services with a falback default value.
2003-12-15Get vfork_daemon_rexec working under uclinuxRuss Dill
2003-11-21As we no longer use function pointers for read in common archiving codeGlenn L McGrath
archive_xread can be replaced with bb_full_read, and archive_copy_file with bb_copyfd* bb_copyfd is split into two functions bb_copyfd_size and bb_copyfd_eof, they share a common backend.
2003-11-20Dont over-read fd, use function pointer for hash function.Glenn L McGrath
2003-11-20Include stdint.hGlenn L McGrath
2003-11-14Oskar Liljeblad writes:Eric Andersen
Here's a fix for the hard-coded device name in fbset.
2003-11-10Merge common parts of sha1sum and md5sum, which is everything except theGlenn L McGrath
algorithms. Move algorithms to hash_fd and make them available via a common function.
2003-11-03Fix rdate and ftpget/ftpput so they compile with the new xconnect.Eric Andersen
I have checked rdate. Someone should also check ftpget/ftpput to be sure they still work.
2003-10-31Rework wget, the xconnect interface, and its various clientsEric Andersen
in order to fix the problems with round robin DNS reported by Andrew Flegg: http://busybox.net/lists/busybox/2003-October/009579.html This removes the ipv6 specific xconnect dns lookups. I do not see why that would need to be special cased for ipv6 as was done, but that will just have to be tested. So IPV6 people -- please test this change! -Erik
2003-10-09We did not have a safe_write, which is the analog to safe_read. ConvertEric Andersen
full_write to use safe_write internally, which is needed to guarantee proper behavior, i.e. when writing to a pipe.
2003-10-01Patch by Rob Landley, work in progress update, fixes lots of bugs,Glenn L McGrath
introduces a few others (but they are being worked on)
2003-09-24Add the "install" applet, move get_ug_id to libbb as its used by chown,Glenn L McGrath
chgrp and install.
2003-09-15Be entirely consistant when using ioctl(0, TIOCGWINSZ, &winsize)Eric Andersen
to ensure proper fallback behavior on, i.e. serial consoles. -Erik
2003-09-03more crond+crontab integrating with loginutil libbb functions and deletedGlenn L McGrath
patch from Thomas Gleixner to init. Viodz last_patch_108
2003-09-02move all "-/bin/sh" "/bin/sh" and "sh" to libbb/messages.c file as oneGlenn L McGrath
constant. Vodz last_patch_107
2003-08-22"staywithu" writes:Eric Andersen
In BusyBox v1.00-pre2, commands like ls, df with -h option report a wrong file size for files larger than 4GBtye!! For example, when I execute 'ls -l', it reports -rw-r--r-- 1 root root 5368709120 Aug 17 2003 large_stream.tp when I execute 'ls -lh', I expect that -rw-r--r-- 1 root root 5.0G Aug 17 2003 large_stream.tp but it reports -rw-r--r-- 1 root root 1.0G Aug 17 2003 large_stream.tp I fixed this bug that... Line 31 in libbb/human_readable.c and line 275 include/libbb.h const char *make_human_readable_str(unsigned long size => const char *make_human_readable_str(unsigned long long size It's OK!