Index: gio/gioenums.h
===================================================================
--- gio/gioenums.h	(revisión: 7292)
+++ gio/gioenums.h	(copia de trabajo)
@@ -198,6 +198,7 @@ typedef enum {
  * @G_FILE_COPY_NOFOLLOW_SYMLINKS: Don't follow symlinks.
  * @G_FILE_COPY_ALL_METADATA: Copy all file metadata instead of just default set used for copy (see #GFileInfo).
  * @G_FILE_COPY_NO_FALLBACK_FOR_MOVE: Don't use copy and delete fallback if native move not supported.
+ * @G_FILE_COPY_TARGET_DEFAULT_PERMS: Leaves target file with default perms, instead of setting the source file perms.
  *
  * Flags used when copying or moving files.
  */
@@ -207,7 +208,8 @@ typedef enum {
   G_FILE_COPY_BACKUP               = (1 << 1),
   G_FILE_COPY_NOFOLLOW_SYMLINKS    = (1 << 2),
   G_FILE_COPY_ALL_METADATA         = (1 << 3),
-  G_FILE_COPY_NO_FALLBACK_FOR_MOVE = (1 << 4)
+  G_FILE_COPY_NO_FALLBACK_FOR_MOVE = (1 << 4),
+  G_FILE_COPY_TARGET_DEFAULT_PERMS = (1 << 5)
 } GFileCopyFlags;
 
 
Index: gio/gfile.c
===================================================================
--- gio/gfile.c	(revisión: 7292)
+++ gio/gfile.c	(copia de trabajo)
@@ -2142,6 +2142,8 @@ g_file_copy_attributes (GFile           
   GFileInfo *info;
   gboolean as_move;
   gboolean source_nofollow_symlinks;
+  gchar *rplc, *tmp;
+  GRegex *rex;
 
   as_move = flags & G_FILE_COPY_ALL_METADATA;
   source_nofollow_symlinks = flags & G_FILE_COPY_NOFOLLOW_SYMLINKS;
@@ -2155,6 +2157,16 @@ g_file_copy_attributes (GFile           
 
   attrs_to_read = build_attribute_list_for_copy (attributes, namespaces, as_move);
 
+  if (flags & G_FILE_COPY_TARGET_DEFAULT_PERMS) {
+        rplc = g_strconcat (attrs_to_read, ",", NULL); /* add comma at end */
+        g_free (attrs_to_read);
+        rex = g_regex_new ("unix::mode,", 0, 0, NULL);
+        tmp = g_regex_replace_literal (rex, rplc, strlen(rplc), 0, "", 0, NULL);
+        attrs_to_read = g_strndup (tmp, strlen(tmp)-1); /* remove comma from end */
+        g_free (tmp);
+        g_free (rplc);
+        g_regex_unref (rex);
+  }
   /* Ignore errors here, if we can't read some info (e.g. if it doesn't exist)
    * we just don't copy it. 
    */
