diff options
author | Nick Kralevich <nnk@google.com> | 2013-11-27 21:09:12 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2013-11-27 21:09:13 +0000 |
commit | bef08b8d1b30976ff273fc9041bc8d934f52fea9 (patch) | |
tree | 9f8511b6eace76407c67c98b1b2e73091e75aa17 /cmds/installd | |
parent | 63b62e8cd48176abbfddb6bd67c138ae447f6ac7 (diff) | |
parent | bd558d61871218f5b13df2fe4b7cc3b530ee947c (diff) | |
download | frameworks_native-bef08b8d1b30976ff273fc9041bc8d934f52fea9.zip frameworks_native-bef08b8d1b30976ff273fc9041bc8d934f52fea9.tar.gz frameworks_native-bef08b8d1b30976ff273fc9041bc8d934f52fea9.tar.bz2 |
Merge "Handle policy reloads within installd rather than restarting it."
Diffstat (limited to 'cmds/installd')
-rw-r--r-- | cmds/installd/installd.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c index a2cbccc..f52cee0 100644 --- a/cmds/installd/installd.c +++ b/cmds/installd/installd.c @@ -16,6 +16,8 @@ #include <sys/capability.h> #include <linux/prctl.h> +#include <selinux/android.h> +#include <selinux/avc.h> #include "installd.h" @@ -526,6 +528,7 @@ int main(const int argc, const char *argv[]) { struct sockaddr addr; socklen_t alen; int lsocket, s, count; + int selinux_enabled = (is_selinux_enabled() > 0); ALOGI("installd firing up\n"); @@ -539,6 +542,11 @@ int main(const int argc, const char *argv[]) { exit(1); } + if (selinux_enabled && selinux_status_open(true) < 0) { + ALOGE("Could not open selinux status; exiting.\n"); + exit(1); + } + drop_privileges(); lsocket = android_get_control_socket(SOCKET_PATH); @@ -577,6 +585,9 @@ int main(const int argc, const char *argv[]) { break; } buf[count] = 0; + if (selinux_enabled && selinux_status_updated() > 0) { + selinux_android_seapp_context_reload(); + } if (execute(s, buf)) break; } ALOGI("closing connection\n"); |