Changeset 8847142 in mainline for uspace/lib/ext4/libext4_filesystem.c


Ignore:
Timestamp:
2012-07-28T10:41:18Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c1b0c750
Parents:
f9c3ef44
Message:

Added default file/dir permissions due to compatibility reasons

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ext4/libext4_filesystem.c

    rf9c3ef44 r8847142  
    703703        ext4_inode_t *inode = (*inode_ref)->inode;
    704704
     705        uint16_t mode;
    705706        if (is_dir) {
    706                 ext4_inode_set_mode(fs->superblock, inode, EXT4_INODE_MODE_DIRECTORY);
     707                /*
     708                 * Default directory permissions to be compatible with other systems
     709                 * 0777 (octal) == rwxrwxrwx
     710                 */
     711                mode = 0777;
     712                mode |= EXT4_INODE_MODE_DIRECTORY;
     713                ext4_inode_set_mode(fs->superblock, inode, mode);
    707714                ext4_inode_set_links_count(inode, 1); /* '.' entry */
    708715        } else {
    709                 ext4_inode_set_mode(fs->superblock, inode, EXT4_INODE_MODE_FILE);
     716                /*
     717                 * Default file permissions to be compatible with other systems
     718                 * 0666 (octal) == rw-rw-rw-
     719                 */
     720
     721                mode = 0666;
     722                mode |= EXT4_INODE_MODE_FILE;
     723                ext4_inode_set_mode(fs->superblock, inode, mode);
    710724                ext4_inode_set_links_count(inode, 0);
    711725        }
Note: See TracChangeset for help on using the changeset viewer.