logd: liblog: logcat: enable prune features for user

- Enable whitelist, blacklist and logsize tuneables for user

Change-Id: Id0c283844c71c5263a8cfbebf2e550f7ac415858
Handle errno properly to avoid corrupt str_parms

A normal sequence of calls is as follows:
str_parms_create_str, str_parms_add_str, str_parms_destroy.
In some cases the destroy caused double free.

str_parms_add_str will clone the input and send it to hashmapPut
for storage. If hashmapPut did not store the strings it will raise
errno = ENOMEM and leave caller with ownership of the strings.
In any of these cases it will be safe to destroy the str_parms.

But what if it wasn't hashmapPut that said NOMEM? What if there
was a stale NOMEM already before a successful hashmapPut?
In that case the strings will be successfully added to the list
(if new), but when str_parms_add_str sees the NOMEM it will free
them anyway, leaving dangling pointers in the str_parms!!

It is the responsibility of the caller to clear errno before any
interesting call. This patch makes sure that str_parms_add_str
reacts only on errno emmitted from hashmapPut.

Change-Id: If87e4bcc482f09e1c66133d33517b152ebdac65f
Merge "Handle errno properly to avoid corrupt str_parms"
Create an UnwindMapLocal object.

The way libunwind handles local unwinds is different from remote unwinds,
so create a new map object to handle the differences.

Add new test to verify the map data is being generated correctly.

Add new tests to check for leaks.

Refactor the BACK_LOGW code into a single header file.

Change-Id: I01f3cbfc4b927646174ea1b614fa25d23b9b3427
Merge "Create an UnwindMapLocal object."
logd: transitory reader thread create should be detached

Bug: 13692914
Change-Id: Ia7306e6e844ae9f17c6f594bf6b25f3148652570
Merge "logd: transitory reader thread create should be detached"
logd: Add pidToName helper

Change-Id: Idd8e804ab65feb8dc432150ae701464de1ad5302
logd: Add pidToUid helper

Change-Id: I23ebae1957c027bff6cbc2573a227bf0c44c08a2
logd: selinux auditd initial commit

Initial commit for an audit daemon that writes kernel audit
messages to the Android logger. The daemon searches dmesg
for all lines that contain "audit" and writes them. Then
receiving the messages from the netlink socket.

It also formats the messages so they are compatable with
ausearch (type=<t> <m> format)

Modified: Mark Salyzyn <salyzyn@google.com>

- do not start auditd
- merge into logd, stripping unnecessary file logging.
- Convert headers and code to support C++
- Fix bugs in libaudit
- squash timestamp (replace with 0.0) due to duplication
- squash pid due to duplication
- squash comm due to duplication

Change-Id: I421bcf33e7e670d596628b1b5c7c25536ce2d3fe
logd: auditd: add logd.auditd.dmesg property

Change-Id: If4a579c2221eec99cf3f6acf59ead8c2d5230517
Merge "logd: Add pidToName helper"
Merge "logd: Add pidToUid helper"
Merge "logd: selinux auditd initial commit"
Merge "logd: auditd: add logd.auditd.dmesg property"
logd: Turn off default prune by worst UID

- Algorithm places too much weight on stack dumps

Change-Id: Ibb31a59892870397b780965ec791f47a4ce87eaf
Merge "logd: Turn off default prune by worst UID"
Enable world-readable selinuxfs policy binary.

Change-Id: I1eefb457cea1164a8aa9eeb7683b3d99ee56ca99
Add guards to prevent typedefs when C++11 is available.

char32_t and char16_t are both defined in C++11.

Change-Id: I44fe8f4f05f230c18a1b77fa21b6a40c8f8ecc2d
Merge "Add guards to prevent typedefs when C++11 is available."