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;
|
break;
|
||||||
}
|
}
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
fputs("Error\n", stdout);
|
printf("OSReadDir Error: %x\n", -status);
|
||||||
break;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%s\n", de.d_name);
|
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));
|
status = O2FS_Read(fn, &dirEntry, *off, sizeof(dirEntry));
|
||||||
if (status != sizeof(dirEntry)) {
|
if (status != sizeof(dirEntry)) {
|
||||||
kprintf("Unexpected error reading directory: %d", status);
|
kprintf("Unexpected error reading directory: %d\n", status);
|
||||||
return status;
|
return -ENOTDIR;
|
||||||
|
}
|
||||||
|
if (strncmp((char *)&dirEntry.magic[0], BDIR_MAGIC, sizeof(dirEntry.magic)) != 0) {
|
||||||
|
return -ENOTDIR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX: Validation and fill in all fields
|
// XXX: Validation and fill in all fields
|
||||||
|
Loading…
x
Reference in New Issue
Block a user