ftpd: Add RMD command #353
Reference in New Issue
Block a user
Delete Branch "igorsh/kolibrios:ftpd-add-rmd-command"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Added RMD command
@@ -462,2 +461,3 @@; "DELE" & "RMD";; Delete a file from the server.; Delete a file/folder from the server.I believe the letter D in RMD means not 'folder'
@@ -472,2 +472,2 @@; Create pathcmp ecx, 1024 + 5mov edx, 4cmp byte[esi], 0x52 ; RFasm understands just 'R'. Same with 'r' below
@@ -474,0 +475,4 @@cmp byte[esi], 0x72 ; rje @fmov edx, 5Is this 5 strlen("DELE ")? Please, describe the logic around these lines in a comment
Don't forget to describe this logic with a comment, please. Thank you
Any update, @igorsh?
Кладем в edx длину команды - 4 и если команда rmd то прыгаем дальше, в противном случае кладем в edx 5, это значит команда DELE
@igorsh, please, add a code comment describing this logic. If you can't get rid of those magic numbers, there should be a code comment describing their meaning and use. Thank you
One of my comments is still not addressed: #353 (comment)
@dunkaist @igorsh
Does this version looks okay?
If so, I will push it into PR branch so we can finally merge this PR.
@Burer, looks good to me, thank you!
@Burer looks good
- document the shared DELE/RMD handler and the prefix-length logic (annotate strlen("RMD ")/"DELE " instead of bare magic numbers) - de-obfuscate the path bounds check (drop the add/sub 1024 round-trip) - use a command-neutral 550 reply ("Requested action not taken")