Skip to content

WIP Hack to prevent isLocal loop#22937

Closed
PVince81 wants to merge 7 commits intostable9from
stable9-preventislocal
Closed

WIP Hack to prevent isLocal loop#22937
PVince81 wants to merge 7 commits intostable9from
stable9-preventislocal

Conversation

@PVince81
Copy link
Contributor

@PVince81 PVince81 commented Mar 8, 2016

@icewind1991 @nickvergessen @rullzer

This is the hackery needed to prevent the isLocal loop.

However this would break availability check for storages and also firewall due to skipping oc_mounts updates.

This is just a POC to try and understand the problem better.

@DeepDiver1975
Copy link
Member

PHP Fatal error:  Call to a member function getPermissions() on a non-object in /ssd/jenkins/workspace/server-master-linux-php5.4-ci/database/sqlite/label/SLAVE/apps/files_sharing/lib/sharedstorage.php on line 88
05:58:18 PHP Stack trace:
05:58:18 PHP   1. {main}() /usr/local/bin/phpunit:0
05:58:18 PHP   2. PHPUnit_TextUI_Command::main() /usr/local/bin/phpunit:537
05:58:18 PHP   3. PHPUnit_TextUI_Command->run() phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php:105
05:58:18 PHP   4. PHPUnit_TextUI_TestRunner->doRun() phar:///usr/local/bin/phpunit/phpunit/TextUI/Command.php:153
05:58:18 PHP   5. PHPUnit_Framework_TestSuite->run() phar:///usr/local/bin/phpunit/phpunit/TextUI/TestRunner.php:406
05:58:18 PHP   6. PHPUnit_Framework_TestSuite->run() phar:///usr/local/bin/phpunit/phpunit/Framework/TestSuite.php:722
05:58:18 PHP   7. PHPUnit_Framework_TestCase->run() phar:///usr/local/bin/phpunit/phpunit/Framework/TestSuite.php:722
05:58:18 PHP   8. PHPUnit_Framework_TestResult->run() phar:///usr/local/bin/phpunit/phpunit/Framework/TestCase.php:699
05:58:18 PHP   9. PHP_Invoker->invoke() phar:///usr/local/bin/phpunit/phpunit/Framework/TestResult.php:607
05:58:18 PHP  10. call_user_func_array:{phar:///usr/local/bin/phpunit/php-invoker/Invoker.php:93}() phar:///usr/local/bin/phpunit/php-invoker/Invoker.php:93
05:58:18 PHP  11. PHPUnit_Framework_TestCase->runBare() phar:///usr/local/bin/phpunit/php-invoker/Invoker.php:93
05:58:18 PHP  12. PHPUnit_Framework_TestCase->runTest() phar:///usr/local/bin/phpunit/phpunit/Framework/TestCase.php:743
05:58:18 PHP  13. ReflectionMethod->invokeArgs() phar:///usr/local/bin/phpunit/phpunit/Framework/TestCase.php:866
05:58:18 PHP  14. OCA\Files_sharing\Tests\SizePropagation->testSizePropagationWhenOwnerChangesFile() phar:///usr/local/bin/phpunit/phpunit/Framework/TestCase.php:866
05:58:18 PHP  15. OC\Files\View->file_exists() /ssd/jenkins/workspace/server-master-linux-php5.4-ci/database/sqlite/label/SLAVE/apps/files_sharing/tests/sizepropagation.php:52
05:58:18 PHP  16. OC\Files\View->basicOperation() /ssd/jenkins/workspace/server-master-linux-php5.4-ci/database/sqlite/label/SLAVE/lib/private/files/view.php:475
05:58:18 PHP  17. OC\Files\Storage\Shared->file_exists() /ssd/jenkins/workspace/server-master-linux-php5.4-ci/database/sqlite/label/SLAVE/lib/private/files/view.php:1059
05:58:18 PHP  18. OC\Files\Storage\Shared->getSourcePath() /ssd/jenkins/workspace/server-master-linux-php5.4-ci/database/sqlite/label/SLAVE/apps/files_sharing/lib/sharedstorage.php:295
05:58:18 PHP  19. OC\Files\Storage\Shared->isValid() /ssd/jenkins/workspace/server-master-linux-php5.4-ci/database/sqlite/label/SLAVE/apps/files_sharing/lib/sharedstorage.php:141

@PVince81
Copy link
Contributor Author

PVince81 commented Mar 8, 2016

Got getPermissions issue too when opening activity in sidebar for a shared folder, after setting tags/comments:

{"reqId":"LCJuWh0NIjStlcR4mLFI","remoteAddr":"127.0.0.1","app":"PHP","message":"Call to a member function getPermissions() on null at \/srv\/www\/htdocs\/owncloud\/apps\/files_sharing\/lib\/sharedstorage.php#88","level":3,"time":"2016-03-08T11:00:09+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/activity\/api\/v2\/activity\/filter?format=json&object_type=files&object_id=43"}

@PVince81 PVince81 force-pushed the stable9-preventislocal branch from 7660921 to e2dbed3 Compare March 8, 2016 11:42
@PVince81
Copy link
Contributor Author

PVince81 commented Mar 8, 2016

getPermissions should be fixed now

@PVince81
Copy link
Contributor Author

PVince81 commented Mar 8, 2016

PHP7 passed, with a bit of luck this will work!

});
$shares = array_map(function ($share) use ($user, $storageFactory) {

\OC::$server->getLogger()->debug('Mounting share #{share} for {user}', [
Copy link
Contributor

Choose a reason for hiding this comment

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

🙊

@PVince81
Copy link
Contributor Author

PVince81 commented Mar 8, 2016

If CI passes:

  • squash commits
  • remove debug statements

@PVince81 PVince81 added this to the 9.0-current milestone Mar 8, 2016

use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use OC\Files\Filesystem;
use OC\Files\Storage\Shared;
Copy link
Contributor

Choose a reason for hiding this comment

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

unused now, since we check it with a string

@PVince81
Copy link
Contributor Author

PVince81 commented Mar 8, 2016

Preparing a parallel PR to save some time

@PVince81
Copy link
Contributor Author

PVince81 commented Mar 8, 2016

OBsoleted by #22945

@PVince81 PVince81 closed this Mar 8, 2016
@PVince81 PVince81 deleted the stable9-preventislocal branch March 8, 2016 13:46
@lock
Copy link

lock bot commented Aug 7, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants