procd: initd: fix path allocation in early_insmod Noticed that /tmp was not being created on /dev/zram0. This was on ixp4xx (nslu2) using GCC 6.3 and musl. The allocation should be using the length of the passed string (module path), not the size of the pointer to the string. Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>
make /var/{run, lock, state} not world writable (0755) since commit be950c5e56b86509e1e237931d0ac8203372be82 (09/03/2013) /var/{run,lock,state} are world writable (0777) which is a security issue before that they were created by /etc/init.d/boot with normal permissions (0755), so revert to that state Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>
Align early init PATH with system wide OpenWrt path value Changeset r47080 globally unified the executable search path in OpenWrt, now update procd to use the same path value. This fixes diverging path values observed in programs launched by netifd which inherits the early path value from procd. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
explicitely ignore return value of symlink(3) call glibc sets __attribute_warn_unused_result__ on symlink(3) if FORTIFY_SOURCE is set. This breaks procd which deliberately ignores the result of the symlink(3) call early during init as there wouldn't be anything better to do in that case other than ignoring the error and trying to survive. Introduce libc-compat.h to work-around libc anomalities. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Add MS_NODEV MS_NOEXEC MS_NOSUID mount options where needed These options aren't mandatory, but can prevent some future bugs from being exploited. Good reading: http://lwn.net/Articles/647757/ Value chosen by looking at fedora 22 / ubuntu 14.04 Not tested yet (away from my tests routers) Not touching jail/jail.c as this conflict with my pending patch serie Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>