-
- if (dont_resolve_uids) {
- filedir_entry->d_name[d_namelen++] = '\n';
- filedir_entry->d_name[d_namelen] = '\0';
- client_write(filedir_entry->d_name, d_namelen);
+
+ if (d_type == DT_UNKNOWN) {
+ struct stat s;
+ char path[PATH_MAX];
+ snprintf(path, PATH_MAX, "%s/%s",
+ ctdl_bio_dir, filedir_entry->d_name);
+ if (lstat(path, &s) == 0) {
+ d_type = IFTODT(s.st_mode);
+ }
+ }
+ switch (d_type)
+ {
+ case DT_DIR:
+ break;
+ case DT_LNK:
+ case DT_REG:
+ if (dont_resolve_uids) {
+ filedir_entry->d_name[d_namelen++] = '\n';
+ filedir_entry->d_name[d_namelen] = '\0';
+ client_write(filedir_entry->d_name, d_namelen);
+ }
+ else if (CtdlGetUserByNumber(&usbuf,atol(filedir_entry->d_name))==0)
+ cprintf("%s\n", usbuf.fullname);