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)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 9 Jun 2013 22:16:24 +0000 (18:16 -0400)
commitae82af8da06f57f10ae9a0b74e89a02fa9c8babf
treec7652d9be826d485db8a633813b0908adb6e7dc0
parentcf1922965a897cbfb53ac3e88c2a444f880b01d7
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