Skip to content

Commit dc4df8d

Browse files
JacobBarthelmehpadelsbach
authored andcommitted
keep a list of file handles open per session
- Track open SFTP file handles per session in a fileList, returning opaque session-scoped handle IDs instead of raw file descriptors. - Resolve and validate client-supplied handle IDs via FindFileHandle. - Free the handle list and close handles on error paths, including the Windows code paths. - Drop the old raw-fd SFTP_ValidateFileHandle/STOREHANDLE handle table and its tests, superseded by the per-session ID lookup.
1 parent 52f6db9 commit dc4df8d

8 files changed

Lines changed: 457 additions & 487 deletions

File tree

ide/IAR-EWARM/Projects/lib/myFilesystem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ static int SFTP_GetAttributes(void* fs, const char* fileName,
143143

144144
}
145145

146-
static int SFTP_GetAttributes_Handle(void* ssh, byte* handle, int handleSz,
146+
static int SFTP_GetAttributes_Handle(void* ssh, WFD fd,
147147
char* name, void* atr) {
148-
(void)ssh; (void)handle; (void)handleSz; (void)name;
148+
(void)ssh; (void)fd; (void)name; (void)atr;
149149

150150
return 0;
151151
}

ide/Renesas/e2studio/RX72N/wolfssh_RX72N/wolfssh_user_setting.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#define WOLFSSH_NO_TIMESTAMP
3636

3737
#define WOLFSSH_FATFS
38-
#define WOLFSSH_STOREHANDLE
3938
#define PRINTF printf
4039
#define DEFAULT_WINDOW_SZ 16384
4140
#define WOLFSSH_NO_RSA

ide/STM32CUBE/myFilesystem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ static inline int SFTP_GetAttributes(void* fs, const char* fileName,
140140

141141
}
142142

143-
static inline int SFTP_GetAttributes_Handle(void* ssh, byte* handle, int handleSz,
143+
static inline int SFTP_GetAttributes_Handle(void* ssh, WFD fd,
144144
char* name, void* atr) {
145-
(void)ssh; (void)handle; (void)handleSz; (void)name;
145+
(void)ssh; (void)fd; (void)name; (void)atr;
146146

147147
return 0;
148148
}

0 commit comments

Comments
 (0)