mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-11-04 01:58:54 +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:
		@@ -3736,7 +3736,7 @@ g_file_move (GFile                  *source,
 | 
			
		||||
      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,
 | 
			
		||||
                    progress_callback, progress_callback_data,
 | 
			
		||||
                    error))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user