summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2016-03-03 10:42:41 -0800
committerNick Kralevich <nnk@google.com>2016-03-03 10:42:41 -0800
commit0c1a5819e292891497d6aefcac9a13d9052608e2 (patch)
tree843d1f3e9289240e83c56d89abea894f4ae50759
parentcdc89940cc87d795157b4090a7b9ef5ada14e829 (diff)
downloadlibselinux-0c1a5819e292891497d6aefcac9a13d9052608e2.tar.gz
Delete SELinux mount codeandroid-n-preview-1
Mounting the SELinux filesystem is now handled by init. Delete mount code in libselinux. Change-Id: I6837241a9cc11ab149b6564f0520c7bd076ace0c
-rw-r--r--src/android.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/android.c b/src/android.c
index 75f2ed9..02dd969 100644
--- a/src/android.c
+++ b/src/android.c
@@ -1574,33 +1574,7 @@ int selinux_android_reload_policy(void)
int selinux_android_load_policy(void)
{
- const char *mnt = SELINUXMNT;
- int rc;
- rc = mount(SELINUXFS, mnt, SELINUXFS, 0, NULL);
- if (rc < 0) {
- if (errno == ENODEV) {
- /* SELinux not enabled in kernel */
- return -1;
- }
- if (errno == ENOENT) {
- /* Fall back to legacy mountpoint. */
- mnt = OLDSELINUXMNT;
- rc = mkdir(mnt, 0755);
- if (rc == -1 && errno != EEXIST) {
- selinux_log(SELINUX_ERROR,"SELinux: Could not mkdir: %s\n",
- strerror(errno));
- return -1;
- }
- rc = mount(SELINUXFS, mnt, SELINUXFS, 0, NULL);
- }
- }
- if (rc < 0) {
- selinux_log(SELINUX_ERROR,"SELinux: Could not mount selinuxfs: %s\n",
- strerror(errno));
- return -1;
- }
- set_selinuxmnt(mnt);
-
+ set_selinuxmnt(SELINUXMNT);
return selinux_android_load_policy_helper(false);
}