mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-26 12:12:10 +01:00
gfile: Do not follow symlinks when moving
It is expected that `g_file_move()` moves symlink file itself, not its target. Unfortunately, copy and delete fallback passes `GFileCopyFlags` and don't explicitly use `G_FILE_COPY_NOFOLLOW_SYMLINKS`. This may cause that symlink target is copied and symlink itself is removed. Let's explicitly pass `G_FILE_COPY_NOFOLLOW_SYMLINKS` to the copy operation to prevent this unexpected behavior. https://gitlab.gnome.org/GNOME/glib/issues/986
This commit is contained in:
parent
6694172014
commit
f17055f593
@ -3736,7 +3736,7 @@ g_file_move (GFile *source,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
flags |= G_FILE_COPY_ALL_METADATA;
|
flags |= G_FILE_COPY_ALL_METADATA | G_FILE_COPY_NOFOLLOW_SYMLINKS;
|
||||||
if (!g_file_copy (source, destination, flags, cancellable,
|
if (!g_file_copy (source, destination, flags, cancellable,
|
||||||
progress_callback, progress_callback_data,
|
progress_callback, progress_callback_data,
|
||||||
error))
|
error))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user