-
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
Fix path option for the verify checksum command #35483
Conversation
Why do we use the user folder for one thing and the root folder for another? If the user has to enter a path like If you're expecting to always access to the user's files, then assume that the path the admin will provide will always be under the user files. It would be way better to provide an additional (required?) option for the admin to provide the username. To be checked if we can change this. I'm pretty sure the problem is caused by the prepended (or maybe the lack of) "/" char in the path. If this is really the problem, just focus on fixing this. No need to change anything else and make the fix more complex than it should. |
No, unfortunately prepending "/" char is not the root cause of the problem. Because for instance on a scratch installation of oC and logged in as
Now run verify checksum command:
Again revisit the table:
This happens because of the problem in the code flow mentioned here:
Hence I was doubtful if to continue with getUserFolder only or use both, |
I think we should clarify the help description first. If the path the admin should input starts from the owncloud's data directory, the admin can use If the case above is something we don't want because we want to fix always the checksums from the |
@sharidas Could you give us an update on this ticket? |
The core of the issue is that we need to address #35483 (comment). There is a query from https://github.com/owncloud/enterprise/issues/3275#issuecomment-501417565 which asks how
If we can get some insight over the same, it would be helpful. |
1611416
to
f1b02a8
Compare
Double check all possible options:
|
The tested combinations:
|
f1b02a8
to
e8d37ad
Compare
Codecov Report
@@ Coverage Diff @@
## master #35483 +/- ##
===========================================
- Coverage 65.77% 65.68% -0.1%
+ Complexity 18781 18780 -1
===========================================
Files 1222 1222
Lines 70870 70938 +68
Branches 1289 1289
===========================================
- Hits 46618 46595 -23
- Misses 23874 23965 +91
Partials 378 378
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #35483 +/- ##
============================================
- Coverage 65.77% 65.77% -0.01%
- Complexity 18781 18783 +2
============================================
Files 1222 1222
Lines 70870 70871 +1
Branches 1289 1289
============================================
- Hits 46618 46615 -3
- Misses 23874 23878 +4
Partials 378 378
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #35483 +/- ##
============================================
- Coverage 65.77% 65.77% -0.01%
+ Complexity 18781 18776 -5
============================================
Files 1222 1222
Lines 70870 70871 +1
Branches 1289 1289
============================================
- Hits 46618 46615 -3
- Misses 23874 23878 +4
Partials 378 378
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a couple of minor comments to improve the readability.
e8d37ad
to
f5a34a1
Compare
The path option in the verify checksum command should now be relative to the user folder. Signed-off-by: Sujith H <sharidasan@owncloud.com>
f5a34a1
to
53f697f
Compare
Backport |
Fix path option for the verify checksum command
Signed-off-by: Sujith H sharidasan@owncloud.com
Description
The verify checksum command was failing to fix the checksum when path option is provided as:
$user/files/foo
or/$user/files/foo/bar
The reason for this is
get()
in the https://github.com/owncloud/core/blob/master/lib/private/Files/Node/Root.php#L180 will add extra entry in the cache. This PR tries to resolve the issue by analyzing the input by checking if the path contains$user/files
, if so thengetUserFolder
would be used to access the file provided using -p option of the command.Related Issue
Motivation and Context
This PR solves the addition of the file path to the filecache table, when -p option is used with the command.
How Has This Been Tested?
Here is how the tests done:
welcome.txt
anda.txt
for the useradmin
.Screenshots (if appropriate):
Types of changes
Checklist:
Open tasks: