From a8bc8cfa2e38e050cb73bba0fbfcadb3ba3c298f Mon Sep 17 00:00:00 2001 From: Kwarde Date: Sun, 27 Jul 2025 21:45:32 +0200 Subject: [PATCH] Adds constants DEF_MODE_FILE and DEF_MODE_DIR --- src/constants/file.asm | 2 ++ src/file.asm | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/constants/file.asm b/src/constants/file.asm index cd61a32..0be0dce 100644 --- a/src/constants/file.asm +++ b/src/constants/file.asm @@ -40,6 +40,8 @@ section .rodata S_ISVTX equ 0001000q ;sticky bit S_ISGID equ 0002000q ;set-group-ID bit S_ISUID equ 0004000q ;set-user-ID bit + DEF_MODE_FILE equ S_IWOTH | S_IROTH | S_IWGRP | S_IRGRP | S_IWUSR | S_IRUSR + DEF_MODE_DIR equ S_IRWXO | S_IRWXG | S_IRWXU ; Stat buffer fields ST_DEV equ 0 ; Device unsigned ST_INO equ 8 ; File serial number unsigned diff --git a/src/file.asm b/src/file.asm index f92a8f5..34a3cee 100644 --- a/src/file.asm +++ b/src/file.asm @@ -113,7 +113,7 @@ fopen: pop rdi push rdi not rax - mov rsi, 0666q + mov rsi, DEF_MODE_FILE and rsi, rax mov rax, NR_creat syscall