From d838f79e7f8c77fa9d5a71eb5e805644cded6607 Mon Sep 17 00:00:00 2001 From: Jin Qian Date: Thu, 15 Dec 2016 12:15:28 -0800 Subject: [PATCH] AOSP: e2fsdroid: remove extra "/" when mountpoint is "/" Extra "/" causes problem when matching entries in fs_config. Change-Id: Ie1659b98db3d599cdd1a832d2dfb3036d399a6e3 From AOSP commit: 7fe49140ef755e98607a67199971c01ed6a96930 Signed-off-by: Theodore Ts'o --- contrib/android/perms.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/android/perms.c b/contrib/android/perms.c index 6a54418..64bae25 100644 --- a/contrib/android/perms.c +++ b/contrib/android/perms.c @@ -245,9 +245,13 @@ errcode_t __android_configure_fs(ext2_filsys fs, char *target_out, .sehnd = sehnd, .fixed_time = fixed_time, .path = mountpoint, - .filename = mountpoint, + .filename = mountpoint, }; + /* walk_dir will add the "/". Don't add it twice. */ + if (strlen(mountpoint) == 1 && mountpoint[0] == '/') + params.path = ""; + retval = set_selinux_xattr(fs, EXT2_ROOT_INO, ¶ms); if (retval) return retval; -- 1.8.3.1