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

Check quota on file copy #35009

Merged
merged 4 commits into from
Nov 17, 2022
Merged

Check quota on file copy #35009

merged 4 commits into from
Nov 17, 2022

Conversation

come-nc
Copy link
Contributor

@come-nc come-nc commented Nov 7, 2022

Fixes #34975

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

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

come-nc commented Nov 7, 2022

/backport to stable25

@come-nc
Copy link
Contributor Author

come-nc commented Nov 7, 2022

/backport to stable24

@come-nc
Copy link
Contributor Author

come-nc commented Nov 7, 2022

/backport to stable23

@come-nc come-nc requested review from PVince81, GretaD, a team, ArtificialOwl and skjnldsv and removed request for a team November 7, 2022 16:29
Copy link
Member

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍

@PVince81
Copy link
Member

PVince81 commented Nov 8, 2022

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
Contributor

szaimen commented Nov 9, 2022

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

@nickvergessen
Copy link
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
Member

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

@come-nc
Copy link
Contributor Author

come-nc commented Nov 14, 2022

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

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

$parent = '';
}
$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
Contributor Author

come-nc commented Nov 17, 2022

/rebase

come-nc and 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>
@PVince81 PVince81 removed the 3. to review Waiting for reviews label Nov 17, 2022
@PVince81 PVince81 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 master Nov 17, 2022
@come-nc come-nc deleted the fix/check-quota-on-copy branch November 17, 2022 14:40
@come-nc
Copy link
Contributor Author

come-nc commented Nov 21, 2022

/backport to stable24

@come-nc
Copy link
Contributor Author

come-nc commented Nov 21, 2022

/backport to stable23

@backportbot-nextcloud
Copy link

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

@backportbot-nextcloud
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready 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
6 participants