ftpd: Add RMD command
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 26s
Build system / Build (pull_request) Successful in 17m0s

This commit is contained in:
2026-03-06 00:02:22 +05:00
parent cc1034d849
commit 3d73e80d39

View File

@@ -102,7 +102,7 @@ commands: ; all commands must be in uppercase
; dd 'REIN', login_first, login_first, login_first, cmd_REIN
; dd 'REST', login_first, login_first, login_first, cmd_REST
dd 'RETR', login_first, login_first, login_first, cmdRETR
; dd 'RMD', login_first, login_first, login_first, cmd_RMD
dd 'RMD', login_first, login_first, login_first, cmdDELE
; dd 'RNFR', login_first, login_first, login_first, cmd_RNFR
; dd 'RNTO', login_first, login_first, login_first, cmd_RNTO
; dd 'SITE', login_first, login_first, login_first, cmd_SITE
@@ -458,9 +458,9 @@ cmdCWD:
ret
;------------------------------------------------
; "DELE"
; "DELE" & "RMD"
;
; Delete a file from the server.
; Delete a file/folder from the server.
;
;------------------------------------------------
align 4
@@ -469,16 +469,25 @@ cmdDELE:
test [ebp + thread_data.permissions], PERMISSION_DELETE
jz permission_denied
; Create path
cmp ecx, 1024 + 5
mov edx, 4
cmp byte[esi], 0x52 ; R
je @f
cmp byte[esi], 0x72 ; r
je @f
mov edx, 5
@@:
add edx, 1024
cmp ecx, edx
jae .err
sub ecx, 5
sub edx, 1024
sub ecx, edx
jb .err
call create_path
dec edi
lea esi, [ebp + thread_data.buffer + 5]
lea esi, [ebp + thread_data.buffer + edx]
mov ecx, 1024
cmp byte [esi], '/'
jne .loop