[Android Software/Hacking General [Developers Only]] dk_zero-cool:
Put these permissions in your updater and remove the once you have, all of them.

set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 3004, 02755, "/system/bin/ping");
set_perm(0, 2000, 06750, "/system/bin/run-as");
set_perm_recursive(1002, 1002, 0755, 0440, "/system/etc/bluetooth");
set_perm(0, 0, 0755, "/system/etc/bluetooth");
set_perm(1000, 1000, 0640, "/system/etc/bluetooth/auto_pairing.conf");
set_perm(3002, 3002, 0444, "/system/etc/bluetooth/blacklist.conf");
set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
set_perm(1014, 2000, 0750, "/system/etc/dhcpcd/dhcpcd-hook");
set_perm_recursive(0, 2000, 0755, 0750, "/system/etc/init.d");
set_perm_recursive(0, 2000, 0755, 0755, "/system/etc/boot.d");
set_perm(0, 0, 0755, "/system/etc/init.d");
set_perm(0, 0, 0755, "/system/etc/boot.d");
set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor");
set_perm_recursive(0, 0, 0755, 0644, "/system/vendor/firmware");
set_perm(0, 2000, 0755, "/system/vendor/firmware");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
set_perm(0, 0, 06755, "/system/xbin/librank");
set_perm(0, 0, 06755, "/system/xbin/procmem");
set_perm(0, 0, 06755, "/system/xbin/procrank");
set_perm(0, 0, 06755, "/system/xbin/su");
set_perm(0, 0, 06755, "/system/xbin/tcpdump");

Also you really should replace most of these toolbox link with busybox links instead. Half of them is not even in toolbox, and the rest is so damn limited that they break the shell.

The best option is to symlink my busybox to /system/xbin/busybox so that you don't have two of them. And then use my busybox installer to setup the correct busybox/toolbox environment.

Save this in the root of your ZIP, named "busybox_install"

#!/sbin/sh

BB=/system/xbin/busybox
TB=/system/bin/toolbox

TB_BIN="watchprops wipe vmstat date uptime reboot getevent getprop setprop id iftop ioctl ionice log lsof nandread newfs_msdos notify ps r su schedtop sendevent setconsole setprop sleep smd start stop top"
BB_BIN=`$BB --list`

for i in $BB_BIN; do
# Replace toolbox link if it exists in /system/bin
if busybox [ -L /system/bin/$i ]; then
busybox rm -f /system/bin/$i;
busybox ln -s $BB /system/bin/$i

# Make sure that we don't have two links
if [ -L /system/xbin/$i ]; then
busybox rm -f /system/xbin/$i;
fi

# Otherwise replace it if it exists in /system/xbin
elif busybox [ -L /system/xbin/$i ]; then
busybox rm -f /system/xbin/$i;
busybox ln -s $BB /system/xbin/$i

# If no toolbox link exists, make sure that we do no replace a real binary
elif busybox [ ! -f /system/bin/$i ] && busybox [ ! -f /system/xbin/$i ]; then
busybox ln -s $BB /system/bin/$i
fi
done

for i in $TB_BIN; do
if busybox [ -L /system/bin/$i ]; then
busybox rm -f /system/bin/$i;
busybox ln -s $TB /system/bin/$i

elif busybox [ -L /system/xbin/$i ]; then
busybox rm -f /system/xbin/$i;
busybox ln -s $TB /system/xbin/$i

elif busybox [ ! -f /system/bin/$i ] && busybox [ ! -f /system/xbin/$i ]; then
busybox ln -s $TB /system/bin/$i
fi
done

Then add this to your updater script

symlink("/system/xbin/busybox.m2sd", "/system/xbin/busybox");
package_extract_file("busybox_install", "/tmp/busybox_install");
set_perm(0, 0777, 0777, "/tmp/busybox_install");
run_program("/tmp/busybox_install", "");

It will provide you with a much much better working shell.