From 806fc566fd4544cfcd3334aa1a992bab0f6d277c Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Sun, 21 Jul 2013 14:25:47 +0100 Subject: fs_mgr: Drop the context mount option from non-selinux builds This will require that transitioning devices have context as the last mount option, since everything after it will be ignored Change-Id: Ic5cc7f5632cc3d62459dfaaf7719d662737e1641 --- fs_mgr/Android.mk | 4 ++++ fs_mgr/fs_mgr.c | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/fs_mgr/Android.mk b/fs_mgr/Android.mk index 7c66f6a..48b11b6 100644 --- a/fs_mgr/Android.mk +++ b/fs_mgr/Android.mk @@ -3,6 +3,10 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) +ifeq ($(HAVE_SELINUX),true) +LOCAL_CFLAGS += -DHAVE_SELINUX +endif + LOCAL_SRC_FILES:= fs_mgr.c LOCAL_C_INCLUDES := $(LOCAL_PATH)/include diff --git a/fs_mgr/fs_mgr.c b/fs_mgr/fs_mgr.c index 99adb81..848743c 100644 --- a/fs_mgr/fs_mgr.c +++ b/fs_mgr/fs_mgr.c @@ -456,6 +456,15 @@ int fs_mgr_mount_all(char *fstab_file) } for (i = 0; fstab[i].blk_dev; i++) { +#ifndef HAVE_SELINUX + char *contextpos = strstr(fstab[i].fs_options,",context="); + + /* This makes it mandatory that context is the LAST mount option */ + if (contextpos != NULL) { + *contextpos='\0'; + } +#endif + if (fstab[i].fs_mgr_flags & MF_WAIT) { wait_for_file(fstab[i].blk_dev, WAIT_TIMEOUT); } -- cgit v1.1