diff --git a/apps/wolfsshd/configuration.c b/apps/wolfsshd/configuration.c index dc92b82c..3f54b2e5 100644 --- a/apps/wolfsshd/configuration.c +++ b/apps/wolfsshd/configuration.c @@ -47,6 +47,7 @@ #endif #include "configuration.h" +#include struct WOLFSSHD_CONFIG { void* heap; @@ -533,7 +534,14 @@ static int HandleInclude(WOLFSSHD_CONFIG *conf, const char *value) /* Count up the number of files */ while ((dir = WREADDIR(&d)) != NULL) { /* Skip sub-directories */ - if (dir->d_type != DT_DIR) { + #if defined(__QNX__) || defined(__QNXNTO__) + struct stat s; + + lstat(dir->d_name, &s); + if (!S_ISDIR(s.st_mode)) + #else + if (dir->d_type != DT_DIR) + #endif fileCount++; } } @@ -551,7 +559,14 @@ static int HandleInclude(WOLFSSHD_CONFIG *conf, const char *value) i = 0; while (i < fileCount && (dir = WREADDIR(&d)) != NULL) { /* Skip sub-directories */ - if (dir->d_type != DT_DIR) { + #if defined(__QNX__) || defined(__QNXNTO__) + struct stat s; + + lstat(dir->d_name, &s); + if (!S_ISDIR(s.st_mode)) + #else + if (dir->d_type != DT_DIR) + #endif /* Insert in string order */ for (j = 0; j < i; j++) { if (WSTRCMP(dir->d_name, fileNames[j])