1. 24 May, 2019 1 commit
    • Ondrej Holy's avatar
      gfile: Limit access to files when copying · d8f8f4d6
      Ondrej Holy authored
      file_copy_fallback creates new files with default permissions and
      set the correct permissions after the operation is finished. This
      might cause that the files can be accessible by more users during
      the operation than expected. Use G_FILE_CREATE_PRIVATE for the new
      files to limit access to those files.
      d8f8f4d6
  2. 15 Mar, 2019 2 commits
  3. 28 Jan, 2019 3 commits
  4. 19 Jun, 2018 1 commit
  5. 14 Jun, 2018 1 commit
  6. 05 May, 2018 1 commit
  7. 11 Apr, 2018 1 commit
  8. 16 Feb, 2018 2 commits
  9. 15 Jan, 2018 1 commit
    • Colin Walters's avatar
      GFile: Add g_file_peek_path() · 4808a957
      Colin Walters authored
      This is a variant of g_file_get_path() which returns a const string to
      the caller, rather than transferring ownership.
      
      I've been carrying `gs_file_get_path_cached()` in libgsystem and it
      has seen a lot of use in the ostree and flatpak codebases.  There are
      probably others too.
      
      I think language bindings like Python/Gjs could also use this to avoid
      an extra malloc (i.e. we could transparently replace
      `g_file_get_path()` with `g_file_peek_path()`.
      
      (Originally by Colin Walters. Tweaked by Philip Withnall to update to
      2.56, change the function name and drop the locking.)
      
      https://bugzilla.gnome.org/show_bug.cgi?id=767976
      4808a957
  10. 12 Jan, 2018 1 commit
  11. 15 Nov, 2017 1 commit
  12. 07 Nov, 2017 1 commit
  13. 26 Oct, 2017 1 commit
  14. 11 Oct, 2017 1 commit
  15. 05 Oct, 2017 1 commit
  16. 18 Aug, 2017 1 commit
  17. 03 Aug, 2017 1 commit
    • Philip Withnall's avatar
      Consistently save errno immediately after the operation setting it · 5cddde1f
      Philip Withnall authored
      Prevent the situation where errno is set by function A, then function B
      is called (which is typically _(), but could be anything else) and it
      overwrites errno, then errno is checked by the caller.
      
      errno is a horrific API, and we need to be careful to save its value as
      soon as a function call (which might set it) returns. i.e. Follow the
      pattern:
        int errsv, ret;
        ret = some_call_which_might_set_errno ();
        errsv = errno;
      
        if (ret < 0)
          puts (strerror (errsv));
      
      This patch implements that pattern throughout GLib. There might be a few
      places in the test code which still use errno directly. They should be
      ported as necessary. It doesn’t modify all the call sites like this:
        if (some_call_which_might_set_errno () && errno == ESOMETHING)
      since the refactoring involved is probably more harmful than beneficial
      there. It does, however, refactor other call sites regardless of whether
      they were originally buggy.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=785577
      5cddde1f
  18. 21 Jun, 2017 1 commit
  19. 02 Jun, 2017 1 commit
  20. 29 May, 2017 1 commit
  21. 11 Jan, 2017 2 commits
  22. 22 Nov, 2016 1 commit
  23. 12 Oct, 2016 1 commit
  24. 29 Jun, 2016 1 commit
  25. 15 Jun, 2016 1 commit
  26. 07 Jun, 2016 1 commit
  27. 04 Jun, 2016 1 commit
  28. 24 Aug, 2015 2 commits
  29. 21 Aug, 2015 1 commit
    • Christophe Fergeau's avatar
      Fix GError leak in g_file_query_writable_namespaces() · 60a6ae6f
      Christophe Fergeau authored
      gvfs commit b358ca "Make sure metadata is always returned by
      query_writable_namespaces()" changed the
      query_writable_namespaces vfunc to never return NULL, but the error
      checking in g_daemon_file_query_writable_namespaces still assumes vfunc
      failure implies NULL return value and GError set. This causes a memory
      leak as on failure the GError will be set but the vfunc implementation
      will have created its own default list so NULL will not be returned, and
      the GError will never be cleared.
      
      This commit directly checks if the GError is set to detect failures,
      my_error is directly dereferenced in the error block anyway.
      
      This also removes an unneeded call to g_file_attribute_info_new(); as
      the vfunc always returns us a non-NULL GFileAttributeInfoList.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=747364
      60a6ae6f
  30. 17 Jun, 2015 1 commit
  31. 03 Mar, 2015 1 commit
  32. 18 Dec, 2014 3 commits