mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-24 18:25:50 +00:00
Don't unref info if == NULL Query for readonly on the source directory,
2009-02-25 Alexander Larsson <alexl@redhat.com> * libnautilus-private/nautilus-file-operations.c (copy_files): Don't unref info if == NULL Query for readonly on the source directory, not the file because otherwise we'll follow symlinks to the wrong filesystem. OTOH, maybe query_filesystem_info shouldn't follow symlinks, but that unfortunately seems hard to implement. svn path=/trunk/; revision=15019
This commit is contained in:
parent
a0f7bb5f2e
commit
c03448e31d
|
@ -1,3 +1,12 @@
|
|||
2009-02-25 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* libnautilus-private/nautilus-file-operations.c (copy_files):
|
||||
Don't unref info if == NULL
|
||||
Query for readonly on the source directory, not the file because
|
||||
otherwise we'll follow symlinks to the wrong filesystem.
|
||||
OTOH, maybe query_filesystem_info shouldn't follow symlinks,
|
||||
but that unfortunately seems hard to implement.
|
||||
|
||||
2009-02-25 Alexander Larsson <alexl@redhat.com>
|
||||
|
||||
* src/nautilus-application.c:
|
||||
|
|
|
@ -4218,6 +4218,7 @@ copy_files (CopyMoveJob *job,
|
|||
gboolean skipped_file;
|
||||
gboolean unique_names;
|
||||
GFile *dest;
|
||||
GFile *source_dir;
|
||||
char *dest_fs_type;
|
||||
GFileInfo *inf;
|
||||
gboolean readonly_source_fs;
|
||||
|
@ -4229,9 +4230,15 @@ copy_files (CopyMoveJob *job,
|
|||
|
||||
report_copy_progress (job, source_info, transfer_info);
|
||||
|
||||
inf = g_file_query_filesystem_info ((GFile *) job->files->data, "filesystem::readonly", NULL, NULL);
|
||||
if (inf != NULL) {
|
||||
readonly_source_fs = g_file_info_get_attribute_boolean (inf, "filesystem::readonly");
|
||||
/* Query the source dir, not the file because if its a symlink we'll follow it */
|
||||
source_dir = g_file_get_parent ((GFile *) job->files->data);
|
||||
if (source_dir) {
|
||||
inf = g_file_query_filesystem_info (source_dir, "filesystem::readonly", NULL, NULL);
|
||||
if (inf != NULL) {
|
||||
readonly_source_fs = g_file_info_get_attribute_boolean (inf, "filesystem::readonly");
|
||||
g_object_unref (inf);
|
||||
}
|
||||
g_object_unref (source_dir);
|
||||
}
|
||||
|
||||
unique_names = (job->destination == NULL);
|
||||
|
@ -4274,7 +4281,6 @@ copy_files (CopyMoveJob *job,
|
|||
}
|
||||
|
||||
g_free (dest_fs_type);
|
||||
g_object_unref (inf);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
Loading…
Reference in a new issue