Thanks, this doesn't actually compile with libfuse3 though. First there is the error:
Code: Select all
In file included from /usr/include/fuse3/fuse.h:19,
from src/mount_image.c:46:
/usr/include/fuse3/fuse_common.h:802:4: error: #error only API version 30 or greater is supported
802 | # error only API version 30 or greater is supported
There are also errors due to the new code using variables that weren't declared, and due to other FUSE API changes.
Additional comments:
I think FUSE3 support should be controlled by a new configure argument --with-fuse3, so that packagers can choose whether they want fuse2 or fuse3 rather than being forced to fuse3 whenever it's installed. Keep in mind that fuse2 and fuse3 are normally installable alongside each other.
In inode_to_stbuf(), the unix_data fields are no longer actually being copied into the struct stat.
When the new code tries to clear the setuid and setgid bits, it accidentally also clears the file type bits.
The setuid and setgid bits aren't always cleared when a truncation is performed.
It doesn't make sense to clear the setuid and setgid bits on files that don't have UNIX data yet, since these bits are not in the default mode and such files should not be given UNIX data unless necessary.
Clearing the setuid and setgid bits should be done in a common helper function, e.g. "inode_remove_security()". The code shouldn't be duplicated in each place it's needed.