Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-work upload clarification from #5206. #5264

Merged
merged 1 commit into from Jan 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/galaxy/tools/actions/upload_common.py
Expand Up @@ -448,7 +448,7 @@ def _chown(path):
auto_decompress=getattr(uploaded_dataset, "auto_decompress", True),
purge_source=purge_source,
space_to_tab=uploaded_dataset.space_to_tab,
run_as_real_user=trans.app.config.external_chown_script is None,
run_as_real_user=trans.app.config.external_chown_script is not None,
check_content=trans.app.config.check_upload_content,
path=uploaded_dataset.path)
# TODO: This will have to change when we start bundling inputs.
Expand Down
8 changes: 5 additions & 3 deletions tools/data_source/upload.py
Expand Up @@ -96,10 +96,12 @@ def add_file(dataset, registry, json_file, output_path):
# if running as the real user so the file can be cleaned up by Galaxy.
purge_source = dataset.get('purge_source', True) and not run_as_real_user

# in_place is True only if we are running as a real user and not importing external paths (i.e.
# in_place is True unless we are running as a real user or importing external paths (i.e.
# this is a real upload and not a path paste or ftp import).
# In this case we try to reuse the uploaded file that has been chowned to this user already.
in_place = run_as_real_user and dataset.type not in ('server_dir', 'path_paste', 'ftp_import')
# in_place should always be False if running as real user because the uploaded file will
# be owned by Galaxy and not the user and it should be False for external paths so Galaxy doesn't
# modify files not controlled by Galaxy.
in_place = not run_as_real_user and dataset.type not in ('server_dir', 'path_paste', 'ftp_import')

# Base on the check_upload_content Galaxy config option and on by default, this enables some
# security related checks on the uploaded content, but can prevent uploads from working in some cases.
Expand Down