Index: libgnomevfs/gnome-vfs-xfer.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/libgnomevfs/gnome-vfs-xfer.c,v
retrieving revision 1.124
diff -u -p -r1.124 gnome-vfs-xfer.c
--- libgnomevfs/gnome-vfs-xfer.c	9 May 2005 11:34:44 -0000	1.124
+++ libgnomevfs/gnome-vfs-xfer.c	6 Jul 2005 15:31:07 -0000
@@ -1512,15 +1512,17 @@ copy_file (GnomeVFSFileInfo *info,  
 	if (result == GNOME_VFS_OK) {
 		/* ignore errors while setting file info attributes at this point */
 		
-		/* FIXME the modules should ignore setting of permissions if
-		 * "valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS" is clear
-		 * for now, make sure permissions aren't set to 000
-		 */
-		if ((info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS) != 0) {
-			/* Call this separately from the time one, since one of them may fail,
-			   making the other not run. */
-			gnome_vfs_set_file_info_uri (target_uri, info, 
-						     GNOME_VFS_SET_FILE_INFO_OWNER | GNOME_VFS_SET_FILE_INFO_PERMISSIONS);
+		if (!(xfer_options & GNOME_VFS_XFER_TARGET_DEFAULT_PERMS)) {
+			/* FIXME the modules should ignore setting of permissions if
+			 * "valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS" is clear
+			 * for now, make sure permissions aren't set to 000
+			 */
+			if ((info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS) != 0) {
+				/* Call this separately from the time one, since one of them may fail,
+				   making the other not run. */
+				gnome_vfs_set_file_info_uri (target_uri, info, 
+							     GNOME_VFS_SET_FILE_INFO_OWNER | GNOME_VFS_SET_FILE_INFO_PERMISSIONS);
+			}
 		}
 		
 		/* Call this last so nothing else changes the times */
@@ -1693,18 +1695,20 @@ copy_directory (GnomeVFSFileInfo *source
 			gnome_vfs_file_info_ref (source_file_info);
 			info = source_file_info;
 		}
-		
-		/* FIXME the modules should ignore setting of permissions if
-		 * "valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS" is clear
-		 * for now, make sure permissions aren't set to 000
-		 */
-		if ((info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS) != 0) {
-			
-			/* Call this separately from the time one, since one of them may fail,
-			   making the other not run. */
-			gnome_vfs_set_file_info_uri (target_dir_uri, info, 
-						     GNOME_VFS_SET_FILE_INFO_OWNER | 
-						     GNOME_VFS_SET_FILE_INFO_PERMISSIONS);
+
+		if (!(xfer_options & GNOME_VFS_XFER_TARGET_DEFAULT_PERMS)) {
+			/* FIXME the modules should ignore setting of permissions if
+			 * "valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS" is clear
+			 * for now, make sure permissions aren't set to 000
+			 */
+			if ((info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS) != 0) {
+				
+				/* Call this separately from the time one, since one of them may fail,
+				   making the other not run. */
+				gnome_vfs_set_file_info_uri (target_dir_uri, info, 
+							     GNOME_VFS_SET_FILE_INFO_OWNER | 
+							     GNOME_VFS_SET_FILE_INFO_PERMISSIONS);
+			}
 		}
 		
 		/* Call this last so nothing else changes the times */
Index: libgnomevfs/gnome-vfs-xfer.h
===================================================================
RCS file: /cvs/gnome/gnome-vfs/libgnomevfs/gnome-vfs-xfer.h,v
retrieving revision 1.13
diff -u -p -r1.13 gnome-vfs-xfer.h
--- libgnomevfs/gnome-vfs-xfer.h	1 Aug 2003 09:06:05 -0000	1.13
+++ libgnomevfs/gnome-vfs-xfer.h	6 Jul 2005 15:31:07 -0000
@@ -45,7 +45,8 @@ typedef enum {
 	GNOME_VFS_XFER_REMOVESOURCE = 1 << 8,
 	GNOME_VFS_XFER_USE_UNIQUE_NAMES = 1 << 9,
 	GNOME_VFS_XFER_LINK_ITEMS = 1 << 10,
-	GNOME_VFS_XFER_FOLLOW_LINKS_RECURSIVE = 1 << 11
+	GNOME_VFS_XFER_FOLLOW_LINKS_RECURSIVE = 1 << 11,
+	GNOME_VFS_XFER_TARGET_DEFAULT_PERMS = 1 << 12
 } GnomeVFSXferOptions;
 
 /* Progress status, to be reported to the caller of the transfer operation.  */
