[PATCH] 2nd attempt at deluser/delgroup size reduction and improvements
Tito
farmatito at tiscali.it
Sun Oct 3 19:18:52 UTC 2010
Hi,
this patch partially reduces size of deluser/delgroup and adds better
error checking and a few additional features:
Pros:
1) size increase vs functionality is not bad. With all options enabled:
scripts/bloat-o-meter busybox_old busybox_unstripped
function old new delta
deluser_main 189 214 +25
.rodata 134994 135016 +22
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 47/0) Total: 47 bytes
2) proper error checking and reporting if removing non existent user/group
3) proper error checking and reporting if removing primary group of a user
4) deluser also removes user's primary group if ENABLE_DELGROUP is set, so no leftovers
5) maximum dead code optimization by the compiler with different options turned off
Contra:
1) code is obfuscated, sorry can't do nothing about that it's my style.
2) Not known ....yet :-)
The patch is tested and seems to work well for me.
More testing by the list members is appreciated.
Hints, critics and improvements by the list members are welcome.
Please apply if you like it.
Attached you'll find also a drop in deluser,c file
for testing and review as the patch is rather big.
Ciao,
Tito
-------------- next part --------------
A non-text attachment was scrubbed...
Name: deluser03.patch
Type: text/x-diff
Size: 2550 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20101003/59abfd75/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: deluser.c
Type: text/x-csrc
Size: 1562 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20101003/59abfd75/attachment-0001.c>
More information about the busybox
mailing list