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

Use secure temp directory for remote sync (#10911) #10914

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

t-h-e
Copy link
Contributor

@t-h-e t-h-e commented Jun 17, 2024

Fixes #10911

Screenshots

Testing strategy

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)

@t-h-e
Copy link
Contributor Author

t-h-e commented Jun 17, 2024

@hifi can you have a look at this?

in case directory could not be created or permissions could not be set
Pro:
- allows use of destructor to clean up
- remote handler can store file location and reuse it

Con:
- upload can not be called without previously calling download
  - currently not needed
@droidmonkey
Copy link
Member

droidmonkey commented Jun 19, 2024

Regarding the inability to call upload as a standalone thing, RemoteParams could include the "target" file path for using upload or download functions, if set the m_temporaryFileLocation variable is ignored. Another option is to just reintroduce the filepath variable to upload, but as an optional second parameter.

@droidmonkey droidmonkey added this to the v2.8.0 milestone Jun 19, 2024
@t-h-e
Copy link
Contributor Author

t-h-e commented Jun 19, 2024

Regarding the inability to call upload as a standalone thing, RemoteParams could include the "target" file path for using upload or download functions, if set the m_temporaryFileLocation variable is ignored. Another option is to just reintroduce the filepath variable to upload, but as an optional second parameter.

I think it is fine as is as we currently have no standalone upload. In case, we want to add an upload only functionality, this is definitely the way to go.

if (result.success && !params->uploadCommand.isEmpty()) {
emit updateSyncProgress(75, tr("Uploading..."));
result = remoteHandler->upload(result.filePath, params);
result = m_remoteHandler->upload(params);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to check for nullptr

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@phoerious phoerious added pr: bugfix Pull request that fixes a bug and removed bug labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: Remote Sync pr: bugfix Pull request that fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remote sync doesn't use secure temp directory
4 participants