Menu

#92 configuration not saved atomically

open
None
9
2007-12-02
2005-10-03
Roberto
No

configuration is not saved atomically. So on errors
like out of space a 0 sized file overwrites a good
configuration.

Instead gqview should write configuration to a temp
file and when everything went OK replace the new
configuration file with the old one.

Discussion

  • Roberto

    Roberto - 2007-12-01

    gqview_atomic_file_writing

     
  • Roberto

    Roberto - 2007-12-01
    • priority: 5 --> 9
     
  • Roberto

    Roberto - 2007-12-01

    Logged In: YES
    user_id=1244604
    Originator: YES

    Here is the fix.
    File Added: gqview_atomic_file_writing.diff

     
  • Roberto

    Roberto - 2007-12-02
    • assigned_to: nobody --> gqview
     
  • Roberto

    Roberto - 2007-12-02

    Logged In: YES
    user_id=1244604
    Originator: YES

    Another way to fix this bug would be to write all the configuration file to a string buffer in RAM and then save it using http://library.gnome.org/devel/glib/unstable/glib-File-Utilities.html#g-file-set-contents
    Tell me if you would like it better so I can make a patch.

     
  • Roberto

    Roberto - 2008-03-15

    gqview_atomic_file_writing_gstring.diff

     
  • Roberto

    Roberto - 2008-03-15

    Logged In: YES
    user_id=1244604
    Originator: YES

    I am attaching another implementation of the fix using a GString and g_file_set_contents()
    File Added: gqview_atomic_file_writing_gstring.diff

     
  • Roberto

    Roberto - 2008-03-15

    Logged In: YES
    user_id=1244604
    Originator: YES

    I have come to see that also the "history" and "accels" files suffer from this problem.
    Please let me know what kind of fix are you applying to gqview so I can make patches for the other two problems.

     
  • Roberto

    Roberto - 2008-06-14

    Logged In: YES
    user_id=1244604
    Originator: YES

    This bug has been fixed in the Debian package:
    http://packages.debian.org/sid/gqview
    using one of the attached: gqview_atomic_file_writing.diff

     

Log in to post a comment.