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

don't close input stream when writing in encrypted file #13468

Merged
merged 1 commit into from
Jan 14, 2019

Conversation

rummatee
Copy link
Contributor

@rummatee rummatee commented Jan 9, 2019

This addresses issue #13276. Since Sabre checks if the end of the stream has been reached, when the created file is empty, closing the stream creates an error in that case.

				$result = $count > 0;
				if ($result === false) {
					$result = feof($data);
				}

I also don't see, why it would make sense to close that stream that writeStream gets as an parameter, but please tell me if I am missing something.
Please review @nextcloud/encryption

Signed-off-by: Florian Schunk <florian.schunk@rwth-aachen.de>
@MorrisJobke
Copy link
Member

cc @icewind1991

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

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

Code makes sense 👍

@MorrisJobke MorrisJobke merged commit c3b22f0 into nextcloud:master Jan 14, 2019
@MorrisJobke MorrisJobke added this to the Nextcloud 16 milestone Jan 14, 2019
@MorrisJobke
Copy link
Member

/backport to stable15

@backportbot-nextcloud
Copy link

backport to stable15 in #13588

@tobiasKaminsky
Copy link
Member

I do get this:

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception</s:exception>
  <s:message>Error while copying file to target location (copied bytes: 0, expected filesize: 0 )</s:message>
</d:error>

on my Android test 0kb upload, always targeting latest master.
It was working some days ago, so this might be the cause here?

@MorrisJobke
Copy link
Member

But this was merged over a month ago. There was one change by @rullzer with 0 Byte files in object storages

@tobiasKaminsky
Copy link
Member

Ah, I mixed 14.01. with 14.02.

@rullzer
Copy link
Member

rullzer commented Feb 20, 2019

Also in general. commenting on month old merged PRs is a good way to have your additional questions ignored ;)

@yingriyanlong
Copy link

Hi, I'm using nextcloud server 15.04 and got the same information as @tobiasKaminsky when I upload a 0kb file using Windows Client 2.51final.

@MorrisJobke
Copy link
Member

Hi, I'm using nextcloud server 15.04 and got the same information as @tobiasKaminsky when I upload a 0kb file using Windows Client 2.51final.

Fixed in #14273 most likely.

@KurtCa
Copy link

KurtCa commented May 20, 2019

This is not fixed in nextcloud 16.0.1

@MorrisJobke
Copy link
Member

This is not fixed in nextcloud 16.0.1

Could you open a new ticket for this then? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants