Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/wolfsftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -4861,9 +4861,6 @@ static int SFTP_GetAttributes(void* fs, const char* fileName,
(void) noFollow;
(void) heap;

ret = f_stat(fileName, &info);
if (ret != FR_OK)
return -1;
WMEMSET(atr, 0, sizeof(WS_SFTP_FILEATRB));
if (sz > 2 && fileName[sz - 2] == ':') {
atr->flags |= WOLFSSH_FILEATRB_PERM;
Expand All @@ -4872,12 +4869,14 @@ static int SFTP_GetAttributes(void* fs, const char* fileName,
}

/* handle case of "/" */
/* Calling f_stat for "/" returns FR_INVALID_NAME. So we simulate the result. */
if (sz < 3 && fileName[0] == WS_DELIM) {
atr->flags |= WOLFSSH_FILEATRB_PERM;
atr->per |= 0x4000;
return WS_SUCCESS;
}

ret = f_stat(fileName, &info);
if (ret != FR_OK) {
return WS_BAD_FILE_E;
}
Expand Down
Loading