From 253b64650f2842d44ebd99b9e67d34cc4b64bff2 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Tue, 10 Sep 2024 16:06:08 -0500 Subject: [PATCH] Fix the `$webworkDirs{valid_symlinks}` course environment option. This was broken in the recent rewrite of the file manager. Any symlink to a directory listed in the `$webworkDirs{valid_symlinks}` array should be allowed to be followed. This is a quick fix that makes those symlinks look and behave like they are actually directories in the file manager. --- lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm b/lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm index eab79360df..bc8256ae3c 100644 --- a/lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm +++ b/lib/WeBWorK/ContentGenerator/Instructor/FileManager.pm @@ -899,11 +899,11 @@ sub directoryListing ($c, $pwd) { my $file = "$dir/$name"; my $type = 0; - $type |= 1 if -l $file; # Symbolic link - $type |= 2 if !-l $file && -d $file; # Directory - $type |= 4 if -f $file; # Regular file - $type |= 8 if -T $file; # Text file - $type |= 16 if $file =~ m/\.(gif|jpg|png)$/i; # Image file + $type |= 1 if $c->isSymLink($file); # Symbolic link + $type |= 2 if !$c->isSymLink($file) && -d $file; # Directory + $type |= 4 if -f $file; # Regular file + $type |= 8 if -T $file; # Text file + $type |= 16 if $file =~ m/\.(gif|jpg|png)$/i; # Image file my $label = $name; $label .= '@' if $type & 1;