Skip to content

Commit

Permalink
fs_mgr: Drop the context mount option from non-selinux builds
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rmcc authored and daxxmax committed Jul 22, 2013
1 parent 1974d00 commit 91149f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions fs_mgr/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions fs_mgr/fs_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 91149f7

Please sign in to comment.