From 1a9e072ca000c4033bf0c5be8facaced341206d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 5 Dec 2022 13:56:57 +0100 Subject: [PATCH] fileUtils: Do not follow symlinks Extensions should not include symlinks, in particular ones that point outside the extension directory. However if they do, then we should only move/remove the link rather than the files it points to. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6182 Part-of: --- js/misc/fileUtils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/misc/fileUtils.js b/js/misc/fileUtils.js index e9ea92a51..528a76350 100644 --- a/js/misc/fileUtils.js +++ b/js/misc/fileUtils.js @@ -45,7 +45,7 @@ function* collectFromDatadirs(subdir, includeUserDir) { function recursivelyDeleteDir(dir, deleteParent) { let children = dir.enumerate_children('standard::name,standard::type', - Gio.FileQueryInfoFlags.NONE, null); + Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS, null); let info; while ((info = children.next_file(null)) != null) { @@ -63,7 +63,7 @@ function recursivelyDeleteDir(dir, deleteParent) { function recursivelyMoveDir(srcDir, destDir) { let children = srcDir.enumerate_children('standard::name,standard::type', - Gio.FileQueryInfoFlags.NONE, null); + Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS, null); if (!destDir.query_exists(null)) destDir.make_directory_with_parents(null);