wufuyue / yaffs2utils

Automatically exported from code.google.com/p/yaffs2utils
GNU General Public License v2.0
1 stars 3 forks source link

Parsing OOB file fails when it is read-only. #19

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Make oob-file read-only
2. run unyaffs2 -o <oobfile> ...

What is the expected output? What do you see instead?
Instead of extracting the image, the command fails with "parse oob image failed"

What version of the product are you using? On what operating system?
Latest SVN revision (23)

Please provide any additional information below.
strace output:
open("/etc/yaffs2/oob", O_RDWR)     = -1 EROFS (Read-only file system)
write(2, "parse oob image failed\n", 23parse oob image failed
) = 23
write(1, "unyaffs2-0.2.0: image extracting"..., 49) = 49

The file is being opened with O_RDWR, while O_RDONLY is sufficient.

Original issue reported on code.google.com by HIGH...@gmail.com on 5 Sep 2011 at 12:37

GoogleCodeExporter commented 8 years ago

Original comment by penguin.lin on 13 Sep 2011 at 1:40

GoogleCodeExporter commented 8 years ago
This issue was fixed in r24.
It also fix the un-closed file descriptor in *_load_spare().

Original comment by penguin.lin on 16 Sep 2011 at 1:10