-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
winfsp using programs exit without a reason if volname option has more than 32 characters #311
Comments
Thanks for the report. Likely a buffer overflow bug in the handling of the volname option. |
@mhogomchungu I looked into this and the behavior appears to be "by design" (please note that this does not make it a "good" behavior and we should probably change it). The Now a volume label can be up to 32 characters long. So when passed a Unfortunately no error messages are printed, which is very confusing from a user perspective. It can be easily argued that this behavior is a poor design choice and that error messages should be added to explain the situation. I note that there are other places were the same problem can happen. For example, the same problem would happen if the supplied file system name was too long: https://github.com/billziss-gh/winfsp/blob/v1.7/src/dll/fuse/fuse.c#L357-L371 |
A possible solution is to make sure the volname variable does not exceed 32 characters by truncating excess ones. If a user for example gives a value that is too long, winfsp accepts it but set the variable that is equal to 29 characters from the user followed by 3 dots to indicate truncation. An example of a truncated string looks like: |
I have added commit c803ef2 which should address this issue. |
How to Reproduce
Use sshfs-win to connect to a remote server and use -o volname option with less than 32 characters and observer it working as expected
Run the same command again and add more characters to volname option and observe sshfs exiting without printing anything
The same behavior is observed with securefs
The text was updated successfully, but these errors were encountered: