diff --git a/kernel/trunk/fs/ext2/ext2.asm b/kernel/trunk/fs/ext2/ext2.asm index 13c5301552..ed5873fc78 100644 --- a/kernel/trunk/fs/ext2/ext2.asm +++ b/kernel/trunk/fs/ext2/ext2.asm @@ -744,7 +744,7 @@ ext2_Read: ; Output: eax = error code. ;--------------------------------------------------------------------- ext2_GetFileInfo: - ;DEBUGF 1, "Calling for file info.\n" + ;DEBUGF 1, "Calling for file info, for: %s.\n", esi call ext2_lock mov edx, [ebx + 16] cmp byte [esi], 0 @@ -762,7 +762,6 @@ ext2_GetFileInfo: push eax call ext2_unlock pop eax - ;DEBUGF 1, "Returning with: %x.\n", eax ret @@ -1164,7 +1163,7 @@ ext2_CreateFolder: pop edi mov ebx, [ebp + EXTFS.ext2_temp_inode] - mov [ebx + EXT2_INODE_STRUC.i_mode], EXT2_S_IFDIR + mov [ebx + EXT2_INODE_STRUC.i_mode], EXT2_S_IFDIR or PERMISSIONS mov eax, edx call ext2_inode_write test eax, eax @@ -1344,7 +1343,7 @@ ext2_Rewrite: pop edi mov ebx, [ebp + EXTFS.ext2_temp_inode] - mov [ebx + EXT2_INODE_STRUC.i_mode], EXT2_S_IFREG + mov [ebx + EXT2_INODE_STRUC.i_mode], EXT2_S_IFREG or PERMISSIONS mov eax, edx call ext2_inode_write test eax, eax @@ -1451,8 +1450,8 @@ ext2_Write: ; Check if it's a file. mov edx, [ebp + EXTFS.ext2_save_inode] - cmp [edx + EXT2_INODE_STRUC.i_mode], EXT2_S_IFREG - jne .error + test [edx + EXT2_INODE_STRUC.i_mode], EXT2_S_IFREG + jz .error mov eax, esi mov ecx, [ebx + 4] diff --git a/kernel/trunk/fs/ext2/ext2.inc b/kernel/trunk/fs/ext2/ext2.inc index 68d2595fb6..751478da2d 100644 --- a/kernel/trunk/fs/ext2/ext2.inc +++ b/kernel/trunk/fs/ext2/ext2.inc @@ -490,6 +490,20 @@ EXT2_S_IFMT = 0xF000 ; Mask for file type. EXT2_S_IFREG = 0x8000 ; Regular file. EXT2_S_IFDIR = 0x4000 ; Directory. +EXT2_S_IRUSR = 0x0100 ; User read +EXT2_S_IWUSR = 0x0080 ; User write +EXT2_S_IXUSR = 0x0040 ; User execute +EXT2_S_IRGRP = 0x0020 ; Group read +EXT2_S_IWGRP = 0x0010 ; Group write +EXT2_S_IXGRP = 0x0008 ; Group execute +EXT2_S_IROTH = 0x0004 ; Others read +EXT2_S_IWOTH = 0x0002 ; Others write +EXT2_S_IXOTH = 0x0001 ; Others execute + +PERMISSIONS = EXT2_S_IRUSR or EXT2_S_IWUSR \ + or EXT2_S_IRGRP or EXT2_S_IWGRP \ + or EXT2_S_IROTH or EXT2_S_IWOTH + ; File type defining values in directory entry. EXT2_FT_REG_FILE = 1 ; Regular file. EXT2_FT_DIR = 2 ; Directory.