GNOME Bugzilla – Bug 304022
sftp-method confuse SSH2_FX and GNOME_VFS codes
Last modified: 2005-07-18 08:19:54 UTC
Version details: 2.8.4 Distribution/Version: Debian Sid I try to open a uri for writing, the problem is only visible in sftp:// uri's: gnome_vfs_async_open_uri(&sf->handle,uri,GNOME_VFS_OPEN_WRITE,GNOME_VFS_PRIORITY_DEFAULT ,savefile_asyncopenuri_lcb,sf); the uri does not exist, so I expect a 'File not found', but instead of that, I get a result=18 'End of file' a workaround for my code could be to handle any 'End of file' error as 'File not found' and create the uri, but still this should be fixed in the sftp module. the problem is not visible for files that are on my local disk. I have not tested any other remote filesystem, because I do not have access to any other server then sftp
Thanks for your bug The issue is than do_open() uses this code: " sftp_res = iobuf_read_handle (conn->in_fd, &sftp_handle, id, (guint32 *)&sftp_handle_len); ... if (sftp_res == SSH2_FX_OK) { ... } else { .... return sftp_status_to_vfs_result (sftp_res);" or "static GnomeVFSResult iobuf_read_handle (int fd, gchar **handle, guint expected_id, guint32 *len) ... return sftp_status_to_vfs_result (status)" so sftp_res is already a GnomeVFSResult and sftp_status_to_vfs_result () should not be used gnome-vfs maintainers, sftp-method.c has this error at different places. Should the different iobuf_ functions return a "guint"?
Created attachment 49329 [details] [review] fixes the issue sftp_res is GnomeVFSResult, compare with GNOME_VFS_ symbols instead of SSH2_FX_ and don't use sftp_status_to_vfs_result on it
nice catch. I also removed the guint sftp_res and reused the GnomeVFSResult res variables instead.