Lines 1682-1709
copy_directory (GnomeVFSFileInfo *source
Link Here
|
1682 |
gnome_vfs_directory_close (dest_directory_handle); |
1682 |
gnome_vfs_directory_close (dest_directory_handle); |
1683 |
gnome_vfs_directory_close (source_directory_handle); |
1683 |
gnome_vfs_directory_close (source_directory_handle); |
1684 |
|
1684 |
|
1685 |
if (result == GNOME_VFS_OK) { |
1685 |
if (result == GNOME_VFS_OK) { |
1686 |
GnomeVFSFileInfo *info; |
1686 |
GnomeVFSFileInfo *info; |
1687 |
info = gnome_vfs_file_info_new (); |
1687 |
|
|
|
1688 |
if (target_dir_info && GNOME_VFS_FILE_INFO_SGID (target_dir_info)) { |
1689 |
info = gnome_vfs_file_info_dup (source_file_info); |
1690 |
info->gid = target_dir_info->gid; |
1691 |
} else { |
1692 |
/* No need to dup the file info in this case */ |
1693 |
gnome_vfs_file_info_ref (source_file_info); |
1694 |
info = source_file_info; |
1695 |
} |
1696 |
|
1688 |
/* FIXME the modules should ignore setting of permissions if |
1697 |
/* FIXME the modules should ignore setting of permissions if |
1689 |
* "valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS" is clear |
1698 |
* "valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS" is clear |
1690 |
* for now, make sure permissions aren't set to 000 |
1699 |
* for now, make sure permissions aren't set to 000 |
1691 |
*/ |
1700 |
*/ |
1692 |
gnome_vfs_file_info_copy (source_file_info, info); |
1701 |
if ((info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS) != 0) { |
1693 |
if (target_dir_info && GNOME_VFS_FILE_INFO_SGID(target_dir_info)) { |
1702 |
|
1694 |
info->gid = target_dir_info->gid; |
|
|
1695 |
} |
1696 |
if ((source_file_info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS) != 0) { |
1697 |
/* Call this separately from the time one, since one of them may fail, |
1703 |
/* Call this separately from the time one, since one of them may fail, |
1698 |
making the other not run. */ |
1704 |
making the other not run. */ |
1699 |
gnome_vfs_set_file_info_uri (target_dir_uri, info, |
1705 |
gnome_vfs_set_file_info_uri (target_dir_uri, info, |
1700 |
GNOME_VFS_SET_FILE_INFO_OWNER | GNOME_VFS_SET_FILE_INFO_PERMISSIONS); |
1706 |
GNOME_VFS_SET_FILE_INFO_OWNER | |
|
|
1707 |
GNOME_VFS_SET_FILE_INFO_PERMISSIONS); |
1701 |
} |
1708 |
} |
1702 |
|
1709 |
|
1703 |
/* Call this last so nothing else changes the times */ |
1710 |
/* Call this last so nothing else changes the times */ |
1704 |
gnome_vfs_set_file_info_uri (target_dir_uri, info, GNOME_VFS_SET_FILE_INFO_TIME); |
1711 |
gnome_vfs_set_file_info_uri (target_dir_uri, info, GNOME_VFS_SET_FILE_INFO_TIME); |
1705 |
gnome_vfs_file_info_unref (info); |
1712 |
gnome_vfs_file_info_unref (info); |
1706 |
} |
1713 |
} |
|
|
1714 |
|
1707 |
if (target_dir_info) { |
1715 |
if (target_dir_info) { |
1708 |
gnome_vfs_file_info_unref (target_dir_info); |
1716 |
gnome_vfs_file_info_unref (target_dir_info); |
1709 |
} |
1717 |
} |