1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #18536 from fabian18/bugfix_gcoap_fileserver_recursive_delete

gcoap_fileserver: bugfix recursive delete
This commit is contained in:
benpicco 2022-08-31 08:35:27 +02:00 committed by GitHub
commit 0e2eb919a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -480,7 +480,7 @@ static ssize_t _delete_directory(coap_pkt_t *pdu, uint8_t *buf, size_t len,
if ((err = vfs_unlink_recursive(request->namebuf,
request->namebuf,
sizeof(request->namebuf))) < 0) {
gcoap_fileserver_error_handler(pdu, buf, len, err);
return gcoap_fileserver_error_handler(pdu, buf, len, err);
}
}
gcoap_resp_init(pdu, buf, len, COAP_CODE_DELETED);

View File

@ -245,7 +245,7 @@ int vfs_unlink_recursive(const char *root, char *path_buf, size_t max_size)
return err;
}
while (vfs_readdir(&dir, &entry) > 0) {
if (!strcmp(entry.d_name, "..")) {
if (!strcmp(entry.d_name, ".") || !strcmp(entry.d_name, "..")) {
continue;
}
seg_len = strlen(entry.d_name);