After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 709432 - Doesn't allow to seek past the end of a file
Doesn't allow to seek past the end of a file
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2013-10-04 14:28 UTC by Michael Natterer
Modified: 2013-10-08 07:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sftp: Allow seek past end of file (4.32 KB, patch)
2013-10-08 07:31 UTC, Alexander Larsson
committed Details | Review
mtp: Allow seek past end of file (826 bytes, patch)
2013-10-08 07:31 UTC, Alexander Larsson
committed Details | Review
cdda: Allow seek past end of file (753 bytes, patch)
2013-10-08 07:31 UTC, Alexander Larsson
committed Details | Review
gphoto2: Allow seek past end of file (1.02 KB, patch)
2013-10-08 07:31 UTC, Alexander Larsson
committed Details | Review
afp: Allow seek past end of file (3.92 KB, patch)
2013-10-08 07:31 UTC, Alexander Larsson
committed Details | Review

Description Michael Natterer 2013-10-04 14:28:22 UTC
Filing under "general" because Alex said all backends need to be checked.

The sftp backend has the following wrong code in the seek reply functions:

  if (handle->offset > file_size)
    handle->offset = file_size;

which disables seeking past the end of a file.
Comment 1 Alexander Larsson 2013-10-08 07:31:06 UTC
Created attachment 256688 [details] [review]
sftp: Allow seek past end of file

also, don't query for the file size unless required for SEEK_END
Comment 2 Alexander Larsson 2013-10-08 07:31:10 UTC
Created attachment 256689 [details] [review]
mtp: Allow seek past end of file
Comment 3 Alexander Larsson 2013-10-08 07:31:13 UTC
Created attachment 256690 [details] [review]
cdda: Allow seek past end of file
Comment 4 Alexander Larsson 2013-10-08 07:31:17 UTC
Created attachment 256691 [details] [review]
gphoto2: Allow seek past end of file
Comment 5 Alexander Larsson 2013-10-08 07:31:20 UTC
Created attachment 256692 [details] [review]
afp: Allow seek past end of file

Also, only query file size if needed for G_SEEK_END.
Comment 6 Alexander Larsson 2013-10-08 07:51:14 UTC
Attachment 256688 [details] pushed as 5fb056f - sftp: Allow seek past end of file
Attachment 256689 [details] pushed as fb56d6d - mtp: Allow seek past end of file
Attachment 256690 [details] pushed as 77f98e8 - cdda: Allow seek past end of file
Attachment 256691 [details] pushed as d12755f - gphoto2: Allow seek past end of file
Attachment 256692 [details] pushed as 1474a61 - afp: Allow seek past end of file