From 4ed89f7c4902d57e6b7c387bde11975c65366083 Mon Sep 17 00:00:00 2001 From: Takanori Nakane Date: Tue, 27 Oct 2020 11:05:29 +0000 Subject: [PATCH] Import: "../" should not happen in any place --- src/apps/import.cpp | 4 ++-- src/pipeline_jobs.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/apps/import.cpp b/src/apps/import.cpp index 6d457763a..a31771ce8 100644 --- a/src/apps/import.cpp +++ b/src/apps/import.cpp @@ -99,10 +99,10 @@ class import_parameters // For micrographs or movies if (do_movies || do_micrographs) { - if (fn_in.rfind("../", 0) == 0) + if (fn_in.rfind("../") != std::string::npos) // Forbid at any place REPORT_ERROR("Please don't import files outside the project directory.\nPlease make a symbolic link by an absolute path before importing."); - if (fn_in.rfind("/", 0) == 0) + if (fn_in.rfind("/", 0) == 0) // Forbid only at the beginning REPORT_ERROR("Please import files by a relative path.\nIf you want to import files outside the project directory, make a symbolic link by an absolute path and\nimport the symbolic link by a relative path."); std::string tablename = (do_movies) ? "movies" : "micrographs"; diff --git a/src/pipeline_jobs.cpp b/src/pipeline_jobs.cpp index 986cf50f1..46c54b5da 100644 --- a/src/pipeline_jobs.cpp +++ b/src/pipeline_jobs.cpp @@ -1127,13 +1127,13 @@ bool RelionJob::getCommandsImportJob(std::string &outputname, std::vector