diff options
author | Thomas Huth <thuth@linux.vnet.ibm.com> | 2012-04-30 10:27:55 +0200 |
---|---|---|
committer | Thomas Huth <thuth@linux.vnet.ibm.com> | 2012-04-30 10:27:55 +0200 |
commit | 042cb119ecf3b2284c2c4ee01684862d235b705f (patch) | |
tree | b8a7441f784f777aa5bc1ed93ca42a591589ce63 | |
parent | 883555382278fb6967661c48b0847e37eceddf4b (diff) | |
download | SLOF-042cb119ecf3b2284c2c4ee01684862d235b705f.zip SLOF-042cb119ecf3b2284c2c4ee01684862d235b705f.tar.gz SLOF-042cb119ecf3b2284c2c4ee01684862d235b705f.tar.bz2 |
Fixed ISO9660 filesystem directory parsing with a lot of entries
According to the ISO9660/Ecma-119 standard, directory entries must not cross
the boundary of a sector. That means that there might be some padding after
the last directory entry that still fitted into a sector. SLOF did not take
this into account yet so it failed to find files in directories which used
more than one sector for its directory entries. Now we are taking the padding
into account so the "file not found" problems should be gone.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
-rw-r--r-- | slof/fs/packages/iso-9660.fs | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/slof/fs/packages/iso-9660.fs b/slof/fs/packages/iso-9660.fs index 296b46b..885fe54 100644 --- a/slof/fs/packages/iso-9660.fs +++ b/slof/fs/packages/iso-9660.fs @@ -147,7 +147,12 @@ INSTANCE VARIABLE index : path-table-search ( str len -- TRUE | FALSE ) path-table path-tbl-size + path-table ptable @ + DO ( str len ) 2dup I 6 + w@-be index @ = ( str len str len ) - -rot I 8 + I c@ string=ci and IF ( str len ) + -rot I 8 + I c@ + iso-debug-flag IF + ." ISO: comparing path name '" + 4dup type ." ' with '" type ." '" cr + THEN + string=ci and IF ( str len ) s" Directory Matched!! " iso-debug-print ( str len ) self @ index ! ( str len ) I 2 + l@-be dir-addr ! I dup ( str len rec-addr ) @@ -173,9 +178,13 @@ INSTANCE VARIABLE index dir-addr @ r@ read-data ( str len ) THEN r> data-buff @ + data-buff @ DO ( str len ) - I 19 + c@ 2 and 0= IF ( str len ) + I 19 + c@ 2 and 0= I c@ 0<> and IF ( str len ) 2dup ( str len str len ) I 21 + I 20 + c@ ( str len str len str' len' ) + iso-debug-flag IF + ." ISO: comparing file name '" + 4dup type ." ' with '" type ." '" cr + THEN file-name string=ci IF ( str len ) s" File found!" iso-debug-print ( str len ) I 6 + l@-be 800 * ( str len file-loc ) @@ -187,12 +196,14 @@ INSTANCE VARIABLE index EXIT THEN THEN - I c@ dup 0= IF ( str len len ) - s" file not found" iso-debug-print - drop 2drop FALSE ( FALSE ) - UNLOOP - EXIT + ( str len ) + I c@ ?dup 0= IF + 800 I 7ff AND - + iso-debug-flag IF + ." skipping " dup . ." bytes at end of sector" cr + THEN THEN + ( str len offset ) +LOOP 2drop FALSE ( FALSE ) |