squashfs-tools icon indicating copy to clipboard operation
squashfs-tools copied to clipboard

Calls to close in mksquashfs.c should check for errors

Open struktured opened this issue 2 years ago • 0 comments

When running mksquashfs over a s3 fuse filesytem, s3 returned a 403 which prevented the close call from succeeding. However, mksquashfs ignored this error and acted as if the operation completed successfully. To be clear, nothing at all ultimately got written to the destination filesystem.

Here is where I suspect the close failed:

https://github.com/plougher/squashfs-tools/blob/188454662ed6de1332fe72dc119977b5ccb5fb1d/squashfs-tools/mksquashfs.c#L8033

Another unguarded close is here too: https://github.com/plougher/squashfs-tools/blob/master/squashfs-tools/mksquashfs.c#L6966

struktured avatar May 04 '22 13:05 struktured