-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
files:transfer-ownership command does not work in some scenarios with encryption #23786
Comments
@cmonteroluque @schiesbn |
We cannot transfer encrypted files and because of that the command should fail. @schiesbn any idea why in this case the files are not detected as encrypted? THX |
But the encryption was enabled after creating the file ( steps 3 and 4), so this file should not be encrypted, no? Only the ones created after encryption was enabled (no one in this example) |
@davitol what does it mean "some of the files" weren't transferred? Anything specific about the ones transferred and the ones not transferred? |
@cmonteroluque No. There were 2 skeleton folders and a file.txt in root before encrytion. After the encryption and running the command files:transfer-ownership only 1 skeleton folder was transferred |
@schiesbn mind having a look? THX |
OK, folders can't be encrypted. This explains why they where transfered correctly.
I think the detection works correct. As described by @davitol the file isn't encrypted. The question is: Why does the encryption wrapper still try to decrypt it. I will try it and see if I can find something. But a even bigger problem I see: Even if we detect correctly that the file isn't encrypted during read we will probably try to encrypt it while writing the file to the new location which of course will fail...But let me try it first. |
I followed the steps provided by @davitol and this was the result: Which is obvious. According to the test steps user2 never logged-in. So we don't have a public key to encrypt the files for user2. But we don't try to decrypt the file, which is correct because the file is not encrypted. If I change the steps in this way:
Everything works as expected. The file "file.txt" gets transfered together with the skeleton "welcome.txt". BUT there is one independent problem: I can't read the transfered files, I get a "bad signature" error! @LukasReschke once more the signature, can you have a look? Thanks! (tested on 9.0.1) |
@davitol regarding the original issue. Can you re-produce it reliable? Can you double-check that the "file.txt" is not encrypted before you run the occ script? Also check the oc_filecache entry for the file. 'encrypted' should be '0' if the file isn't encrypted. |
So basically the issue is that user2 was never logged in? |
@schiesbn @DeepDiver1975
I think it's a good idea |
Good question. We have some code which does the check as part of the "default encryption module": https://github.com/owncloud/core/blob/master/apps/encryption/lib/keymanager.php#L494 But that's specific to the encryption module, so while you could borrow some code from there this is not really a solution. For a real solution we would probably need something like |
Let me check if I can make that work .... |
@schiesbn @DeepDiver1975 Should we file another issue related to this behaviour and close this one via #2400 ? |
@davitol are ALL the transfered files unreadable or only the ones from the skeleton ? If all transferred files are unreadable then this qualifies as data loss and would become critical, especially if the issue is discovered after the fact at a time where the files cannot be recovered in any way. |
I have been bitten by this issue in 10.0.2.1. I thought I had decrypted the user (apprently not). Did a file transfer and now I have encrypted files in one user's account that belong to a different user. No clear path to undo this problem. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Steps to reproduce
Expected behaviour
The ownership of files should be transferred from user1 to user2
Actual behaviour
An error is shown and some of the files are not transferred
Server configuration
Operating system:
Ubuntu 14.04
Web server:
Apache
Database:
MySQL
PHP version:
5.5.9
ownCloud version:"9.0.1.2","versionstring":"9.0.1 RC2","edition":"Enterprise"}
Updated from an older ownCloud or fresh install:
Fresh
List of activated apps:
Enabled:
Disabled:
Are you using external storage, if yes which one: local/smb/sftp/...
No
Are you using encryption:
No
Logs
Client configuration
browser
Firefox
The text was updated successfully, but these errors were encountered: