with tweaks from Mike Frysinger and Rob Landley.
Note: this will still fail to umount a path that contains an ' or \ character.
Is it worth the extra size to filter for that?
To: busybox@mail.codepoet.org
Wrap sockaddr_in6 in a ifdef CONFIG_FEATURE_IPV6.
Include sys/types.h instead of asm/types.h.
Include netinet/if_ether.h instead of linux/if_ether.h
The ioctl request argument is an int, not an unsigned short.
> 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....
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
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.......).
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
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
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
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.
test it before checking in..." New entry for famous last words list.)
Add the missing backslash at the end of the new sed doc string line.
(This one actually compiled with "show verbose applet usage messages"...)
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
Hi,
Well, I made this patch a long time ago (08/2002) because it was a
need of a project, but had no time to send it to you. It adds support
to `autologin' option of the telnet protocol. It has been used since
made with busybox 0.60.3 at production and I had no problems with it.
I have ported it to the HEAD revision of the CVS server (20040211) and
I hope you enjoy and apply it to the official sources. :)
Thanks a lot!
I had previously provided you with a patch to help complete busybox's
props suite, but have heard no word back. Sense then I've made use of as
many of busybox's native API settings as I could find and would really
love for you to include support for this. If there is something more I
need to do to get this supported added in please let me know.
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.
You will find in the attached file "syslog.patch" a patch which adds
config options to set at compile time the size of the circular buffer,
and some documentation update.
Hi to all,
here is a new patch for bb's devfsd. The news are:
1) Size reduction for the basic setup with no options compiled in from :
text data bss dec hex filename
10591 392 543 11526 2d06 devfsd.o
rw-r--r-- 1 root root 18536 Dec 18 21:52 devfsd.o
to:
text data bss dec hex filename
9303 392 543 10238 27fe devfsd.o
rw-r--r-- 1 root root 16528 Dec 18 22:02 devfsd.o
With this setup you should not expect much output from devfsd
( just at start or with -v) and if some error occurs it only exits 1.
To have more output enable: " Increases logging (and size)" (+1568 b).
2) The option "Adds function names to program output" was removed from config menu
and now to enable debug output you can use bb's standard option:
"Build BusyBox with Debugging symbols".
Be careful as with this option enabled a lot of data are outputted to /dev/log and/or to stderr.
3) A new option: "Enables the -fg and -np option" was added to config menu (+128 b).
BTW: option "Adds support for MODLOAD keyword in devsfd.conf" adds 268 b.
4) The following keywords in devsfd.conf are supported:
"CLEAR_CONFIG", "INCLUDE", "OPTIONAL_INCLUDE", "RESTORE",
"PERMISSIONS", "EXECUTE", "COPY", "IGNORE", "MKOLDCOMPAT",
"MKNEWCOMPAT","RMOLDCOMPAT", "RMNEWCOMPAT".
But only if they are written UPPERCASE!!!!!!!!
5)Help text in usage.h was modified.
6)Something that I have forgotten..........
I've tested this for the last week on my box and it seems to work as expected.
Thanks in advance and please apply.
Ciao,
Tito