diff options
| author | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2013-07-21 14:25:47 +0100 |
|---|---|---|
| committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2013-07-22 14:22:03 +0100 |
| commit | 9df8c473782968493bd4b71426e6e1bffadeaa79 (patch) | |
| tree | e46fb119ad1a4b6425df03745e4ef1b0f98098f6 | |
| parent | 3cd83bf7814ac2f138c79bc58c95f95494e0b1ce (diff) | |
| download | system_core-9df8c473782968493bd4b71426e6e1bffadeaa79.tar.gz system_core-9df8c473782968493bd4b71426e6e1bffadeaa79.tar.bz2 system_core-9df8c473782968493bd4b71426e6e1bffadeaa79.zip | |
fs_mgr: Drop the context mount option from non-selinux builds
Transitioning devices may have the context option present in the
fstab, even if we're not doing selinux builds.
Since we don't set or even create the contexts on those builds,
this will make mount fail, and either the mountpoint ends up absent,
or boot fails entirely
Change-Id: Ic5cc7f5632cc3d62459dfaaf7719d662737e1641
| -rw-r--r-- | fs_mgr/Android.mk | 4 | ||||
| -rw-r--r-- | fs_mgr/fs_mgr.c | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/fs_mgr/Android.mk b/fs_mgr/Android.mk index 7c66f6ab..48b11b69 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 99adb81d..361cf5ca 100644 --- a/fs_mgr/fs_mgr.c +++ b/fs_mgr/fs_mgr.c @@ -147,8 +147,14 @@ static int parse_flags(char *flags, struct flag_list *fl, char **key_loc, /* It's not a known flag, so it must be a filesystem specific * option. Add it to fs_options if it was passed in. */ - strlcat(fs_options, p, fs_options_len); - strlcat(fs_options, ",", fs_options_len); +#ifndef HAVE_SELINUX + /* Drop context option from non-selinux builds */ + if (strncmp(p,"context=",8)) +#endif + { + strlcat(fs_options, p, fs_options_len); + strlcat(fs_options, ",", fs_options_len); + } } else { /* fs_options was not passed in, so if the flag is unknown * it's an error. |
