Bug#680418: gvfs-fuse: Wrongly sucessful posix fwrite call on a gvfs sftp mount can lead to data loss

Nicolas Anonyme pathogenyx at gmail.com
Thu Jul 5 18:18:29 UTC 2012


Package: gvfs-fuse
Version: 1.12.3-1+b1
Severity: critical
Tags: upstream
Justification: causes serious data loss

Dear Maintainer,

   * What led up to the situation?

After some of my files got truncated at 4096 bytes when saved in leafpad
over agvfs sftp mount, I did some debug, and found that the bug was
apparently in gvfs fuse sftp module.

   * What exactly did you do that was effective?

I wrote a small C soft that could reproduce the bug when trying to write a 5k
txt file over the sftp gvfs mount :
 - Mount a sftp location with gvfs : gvfs-mount "sftp://${USER}@localhost"
 - compile and run the small piece of software :
  - The fwrite() posix call returns a number of bytes of the expected len,
  - But the gvfs layer buffers it and does not write the totality of the data
immediatly,
  - The software opens the same file in append mode, and that seems to
invalidate the subsequent write calls of the gvfs layer.
  - As a result the text file is truncated at 4kbyte on the remote disk

   * What outcome did you expect instead?

the text file should weight 5kbyte as "gfvs-fuse also supports exposing the
gvfs mounts to non-gio applications using fuse. "

The bug with leafpad + sftp + gvfs also exist in ubuntu as I found bug report
on launchpad, so it's probably upstream.

I joined the commented C code of my debug case.

I hope it can help a little, and I apologise for my bad English.

Thank you for reading this.

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (550, 'testing'), (550, 'stable'), (500,
'stable-updates'), (500, 'proposed-updates'), (33, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gvfs-fuse depends on:
ii  fuse          2.9.0-2
ii  gvfs          1.12.3-1+b1
ii  libc6         2.13-33
ii  libdbus-1-3   1.6.0-1
ii  libfuse2      2.9.0-2
ii  libglib2.0-0  2.32.3-1

gvfs-fuse recommends no packages.

gvfs-fuse suggests no packages.

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: write5kfile.c
Type: text/x-csrc
Size: 2521 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20120705/9eb8c3f5/attachment.c>


More information about the pkg-gnome-maintainers mailing list