Prevent ls from running on files
This commit is contained in:
parent
64818e1337
commit
21a30db5d3
@ -35,8 +35,8 @@ main(int argc, const char *argv[])
|
||||
break;
|
||||
}
|
||||
if (status < 0) {
|
||||
fputs("Error\n", stdout);
|
||||
break;
|
||||
printf("OSReadDir Error: %x\n", -status);
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("%s\n", de.d_name);
|
||||
|
@ -364,8 +364,11 @@ O2FS_ReadDir(VNode *fn, void *buf, uint64_t len, uint64_t *off)
|
||||
|
||||
status = O2FS_Read(fn, &dirEntry, *off, sizeof(dirEntry));
|
||||
if (status != sizeof(dirEntry)) {
|
||||
kprintf("Unexpected error reading directory: %d", status);
|
||||
return status;
|
||||
kprintf("Unexpected error reading directory: %d\n", status);
|
||||
return -ENOTDIR;
|
||||
}
|
||||
if (strncmp((char *)&dirEntry.magic[0], BDIR_MAGIC, sizeof(dirEntry.magic)) != 0) {
|
||||
return -ENOTDIR;
|
||||
}
|
||||
|
||||
// XXX: Validation and fill in all fields
|
||||
|
Loading…
Reference in New Issue
Block a user