Skip to content
  • Ross Lagerwall's avatar
    fuse: Don't g_file_append_to unless O_APPEND is given · 548ba46c
    Ross Lagerwall authored
    Because g_file_append_to opens an output stream that can only append
    regardless of the seek position, only use g_file_append_to when O_APPEND
    is actually specified.  This prevents file corruption when the mode is
    O_WRONLY or O_RDWR without O_APPEND.
    
    Note that this means opening a file with a bare O_WRONLY or O_RDWR
    returns ENOTSUP since there is no equivalent in gvfs.
    
    Furthermore, don't attempt to seek when the file mode is O_APPEND since
    this is unnecessary.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=632296
    548ba46c