]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
AOSP: e2fsdroid: remove extra "/" when mountpoint is "/"
authorJin Qian <jinqian@google.com>
Thu, 15 Dec 2016 20:15:28 +0000 (12:15 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 24 May 2017 02:49:39 +0000 (22:49 -0400)
Extra "/" causes problem when matching entries in fs_config.

Change-Id: Ie1659b98db3d599cdd1a832d2dfb3036d399a6e3
From AOSP commit: 7fe49140ef755e98607a67199971c01ed6a96930

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
contrib/android/perms.c

index 6a5441891a981080662b82a3b784222066b305fd..64bae25e2406f87227e9e464b3a21c7d4c6bf8c5 100644 (file)
@@ -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, &params);
        if (retval)
                return retval;