Skip to content

Bad handling/message of/from pread in sqfs_init_with_subdir #146

Description

@black-sliver

We have a user of our AppImage on Manjaro Linux that reports --appimage-extract-and-run gives them "This doesn't look like a squashfs image.".
The appimage runtime actually uses squashfuse 0.5.2, but It looks like the relevant code path is unchanged between 0.5.2 and 0.6.1.

I dug though the source to see what the potential problems could be and the error appears to come from here: https://github.com/vasi/squashfuse/blob/master/fs.c#L68

I believe there are two things wrong with this:

  • it is valid for pread to return fewer bytes than requested, in which case it's not actually an error. The read should probably be done in a loop that handles done, EOF and error.
  • probably not all errors returned from pread should result in "This doesn't look like a squashfs image." since that is misleading; a more precise error message would be great.

It seems unlikely that pread returns short for the super block, but since I can't reproduce the problem, I can not inspect the actual error that is happening.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions