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

[Bug]: and FIX user_ldap assumes non-numeric usernames #43414

Closed
5 of 8 tasks
alpapan opened this issue Feb 7, 2024 · 1 comment
Closed
5 of 8 tasks

[Bug]: and FIX user_ldap assumes non-numeric usernames #43414

alpapan opened this issue Feb 7, 2024 · 1 comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 28-feedback bug feature: ldap

Comments

@alpapan
Copy link

alpapan commented Feb 7, 2024

⚠️ This issue respects the following points: ⚠️

Bug description

The user_ldap code makes an assumption that usernames can always be interpreted as strings. However numeric usernames are possible and is_string(12424) gives FALSE.

sudo -u www-data php /var/www/nextcloud/occ fulltextsearch:index

An unhandled exception has been thrown:
Error: Object of class OCA\User_LDAP\User\User could not be converted to string in /var/www/nextcloud/apps/user_ldap/lib/User_LDAP.php:312
Stack trace:
#0 [internal function]: OCA\User_LDAP\User_LDAP->userExistsOnLDAP()
#1 /var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php(126): call_user_func_array()
#2 /var/www/nextcloud/apps/user_ldap/lib/Proxy.php(140): OCA\User_LDAP\User_Proxy->walkBackends()
#3 /var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php(262): OCA\User_LDAP\Proxy->handleRequest()
#4 /var/www/nextcloud/apps/user_ldap/lib/User_Proxy.php(239): OCA\User_LDAP\User_Proxy->userExistsOnLDAP()
#5 /var/www/nextcloud/lib/private/User/Manager.php(168): OCA\User_LDAP\User_Proxy->userExists()
#6 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(399): OC\User\Manager->get()
#7 /var/www/nextcloud/apps/files_fulltextsearch/lib/Service/FilesService.php(226): OCA\Files_FullTextSearch\Service\FilesService->initFileSystems()
#8 /var/www/nextcloud/apps/files_fulltextsearch/lib/Provider/FilesProvider.php(246): OCA\Files_FullTextSearch\Service\FilesService->getChunksFromUser()
#9 /var/www/nextcloud/apps/fulltextsearch/lib/Service/IndexService.php(174): OCA\Files_FullTextSearch\Provider\FilesProvider->generateChunks()
#10 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(403): OCA\FullTextSearch\Service\IndexService->indexProviderContentFromUser()
#11 /var/www/nextcloud/apps/fulltextsearch/lib/Command/Index.php(280): OCA\FullTextSearch\Command\Index->indexProvider()
#12 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(298): OCA\FullTextSearch\Command\Index->execute()
#13 /var/www/nextcloud/core/Command/Base.php(177): Symfony\Component\Console\Command\Command->run()
#14 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1040): OC\Core\Command\Base->run()
#15 /var/www/nextcloud/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
#16 /var/www/nextcloud/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#17 /var/www/nextcloud/lib/private/Console/Application.php(206): Symfony\Component\Console\Application->run()
#18 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
#19 /var/www/nextcloud/occ(11): require_once('...')
#20 {main}roopico /var/www/nextcloud/apps/user_ldap/lib/User/OfflineUser.phparch:index

Steps to reproduce

  1. have a username composed of numbers
  2. sudo -u www-data php /var/www/nextcloud/occ fulltextsearch:index

Expected behavior

to not give an exception

Installation method

None

Nextcloud Server version

28

Operating system

None

PHP engine version

PHP 8.2

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

@alpapan alpapan added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Feb 7, 2024
@solracsf
Copy link
Member

solracsf commented Feb 7, 2024

Duplicate of #35642
Not the same stack trace, but issue is the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 28-feedback bug feature: ldap
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants