]> code.ossystems Code Review - openembedded-core.git/commitdiff
e2fsprogs: set dir's mode correctly
authorRobert Yang <liezhi.yang@windriver.com>
Thu, 14 Sep 2017 09:13:17 +0000 (02:13 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 18 Sep 2017 10:07:22 +0000 (11:07 +0100)
Fixed:
1) in pkg_postinst task set wanted file permissions:
---> chmod -R 521 "$D/opt/my_folder"
2) generate the rootfs image

Results:
my_folder hasn't correct permissions on rootfs ext4 image -> permissions are changed to 721

But it should be 521.

[YOCTO #11652]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-create_inode.c-set-dir-s-mode-correctly.patch [new file with mode: 0644]
meta/recipes-devtools/e2fsprogs/e2fsprogs_1.43.5.bb

diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-create_inode.c-set-dir-s-mode-correctly.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-misc-create_inode.c-set-dir-s-mode-correctly.patch
new file mode 100644 (file)
index 0000000..fc4a540
--- /dev/null
@@ -0,0 +1,41 @@
+From f6d188580c2c9599319076fee22f2424652c711c Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 13 Sep 2017 19:55:35 -0700
+Subject: [PATCH] misc/create_inode.c: set dir's mode correctly
+
+The dir's mode has been set by ext2fs_mkdir() with umask, so
+reset it to the source's mode in set_inode_extra().
+
+Fixed when source dir's mode is 521, but tarball would be 721, this was
+incorrect.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ misc/create_inode.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/misc/create_inode.c b/misc/create_inode.c
+index 8ce3faf..50fbaa8 100644
+--- a/misc/create_inode.c
++++ b/misc/create_inode.c
+@@ -116,7 +116,14 @@ static errcode_t set_inode_extra(ext2_filsys fs, ext2_ino_t ino,
+       inode.i_uid = st->st_uid;
+       inode.i_gid = st->st_gid;
+-      inode.i_mode |= st->st_mode;
++      /*
++       * The dir's mode has been set by ext2fs_mkdir() with umask, so
++       * reset it to the source's mode
++       */
++      if S_ISDIR(st->st_mode)
++              inode.i_mode = LINUX_S_IFDIR | st->st_mode;
++      else
++              inode.i_mode |= st->st_mode;
+       inode.i_atime = st->st_atime;
+       inode.i_mtime = st->st_mtime;
+       inode.i_ctime = st->st_ctime;
+-- 
+2.10.2
+
index fb02d796a71f101b75468cd4907da2f359185b1d..7fba8eb0c4e3ffeb1d626dcc82020fd47eade3e3 100644 (file)
@@ -9,6 +9,7 @@ SRC_URI += "file://acinclude.m4 \
             file://Revert-mke2fs-enable-the-metadata_csum-and-64bit-fea.patch \
             file://mkdir_p.patch \
             file://reproducible-doc.patch \
+            file://0001-misc-create_inode.c-set-dir-s-mode-correctly.patch \
 "
 
 SRC_URI_append_class-native = " file://e2fsprogs-fix-missing-check-for-permission-denied.patch"