Skip to content

Check quota on file copy - #35009

Merged
come-nc merged 4 commits into
masterfrom
fix/check-quota-on-copy
Nov 17, 2022
Merged

Check quota on file copy#35009
come-nc merged 4 commits into
masterfrom
fix/check-quota-on-copy

Conversation

@come-nc

Copy link
Copy Markdown
Contributor

Fixes#34975

Signed-off-by: Côme Chilliet come.chilliet@nextcloud.com

@come-nccome-nc added the 3. to review Waiting for reviews label Nov 7, 2022
@come-nccome-nc added this to the Nextcloud 26 milestone Nov 7, 2022
@come-nccome-nc self-assigned this Nov 7, 2022
@come-nc

Copy link
Copy Markdown
ContributorAuthor

/backport to stable25

@come-nc

Copy link
Copy Markdown
ContributorAuthor

/backport to stable24

@come-nc

Copy link
Copy Markdown
ContributorAuthor

/backport to stable23

@come-nc
come-nc requested review from a team, ArtificialOwl, GretaD, PVince81 and skjnldsv and removed request for a teamNovember 7, 2022 16:29
Comment threadapps/dav/lib/Connector/Sabre/QuotaPlugin.php Fixed

@PVince81PVince81 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@PVince81

Copy link
Copy Markdown
Member

psalm not happy and an integration test fails now due to beforeCopy and a dot file that is not allowed. I suspect that the latter is more about a test case doing something dodgy than a bug

@szaimen

Copy link
Copy Markdown
Contributor

Seems like https://drone.nextcloud.com/nextcloud/server/25500/20/3 fails. Not sure if related though...

@nickvergessen

Copy link
Copy Markdown
Member
{
"Exception": "OCA\\DAV\\Connector\\Sabre\\Exception\\InvalidPath",
"Message": "Dot files are not allowed",
"Code": 0,
"Trace": [
{
"file": "/drone/src/apps/dav/lib/Connector/Sabre/QuotaPlugin.php",
"line": 158,
"function": "getNodeForPath",
"class": "OCA\\DAV\\Connector\\Sabre\\ObjectTree",
"type": "->"
},
{
"file": "/drone/src/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
"line": 89,
"function": "beforeCopy",
"class": "OCA\\DAV\\Connector\\Sabre\\QuotaPlugin",
"type": "->"
},
{
"file": "/drone/src/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
"line": 648,
"function": "emit",
"class": "Sabre\\DAV\\Server",
"type": "->"
},
{
"file": "/drone/src/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
"line": 89,
"function": "httpCopy",
"class": "Sabre\\DAV\\CorePlugin",
"type": "->"
},
{
"file": "/drone/src/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 472,
"function": "emit",
"class": "Sabre\\DAV\\Server",
"type": "->"
},
{
"file": "/drone/src/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 253,
"function": "invokeMethod",
"class": "Sabre\\DAV\\Server",
"type": "->"
},
{
"file": "/drone/src/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 321,
"function": "start",
"class": "Sabre\\DAV\\Server",
"type": "->"
},
{
"file": "/drone/src/apps/dav/appinfo/v1/webdav.php",
"line": 85,
"function": "exec",
"class": "Sabre\\DAV\\Server",
"type": "->"
},
{
"file": "/drone/src/remote.php",
"line": 171,
"args": [
"/drone/src/apps/dav/appinfo/v1/webdav.php"
],
"function": "require_once"
}
],
"File": "/drone/src/apps/dav/lib/Connector/Sabre/ObjectTree.php",
"Line": 124,
"message": "Dot files are not allowed",
"exception": {},
"CustomMessage": "Dot files are not allowed"
}

Sounds very related

@icewind1991

Copy link
Copy Markdown
Member

basename will return "." if the input has no "/"

@come-nc

Copy link
Copy Markdown
ContributorAuthor

basename will return "." if the input has no "/"

Nice catch, thank you. Then the same change is needed in beforeMove, no?

@come-nc
come-nc enabled auto-merge November 15, 2022 17:12
$parentNode = $this->server->tree->getNodeForPath($parent);
$path = $parentNode->getPath();
}

Check notice

Code scanning / Psalm

UndefinedInterfaceMethod

Method Sabre\DAV\INode::getPath does not exist
@come-nc

Copy link
Copy Markdown
ContributorAuthor

/rebase

come-ncand others added 4 commits November 17, 2022 13:22
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Let’s be safe
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@PVince81PVince81 removed the 3. to review Waiting for reviews label Nov 17, 2022
@PVince81PVince81 added the 4. to release Ready to be released and/or waiting for tests to finish label Nov 17, 2022
@come-nc
come-nc merged commit 6868cfb into masterNov 17, 2022
@come-nc
come-nc deleted the fix/check-quota-on-copy branch November 17, 2022 14:40
@come-nc

Copy link
Copy Markdown
ContributorAuthor

/backport to stable24

@come-nc

Copy link
Copy Markdown
ContributorAuthor

/backport to stable23

@backportbot-nextcloud

Copy link
Copy Markdown

The backport to stable24 failed. Please do this backport manually.

@backportbot-nextcloud

Copy link
Copy Markdown

The backport to stable23 failed. Please do this backport manually.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to releaseReady to be released and/or waiting for tests to finish

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Quota is not checked and im able to copy files even when i dont have storage

7 participants

@come-nc@PVince81@szaimen@nickvergessen@icewind1991@GretaD@github-advanced-security