--- sourceforge.net/trunk/rdesktop/disk.c 2004/05/06 08:17:14 690 +++ sourceforge.net/trunk/rdesktop/disk.c 2004/05/11 13:52:22 698 @@ -820,7 +820,7 @@ switch (info_class) { - case 3: //FIXME: Why 3? + case FileBothDirectoryInformation: // If a search pattern is received, remember this pattern, and restart search if (pattern[0] != 0) @@ -840,13 +840,23 @@ // Get information for directory entry sprintf(fullpath, "%s/%s", dirname, pdirent->d_name); - /* JIF - printf("Stat: %s\n", fullpath); */ if (stat(fullpath, &fstat)) { - perror("stat"); - out_uint8(out, 0); - return STATUS_ACCESS_DENIED; + switch (errno) + { + case ENOENT: + case ELOOP: + case EACCES: + /* These are non-fatal errors. */ + memset(&fstat, 0, sizeof(fstat)); + break; + default: + /* Fatal error. By returning STATUS_NO_SUCH_FILE, + the directory list operation will be aborted */ + perror(fullpath); + out_uint8(out, 0); + return STATUS_NO_SUCH_FILE; + } } if (S_ISDIR(fstat.st_mode)) @@ -890,6 +900,9 @@ break; default: + /* FIXME: Support FileDirectoryInformation, + FileFullDirectoryInformation, and + FileNamesInformation */ unimpl("IRP Query Directory sub: 0x%x\n", info_class); return STATUS_INVALID_PARAMETER;