[stable24] Fix size calculation on copying the skeleton files#35049
Merged
juliusknorr merged 1 commit intostable24from Nov 10, 2022
Merged
[stable24] Fix size calculation on copying the skeleton files#35049juliusknorr merged 1 commit intostable24from
juliusknorr merged 1 commit intostable24from
Conversation
otherwise the filecache will have a wrong size for skeleton files Signed-off-by: Julius Härtl <jus@bitgrid.net>
come-nc
approved these changes
Nov 10, 2022
icewind1991
approved these changes
Nov 10, 2022
Member
|
This breaks skeleton file creation for guest app users. Easily testable with running talks integration test: features/conversation/find-listed.feature:22 |
Member
{
"Exception": "OCP\\Files\\GenericFileException",
"Message": "file_put_contents failed",
"Code": 0,
"Trace": [
{
"file": "/home/nickv/Nextcloud/24/server/lib/private/legacy/OC_Util.php",
"line": 257,
"function": "putContent",
"class": "OC\\Files\\Node\\File",
"type": "->"
},
{
"file": "/home/nickv/Nextcloud/24/server/lib/private/legacy/OC_Util.php",
"line": 216,
"function": "copyr",
"class": "OC_Util",
"type": "::"
},
{
"file": "/home/nickv/Nextcloud/24/server/lib/private/User/Session.php",
"line": 553,
"function": "copySkeleton",
"class": "OC_Util",
"type": "::"
},
{
"file": "/home/nickv/Nextcloud/24/server/lib/private/User/Session.php",
"line": 403,
"function": "prepareUserLogin",
"class": "OC\\User\\Session",
"type": "->"
},
{
"file": "/home/nickv/Nextcloud/24/server/lib/private/User/Session.php",
"line": 616,
"function": "completeLogin",
"class": "OC\\User\\Session",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/home/nickv/Nextcloud/24/server/lib/private/User/Session.php",
"line": 355,
"function": "loginWithPassword",
"class": "OC\\User\\Session",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/home/nickv/Nextcloud/24/server/lib/private/User/Session.php",
"line": 450,
"function": "login",
"class": "OC\\User\\Session",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/home/nickv/Nextcloud/24/server/lib/private/User/Session.php",
"line": 575,
"function": "logClientIn",
"class": "OC\\User\\Session",
"type": "->",
"args": [
"*** sensitive parameters replaced ***"
]
},
{
"file": "/home/nickv/Nextcloud/24/server/lib/base.php",
"line": 1081,
"function": "tryBasicAuthLogin",
"class": "OC\\User\\Session",
"type": "->"
},
{
"file": "/home/nickv/Nextcloud/24/server/ocs/v1.php",
"line": 59,
"function": "handleLogin",
"class": "OC",
"type": "::"
},
{
"file": "/home/nickv/Nextcloud/24/server/ocs/v2.php",
"line": 23,
"args": [
"/home/nickv/Nextcloud/24/server/ocs/v1.php"
],
"function": "require_once"
}
],
"File": "/home/nickv/Nextcloud/24/server/lib/private/Files/Node/File.php",
"Line": 72,
"CustomMessage": "--"
} |
This was referenced Nov 18, 2022
Member
Author
|
Strange, I've tried to debug this a bit but could not figure out why 24 would behave different yet. Overall it seems that the guests app on 24 does not trigger a failure of the newFile call. On master this properly throws a NotPermittedException which is catched and expected in the copy skeleton. To be continued. Small test script to trigger the issue directly: <?php
// curl http://stable24.dev.local/playground/test.php -H 'Cookie: XDEBUG_SESSION=PHPSTORM' -u "guest@guest.com:guest@guest.com"
try {
require_once __DIR__ . '/../lib/versioncheck.php';
require_once __DIR__ . '/../lib/base.php';
// v1.php
OC_App::loadApps(['session']);
OC_App::loadApps(['authentication']);
OC_App::loadApps();
if (!\OC::$server->getUserSession()->isLoggedIn()) {
OC::handleLogin(\OC::$server->getRequest());
}
$userFolder = \OC::$server->getUserFolder('guest@guest.com');
OC_Util::copySkeleton('guest@guest.com', $userFolder);
} catch (\Exception $e) {
echo '<pre>';
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
echo $e->getTraceAsString();
} |
Member
Author
|
Filed #35248 for follow up investigations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #34834