From: Jin Qian Date: Thu, 15 Dec 2016 20:15:28 +0000 (-0800) Subject: AOSP: e2fsdroid: remove extra "/" when mountpoint is "/" X-Git-Tag: v1.44.0-rc1~99 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=d838f79e7f8c77fa9d5a71eb5e805644cded6607;p=tools%2Fe2fsprogs.git 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 --- 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;