-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
[stable24] Fix size calculation on copying the skeleton files #35049
Conversation
otherwise the filecache will have a wrong size for skeleton files Signed-off-by: Julius Härtl <jus@bitgrid.net>
This breaks skeleton file creation for guest app users. Easily testable with running talks integration test: features/conversation/find-listed.feature:22
|
{
"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": "--"
} |
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();
} |
Filed #35248 for follow up investigations |
Backport of #34834