Skip to content

Commit

Permalink
Merge pull request #372 from mvdbeek/fix_tool_file_authorization_bina…
Browse files Browse the repository at this point in the history
…ry_files

Open tool file contents in `rb`
  • Loading branch information
mvdbeek authored Nov 11, 2024
2 parents e726e5a + 98b0303 commit 3742d22
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/galaxy_framework.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
GALAXY_TEST_JOB_CONFIG_FILE: ../pulsar/test_data/test_job_conf.yaml
GALAXY_CONFIG_OVERRIDE_METADATA_STRATEGY: ${{ matrix.metadata-strategy }}
continue-on-error: ${{ matrix.galaxy-branch == 'master' }}
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: Framework test results (${{ matrix.python-version }})
path: 'galaxy/run_framework_tests.html'
2 changes: 1 addition & 1 deletion pulsar/managers/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def _check_execution(self, job_id, tool_id, command_line):
for file in self._list_dir(tool_files_dir):
if os.path.isdir(join(tool_files_dir, file)):
continue
contents = open(join(tool_files_dir, file)).read()
contents = open(join(tool_files_dir, file), "rb").read()
log.debug("job_id: {} - checking tool file {}".format(job_id, file))
authorization.authorize_tool_file(basename(file), contents)
config_files_dir = job_directory.configs_directory()
Expand Down
2 changes: 1 addition & 1 deletion pulsar/tools/authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def authorize_tool_file(self, name, contents):
tool = self.tool
tool_dir = tool.get_tool_dir()
tool_dir_file = join(tool_dir, name)
allowed_contents = open(tool_dir_file).read()
allowed_contents = open(tool_dir_file, "rb").read()
if contents != allowed_contents:
self.__unauthorized("Attempt to write tool file with contents differing from Pulsar copy of tool file.")

Expand Down

0 comments on commit 3742d22

Please sign in to comment.