aboutsummaryrefslogtreecommitdiff
path: root/libbb (follow)
Commit message (Collapse)AuthorAgeFilesLines
* No longer neededandersen2004-09-021-55/+0
| | | | git-svn-id: svn://busybox.net/trunk/busybox@9198 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Tito writes:andersen2004-09-023-5/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.......). git-svn-id: svn://busybox.net/trunk/busybox@9194 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Tito writes:andersen2004-08-263-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: svn://busybox.net/trunk/busybox@9165 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Felipe Kellermann writes:andersen2004-08-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 :-) git-svn-id: svn://busybox.net/trunk/busybox@9162 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Use __kernel_old_dev_t for 2.6.x kernelsandersen2004-08-161-0/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@9099 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Aurelien Jacobs writes:andersen2004-08-161-3/+1
| | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: svn://busybox.net/trunk/busybox@9098 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from solar to fix problems with get_name()andersen2004-08-121-23/+28
| | | | git-svn-id: svn://busybox.net/trunk/busybox@9088 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Tito to fix memory leak upon error.bug12004-08-111-2/+3
| | | | git-svn-id: svn://busybox.net/trunk/busybox@9085 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Tito, farmatito at tiscali dot it writes:andersen2004-08-031-2/+6
| | | | | | | | | | | | | | 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 git-svn-id: svn://busybox.net/trunk/busybox@9056 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Clean up hex escape support.mjn32004-07-291-21/+43
| | | | git-svn-id: svn://busybox.net/trunk/busybox@9038 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Felipe Kellermann noticed a missing `break'.andersen2004-07-271-0/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@9030 69ca8d6d-28ef-0310-b511-8ec308f3f277
* bother. unrevert my fix.andersen2004-07-261-16/+23
| | | | git-svn-id: svn://busybox.net/trunk/busybox@9024 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Allow hex escape sequencesandersen2004-07-261-23/+16
| | | | git-svn-id: svn://busybox.net/trunk/busybox@9022 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Allow hex escape sequencesandersen2004-07-261-16/+23
| | | | git-svn-id: svn://busybox.net/trunk/busybox@9016 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix for a bug identied by Harald Kuthe, when using many interfaces (29 bug12004-07-231-18/+13
| | | | | | | in this case) the order was incorrect and there were duplicate entries. git-svn-id: svn://busybox.net/trunk/busybox@9005 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Felipe Kellermann, "There is a call to printf using `*pr-cchar'bug12004-07-231-1/+1
| | | | | | | referencing a string and using a single char, when *p <= 0x1f." git-svn-id: svn://busybox.net/trunk/busybox@9003 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Revert my previous commitbug12004-06-251-3/+4
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8927 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix compile error under 2.6, check for newer versions first or all thebug12004-06-251-3/+3
| | | | | | | checks wont be considered. git-svn-id: svn://busybox.net/trunk/busybox@8926 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Bastian Blank:andersen2004-06-222-46/+1
| | | | | | | | | | | | | | 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 git-svn-id: svn://busybox.net/trunk/busybox@8913 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Add part of a patch from Vernon Sauder that i missed a while backbug12004-05-021-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8797 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Do not use getpass(3)andersen2004-05-013-3/+90
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8793 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Dont try and preserve hard links to directories.bug12004-04-191-1/+3
| | | | | | | | | | The linux kernel doesnt allow hard links to directories, SUS says its implementation specific. cramfs gives empty directories and 0 length files the same node it makies it difficult to distinguish from hard links. git-svn-id: svn://busybox.net/trunk/busybox@8767 69ca8d6d-28ef-0310-b511-8ec308f3f277
* remove a warningandersen2004-04-141-2/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8760 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Larry Doolittle writes:andersen2004-04-1411-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | This is a bulk spelling fix patch against busybox-1.00-pre10. If anyone gets a corrupted copy (and cares), let me know and I will make alternate arrangements. Erik - please apply. Authors - please check that I didn't corrupt any meaning. Package importers - see if any of these changes should be passed to the upstream authors. I glossed over lots of sloppy capitalizations, missing apostrophes, mixed American/British spellings, and German-style compound words. What is "pretect redefined for test" in cmdedit.c? Good luck on the 1.00 release! - Larry git-svn-id: svn://busybox.net/trunk/busybox@8759 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Vladimir N. Oleynik writes:andersen2004-04-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Hi. Last changes (rev 1.12) to recursive_actions() by Christian Grigis have problem. Test for demonstrate: $ mkdir aaa bbb ccc $ su # chown root bbb # chmod 700 bbb # exit $ busybox chmod 777 -R . ./bbb: Permision denied But "./ccc" mode not changed. Previous variant works fine, errors skiped and continued recursion. --w vodz git-svn-id: svn://busybox.net/trunk/busybox@8725 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Christian Grigis, christian.grigis at smartdata dot ch writes:andersen2004-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hello everyone, Busybox's insmod fails to locate a module when that module is the only one existing in the /lib/modules directory (with a unique name). Example: # find /lib/modules/ -type f /lib/modules/kernel/drivers/char/bios.o # insmod bios insmod: bios.o: no module by that name found # touch /lib/modules/dummy # find /lib/modules/ -type f /lib/modules/kernel/drivers/char/bios.o /lib/modules/dummy # insmod bios Using /lib/modules/kernel/drivers/char/bios.o As long as there is another file in the /lib/modules directory, insmod finds it OK. I tracked the problem down to 'check_module_name_match()' in insmod.c: It returns TRUE when a match is found, and FALSE otherwise. In the case where there is only one module in the /lib/modules directory (or more that one module, but all with the same name), 'recursive_action()' will return TRUE and we end up on line 4196 in 'insmod.c' which returns an error. [The reason it works with more than one module with different names is that in this case there will always be one not matching, 'recursive_action()' will return FALSE and we end up in line 4189.] Now, from the implementation of 'recursive_action()' and from other usages of it (tar.c, etc.), it seems to me that FALSE should be returned to indicate that we want to stop the recursion, so TRUE and FALSE should be inverted in 'check_module_name_match()'. At the same time, 'recursive_action()' continues to recurse even after the recursive call has returned FALSE; again in my understanding and other usages of it, we can safely stop recursing at this point. Here is my patch against 1.00-pre8: git-svn-id: svn://busybox.net/trunk/busybox@8697 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Add missing include filesandersen2004-03-272-0/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8665 69ca8d6d-28ef-0310-b511-8ec308f3f277
* s/fileno\(stdin\)/STDIN_FILENO/gandersen2004-03-272-2/+2
| | | | | | | s/fileno\(stdout\)/STDOUT_FILENO/g git-svn-id: svn://busybox.net/trunk/busybox@8663 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Brian Pomerantz writes:andersen2004-03-231-1/+1
| | | | | | | | | | | | | | | | | | | I've noticed a bug in the "autowidth" feature more, and is probably in others. The call to the function get_terminal_width_height() passes in a file descriptor but that file descriptor is never used, instead the ioctl() is called with 0. In more_main() the call to get_terminal_width_height() passes 0 as the file descriptor instead of fileno(cin). This isn't a problem when you more a file (e.g. "more /etc/passwd") but when you pipe a file to it (e.g. "cat /etc/passwd | more") the size of the terminal cannot be determined because file descriptor 0 is not a terminal. The fix is simple, I've attached a patch for more.c and get_terminal_width_height.c. BAPper git-svn-id: svn://busybox.net/trunk/busybox@8656 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Remove trailing whitespace. Update copyright to include 2004.andersen2004-03-1570-135/+135
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8630 69ca8d6d-28ef-0310-b511-8ec308f3f277
* In spite of the feature freeze, check in a complete rework of route whichmjn32004-03-101-2/+2
| | | | | | | | | | | fixes some bugs, adds some error checking, and removes _lots_ of bloat. Text size on i386... old new ipv6 5425 3523 no ipv6 3143 2193 git-svn-id: svn://busybox.net/trunk/busybox@8607 69ca8d6d-28ef-0310-b511-8ec308f3f277
* My bug. :-(mjn32004-03-081-0/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8600 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix/eliminate use of atolandersen2004-03-062-3/+102
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8598 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Don't build these support functions for uClibc, as it always suppliesmjn32004-03-061-0/+4
| | | | | | | versions. git-svn-id: svn://busybox.net/trunk/busybox@8593 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Vernon Sauder.bug12004-03-051-1/+1
| | | | | | | | | The off_t type is not a consistent size; it depends on the kernel options (something about large file support). Therefore, the format string for printing an address is not always the same. git-svn-id: svn://busybox.net/trunk/busybox@8571 69ca8d6d-28ef-0310-b511-8ec308f3f277
* bb_full_fd_action was incorrectly returning an error message causingbug12004-02-231-2/+2
| | | | | | | major breaking. git-svn-id: svn://busybox.net/trunk/busybox@8552 69ca8d6d-28ef-0310-b511-8ec308f3f277
* For the time being, revert the changes for detecting copyingandersen2004-02-221-6/+0
| | | | | | | | | a directory into itself. It is harder to do this correctly than it appears. Not trying at all seems a better compromise for the time being, untill we can implement this correctly. git-svn-id: svn://busybox.net/trunk/busybox@8547 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Sometimes i get carried away with the use of function pointers, im surebug12004-02-211-5/+5
| | | | | | | it seemed like a good idea at the time. git-svn-id: svn://busybox.net/trunk/busybox@8531 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Chris Larson (kergoth) writes:andersen2004-02-191-16/+6
| | | | | | | | | | | | | | As Manuel points out, this is a flawed fix, and doesnt fix the following: mkdir -p cpa cpb cpc cp -a cpa cpa/cpb/cpc Attached what appears to be a more sane fix. Apply on top of previous. Please confirm sanity. git-svn-id: svn://busybox.net/trunk/busybox@8517 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Chris Larson (kergoth) writes:andersen2004-02-191-0/+16
| | | | | | | | | | | | | | | | I was adding -s/--symbolic-link support to busybox cp when I noticed a bug with -r/-a. Test case: mkdir -p test/out cd test busybox cp -a * out/ Will never return until we run out of open files or similar. Coreutils cp on the other hand will error with "cannot copy a directory, `out', into itself, `out'". Patch attached. git-svn-id: svn://busybox.net/trunk/busybox@8516 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Accomodate the fact that newer libc versions may in fact notandersen2004-02-131-6/+29
| | | | | | | contain query_module and friends and more git-svn-id: svn://busybox.net/trunk/busybox@8464 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Make the loop support stuff be much less evil, and make it copeandersen2004-02-064-81/+34
| | | | | | | | | | | | with 2.6.x asm/posix_types.h, which has done singularly evil thing by yanking __kernel_dev_t and renaming it. The loop interface was really poorly designed in the first place. The new 64 bit loop interface looks to be somewhat less horrible, too bad it is only present in 2.6.x kernels. -Erik git-svn-id: svn://busybox.net/trunk/busybox@8418 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Vladimir N. Oleynik writes:andersen2004-02-051-3/+1
| | | | | | | | | | | Ok. I found my mistake :( The trivial patch attached. --w vodz git-svn-id: svn://busybox.net/trunk/busybox@8410 69ca8d6d-28ef-0310-b511-8ec308f3f277
* The variable 'complementaly' used to be allocated with calloc, which zeroed itandersen2004-02-041-0/+2
| | | | | | | | | | | | out during the allocation process. When vodz changed it to be allocated on the stack, he forgot to explicitly zero it, leaving its value filled with whatever used to be sitting on the stack. It would garbage values, depending on the garbage that happened to be sitting on the stack when the function was called. The result was that applets using bb_getopt_ulflags() were showing unpredictable behavior (such as segfaults), which naturally broke many things. git-svn-id: svn://busybox.net/trunk/busybox@8397 69ca8d6d-28ef-0310-b511-8ec308f3f277
* s/u_int/unsigned int/gandersen2004-01-301-4/+4
| | | | | | | s/u_short/unsigned short/g git-svn-id: svn://busybox.net/trunk/busybox@8375 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Use proper C99 types throughout. So not use silly typedefs.andersen2004-01-301-47/+44
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8373 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Support new uClibc stdio core.mjn32004-01-301-4/+8
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8369 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Apply a couple of optimizationsandersen2004-01-291-3/+5
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8363 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Teach busybox ps to get the correct uid when displaying stuffandersen2004-01-271-3/+5
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8355 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Vodz, last_patch_123, patch have new version getopt_ulflags.bug12004-01-221-28/+20
| | | | | | | | | - size reduced 34 bytes - don`t use dynamic memory allocation - small indent correction. git-svn-id: svn://busybox.net/trunk/busybox@8332 69ca8d6d-28ef-0310-b511-8ec308f3f277