forked from KolibriOS/kolibrios
Added proper permissions.
git-svn-id: svn://kolibrios.org@4067 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
7365b0cf3f
commit
9e1cd84895
@ -744,7 +744,7 @@ ext2_Read:
|
|||||||
; Output: eax = error code.
|
; Output: eax = error code.
|
||||||
;---------------------------------------------------------------------
|
;---------------------------------------------------------------------
|
||||||
ext2_GetFileInfo:
|
ext2_GetFileInfo:
|
||||||
;DEBUGF 1, "Calling for file info.\n"
|
;DEBUGF 1, "Calling for file info, for: %s.\n", esi
|
||||||
call ext2_lock
|
call ext2_lock
|
||||||
mov edx, [ebx + 16]
|
mov edx, [ebx + 16]
|
||||||
cmp byte [esi], 0
|
cmp byte [esi], 0
|
||||||
@ -762,7 +762,6 @@ ext2_GetFileInfo:
|
|||||||
push eax
|
push eax
|
||||||
call ext2_unlock
|
call ext2_unlock
|
||||||
pop eax
|
pop eax
|
||||||
|
|
||||||
;DEBUGF 1, "Returning with: %x.\n", eax
|
;DEBUGF 1, "Returning with: %x.\n", eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@ -1164,7 +1163,7 @@ ext2_CreateFolder:
|
|||||||
pop edi
|
pop edi
|
||||||
|
|
||||||
mov ebx, [ebp + EXTFS.ext2_temp_inode]
|
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
|
mov eax, edx
|
||||||
call ext2_inode_write
|
call ext2_inode_write
|
||||||
test eax, eax
|
test eax, eax
|
||||||
@ -1344,7 +1343,7 @@ ext2_Rewrite:
|
|||||||
pop edi
|
pop edi
|
||||||
|
|
||||||
mov ebx, [ebp + EXTFS.ext2_temp_inode]
|
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
|
mov eax, edx
|
||||||
call ext2_inode_write
|
call ext2_inode_write
|
||||||
test eax, eax
|
test eax, eax
|
||||||
@ -1451,8 +1450,8 @@ ext2_Write:
|
|||||||
|
|
||||||
; Check if it's a file.
|
; Check if it's a file.
|
||||||
mov edx, [ebp + EXTFS.ext2_save_inode]
|
mov edx, [ebp + EXTFS.ext2_save_inode]
|
||||||
cmp [edx + EXT2_INODE_STRUC.i_mode], EXT2_S_IFREG
|
test [edx + EXT2_INODE_STRUC.i_mode], EXT2_S_IFREG
|
||||||
jne .error
|
jz .error
|
||||||
|
|
||||||
mov eax, esi
|
mov eax, esi
|
||||||
mov ecx, [ebx + 4]
|
mov ecx, [ebx + 4]
|
||||||
|
@ -490,6 +490,20 @@ EXT2_S_IFMT = 0xF000 ; Mask for file type.
|
|||||||
EXT2_S_IFREG = 0x8000 ; Regular file.
|
EXT2_S_IFREG = 0x8000 ; Regular file.
|
||||||
EXT2_S_IFDIR = 0x4000 ; Directory.
|
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.
|
; File type defining values in directory entry.
|
||||||
EXT2_FT_REG_FILE = 1 ; Regular file.
|
EXT2_FT_REG_FILE = 1 ; Regular file.
|
||||||
EXT2_FT_DIR = 2 ; Directory.
|
EXT2_FT_DIR = 2 ; Directory.
|
||||||
|
Loading…
Reference in New Issue
Block a user