File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
data/scripts/Linux-AppImage Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -272,6 +272,11 @@ add_whitelist() {
272272 path" $HOME ${1# \~ } "
273273 fi
274274
275+ # if the path doesn't exist, whitelist will fail, solves eg. "file:help"
276+ if [ ! -e " $path " ]; then
277+ return
278+ fi
279+
275280 if contains_mount " $path " ; then
276281 disable_mount=no
277282 fi
@@ -300,12 +305,13 @@ whitelist_file_path() {
300305 fi
301306 if expr " $n " : ' .*file[:=]' > /dev/null || expr " $n " : ' .*filename' \
302307 > /dev/null; then
303- parent_dir=$( dirname " path" )
308+ fullpath=$( realpath " path" )
309+ parent_dir=$( dirname " $fullpath " )
304310 if [ " $parent_dir " = /dev ] || [ " $parent_dir " = /tmp ]; then
305311 return
306312 fi
307313 # whitelist the parent folder to allow file creation
308- printf -- " $separator --whitelist= \" %s \" " " $parent_dir "
314+ add_whitelist " $parent_dir "
309315 fi
310316}
311317
You can’t perform that action at this time.
0 commit comments