Fixed
Created: Aug 24, 2014
Updated: Dec 3, 2018
Resolved Date: Apr 2, 2015
Previous ID: LIN5-19304
Found In Version: 6.0
Fix Version: 6.0.0.19
Severity: Standard
Applicable for: Wind River Linux 6
Component/s: Kernel
In wrlinux 5, simple file permissions are not being retained when copying the file created on a yaffs partition
touch file1
chmod 777 file1
cp -a file1 file2
ls -la file*
-rwxrwxrwx 1 root root 0 Aug 11 08:28 file1
-rwx------ 1 root root 0 Aug 11 08:28 file2
Currently the YAFFS2 fs seems support xarrt but it can't works in order with other kernel mechanism and common user space tools as other file systems. So please just remove this feature as below:
--- a/fs/yaffs2/yaffs_vfs.c
+++ b/fs/yaffs2/yaffs_vfs.c
@@ -624,10 +634,12 @@ static const struct inode_operations yaffs_dir_inode_operations = {
.mknod = yaffs_mknod,
.rename = yaffs_rename,
.setattr = yaffs_setattr,
+#if 0
.setxattr = yaffs_setxattr,
.getxattr = yaffs_getxattr,
.listxattr = yaffs_listxattr,
.removexattr = yaffs_removexattr,
+#endif
};
/*-----------------------------------------------------------------*/
/* Directory search context allows us to unlock access to yaffs during
@@ -1785,10 +1797,12 @@ static const struct address_space_operations yaffs_file_address_operations = {
static const struct inode_operations yaffs_file_inode_operations = {
.setattr = yaffs_setattr,
+#if 0
.setxattr = yaffs_setxattr,
.getxattr = yaffs_getxattr,
.listxattr = yaffs_listxattr,
.removexattr = yaffs_removexattr,
+#endif
};
static const struct inode_operations yaffs_symlink_inode_operations = {
@@ -1796,10 +1810,12 @@ static const struct inode_operations yaffs_symlink_inode_operations = {
.follow_link = yaffs_follow_link,
.put_link = yaffs_put_link,
.setattr = yaffs_setattr,
+#if 0
.setxattr = yaffs_setxattr,
.getxattr = yaffs_getxattr,
.listxattr = yaffs_listxattr,
.removexattr = yaffs_removexattr,
+#endif
};
static void yaffs_fill_inode_from_obj(struct inode *inode,
--enable-reconfig --enable-kernel=standard --enable-rootfs=glibc_std+debug --enable-board=eri-siu02 --enable-test=yes --with-template=feature/analysis
build & boot
touch file1
chmod 777 file1
cp -a file1 file2
ls -la file*