Skip to content

Conversation

@juliusknorr
Copy link
Member

When iterating over the files in a directory of an SMB share the the directory the iterable would stop after the first ACL that denies access instead of just hiding those entries. This may lead to incomplete directory listings on SMB shares with the ACL check enabled.

@juliusknorr juliusknorr added bug 3. to review Waiting for reviews labels Apr 20, 2021
@juliusknorr juliusknorr added this to the Nextcloud 22 milestone Apr 20, 2021
@juliusknorr juliusknorr force-pushed the bugfix/noid/continue-on-denied-acls branch from 0f23d6e to 8f01bc6 Compare April 20, 2021 15:17
@MorrisJobke MorrisJobke merged commit 5448306 into master Apr 20, 2021
@MorrisJobke MorrisJobke deleted the bugfix/noid/continue-on-denied-acls branch April 20, 2021 19:35
@MorrisJobke
Copy link
Member

@juliushaertl Backport?

@juliusknorr
Copy link
Member Author

/backport to stable21

@juliusknorr
Copy link
Member Author

/backport to stable20

@juliusknorr
Copy link
Member Author

/backport to stable19

@ghost
Copy link

ghost commented Jul 17, 2021

Hi! So im on the 21.0.3 docker version, this fix was backported to - still having the issue with local-mounted external folders:
Running: docker exec --user www-data nc_dd_app_1 php occ files:scan --path="/Dominik/files/nas_Setups/Tools"
still getting a Permission denied exception:

Exception during scan: opendir(/mnt/nas_Setups/Tools/@eaDir): failed to open dir: Permission denied
#0 [internal function]: OCA\Files\Command\Scan->exceptionErrorHandler(2, 'opendir(/mnt/na...', '/var/www/html/l...', 135, Array)
#1 /var/www/html/lib/private/Files/Storage/Local.php(135): opendir('/mnt/nas_Setups...')
#2 /var/www/html/lib/private/Files/Storage/Common.php(878): OC\Files\Storage\Local->opendir('Tools/@eaDir')
#3 /var/www/html/lib/private/Files/Storage/Wrapper/PermissionsMask.php(158): OC\Files\Storage\Common->getDirectoryContent('Tools/@eaDir')
#4 [internal function]: OC\Files\Storage\Wrapper\PermissionsMask->getDirectoryContent('Tools/@eaDir')
#5 /var/www/html/lib/private/Files/Cache/Scanner.php(409): iterator_to_array(Object(Generator))
#6 /var/www/html/lib/private/Files/Cache/Scanner.php(389): OC\Files\Cache\Scanner->handleChildren('Tools/@eaDir', true, 3, 1046216, true, 0)
#7 /var/www/html/lib/private/Files/Cache/Scanner.php(392): OC\Files\Cache\Scanner->scanChildren('Tools/@eaDir', true, 3, 1046216, true)
#8 /var/www/html/lib/private/Files/Cache/Scanner.php(341): OC\Files\Cache\Scanner->scanChildren('Tools', true, 3, 864151, true)
#9 /var/www/html/lib/private/Files/Utils/Scanner.php(260): OC\Files\Cache\Scanner->scan('Tools', true, 3)
#10 /var/www/html/apps/files/lib/Command/Scan.php(158): OC\Files\Utils\Scanner->scan('/Dominik/files/...', true, NULL)
#11 /var/www/html/apps/files/lib/Command/Scan.php(214): OCA\Files\Command\Scan->scanFiles('Dominik', '/Dominik/files/...', Object(Symfony\Component\Console\Output\ConsoleOutput), false, true, false)
#12 /var/www/html/3rdparty/symfony/console/Command/Command.php(255): OCA\Files\Command\Scan->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/html/core/Command/Base.php(169): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/html/3rdparty/symfony/console/Application.php(1009): OC\Core\Command\Base->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Files\Command\Scan), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/html/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/html/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/html/console.php(100): OC\Console\Application->run()
#19 /var/www/html/occ(11): require_once('/var/www/html/c...')
#20 {main}

ACL for the folder is user:nextcloud_docker:deny:rwxpdDaARWcCo:fd-- (level:0)

@juliusknorr
Copy link
Member Author

Does not seem related to this PR as this one is about mounted SMB storage through external storages and you are using a local folder, so please open a new issue about that.

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

Labels

3. to review Waiting for reviews bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants