Skip to content
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

SFTP read/write calls ignore bytes written return value #3906

Open
Sploder12 opened this issue Jan 28, 2025 · 0 comments
Open

SFTP read/write calls ignore bytes written return value #3906

Sploder12 opened this issue Jan 28, 2025 · 0 comments
Labels
bug needs triage Issue needs to be triaged

Comments

@Sploder12
Copy link
Contributor

Sploder12 commented Jan 28, 2025

Describe the bug
When handling SFTP read/write Multipass makes the assumption that the provided buffer is always filled, so the bytes written return value is ignored. This can cause issues like #3892 since this not a safe assumption. Fixing this would also make Multipass more future-proof against libssh changing the implementation of these functions.

To Reproduce

  1. Create an instance foo using Ubuntu 20.04
  2. Start the instance
  3. multipass transfer a file larger than 32KiB into foo
  4. Observe the resulting file is missing data

Expected behavior
The transferred filed is identical to the original. (Bytes written is handled properly)

Additional info

  • OS: Ubuntu 24.04
  • CPU architecture: x86_64
  • multipass get local.driver: qemu

Additional context
Reproducible from 5ee1dab onwards, but will not be if #3902 gets merged.
This issue isn't reproducible with 24.04 VMs, unclear why.

@Sploder12 Sploder12 added bug needs triage Issue needs to be triaged labels Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant