Cleanup fs_getline from fs_mgr

Since getline is included in bionic, fs_mgr can use this version instead of
the one defined internally by fs_getline.

Replace fs_getline with getline.

Change-Id: I49b53d639bd995f051256fb7573ff6ab45d9c36d
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Fix fstab memory leak

When reading the fstab config file fails, fstab memory is not freed.
When fstab structure is no longer needed, only half of it is freed.

Free fstab memory in all cases (error or when it is no longer needed).

Change-Id: Ib0758a5aaa69505285bf64143632986a2dbbdccb
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
cutils: Add general string functions

Introduces "cutils/str.h" and str.c, which will be used
for general string functions. First functions added
are replace() and replace_all()

Change-Id: If55edcb8c5278cff0047bccf3ce482b2a3d68294
Use kernel splitlog feature

Android auditd needs to attempt to send the logs
to both the kernel and userspace if a userspace
auditd is enabled.

Change-Id: Ied152495c731fd719f7d4dfd34e658dfa76759fa
Signed-off-by: William Roberts <w.roberts@sta.samsung.com>

Conflicts:
	auditd/auditd.c
	auditd/libaudit.c
	auditd/libaudit.h
init: Fix get_hardware_name() to cope with long /proc/cpuinfo output

get_hardware_name() uses a fixed size buffer to slurp the contents of
/proc/cpuinfo into and with newer multicore systems this is not big
enough, leading to the inability to pick up the hardware name.

Fix this by using a dynamically allocated, exponentially growing buffer.

Change-Id: I51c6c276b6e110f462839e205a4428adc6656e75
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Trigger a policy reload from post-fs-data.

Once userdata is available and decrypted, trigger a policy reload to pick
up any policy update files stored under /data/security.

Change-Id: Ic2b3121c3395429b108c40d1d7f5a3124a5896c5
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Do not change ownership of /sys/fs/selinux/load to system UID.

Policy reload is handled by setting the selinux.reload_policy property
and letting the init process perform the actual loading of policy into
the kernel.  Thus, there should be no need for the system UID to directly
write to /sys/fs/selinux/load.

Change-Id: I240c5bb2deaee757a2e1e396e14dea9e5d9286f5
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>