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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2571>
This commit is contained in:
parent
69600f3bfd
commit
1a9e072ca0
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user