g_file_copy(): Clean up logic for info query
authorColin Walters <walters@verbum.org>
Wed, 8 May 2013 23:01:59 +0000 (00:01 +0100)
committerColin Walters <walters@verbum.org>
Wed, 5 Jun 2013 17:56:53 +0000 (18:56 +0100)
commit02aaef5a4dd92fe3a3f3a7c4ccebf22ca1ba2644
tree2e6d26e231c41b0edd737e6052a27bc7f13b00c9
parentb4df86fa193d54c7604bf90aa88824e220b92683
g_file_copy(): Clean up logic for info query

Previously, we called g_file_query_info() *again* on the source at the
very end of the copy.  This has the lame semantics that if the source
happened to be deleted, we would fail to apply attributes to the
destination.  This could even be a security flaw.

This commit changes things so that we query info from the source
*stream* after opening - i.e. on Unix we use the proper fstat() and
friends.  That way we operate more atomically.

https://bugzilla.gnome.org/show_bug.cgi?id=699959
gio/gfile.c