Skip to content

Inconsistent exception handling when using webdav before accepting ToS #1101

@sunetfreitag

Description

@sunetfreitag

Steps to reproduce

  1. Enable ToS for a user
  2. Do not accept ToS
  3. Use webdav client to make directory or list directories

Relevant python code to test:

from webdav3.client import Client
try:
    client = Client(options)
    client.verify = drv.verify
    dir = 'SharedFolder'
    client.list()       # OCA\\TermsOfService\\TermsNotSignedException
    self.logger.info(f'Make and check directory: {dir}')
    client.mkdir(dir)   # /SharedFolder/ not found
    self.assertEqual(client.list().count('SharedFolder/'), 1)
except Exception as error:
    self.logger.error(f'Error making {dir}: {error}')

Expected behaviour

All webdav calls should return the same exception in case the ToS have not been accepted

Actual behaviour

client.list throws the correct exception (OCA\TermsOfService\TermsNotSignedException)
client.mkdir(dir) only returns a folder not found exception

Server configuration

Web server: Apache (apache2handler)

Database: mysql 10.11.14

PHP version: 8.2.29

Nextcloud version: 31.0.9 Enterprise - 31.0.9.2

List of activated apps
Enabled:
  - activity: 4.0.0
  - admin_audit: 1.21.0
  - announcementcenter: 7.2.1
  - app_api: 5.0.2
  - assistant: 2.8.0
  - auto_groups: 1.6.2
  - bruteforcesettings: 4.0.0
  - calendar: 5.5.5
  - checksum: 1.2.6
  - circles: 31.0.0
  - cloud_federation_api: 1.14.0
  - collectives: 3.1.2
  - comments: 1.21.0
  - contacts: 7.3.2
  - contactsinteraction: 1.12.0
  - dashboard: 7.11.0
  - dav: 1.33.0
  - deck: 1.15.2
  - dicomviewer: 2.3.1
  - federatedfilesharing: 1.21.0
  - federation: 1.21.0
  - files: 2.3.1
  - files_accesscontrol: 2.0.1
  - files_automatedtagging: 2.0.0
  - files_confidential: 3.3.0
  - files_downloadlimit: 4.0.0
  - files_external: 1.23.0
  - files_lock: 31.0.2
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_retention: 2.0.1
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - forms: 5.2.0
  - imap_manager: 0.0.4
  - integration_jupyterhub: 0.1.4
  - integration_oidc: 0.1.6
  - integration_openai: 3.7.1
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - nextcloud_announcements: 3.0.0
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - photos: 4.0.0
  - polls: 8.4.6
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - recommendations: 4.0.0
  - related_resources: 2.0.0
  - richdocuments: 8.7.5
  - security_guard: 2.3.1
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - sharelisting: 1.3.0
  - support: 3.0.0
  - survey_client: 3.0.0
  - suspicious_login: 9.0.1
  - systemtags: 1.21.1
  - tasks: 0.16.1
  - terms_of_service: 4.6.0
  - text: 5.0.0
  - theming: 2.6.1
  - theming_customcss: 1.18.0
  - twofactor_admin: 4.8.0
  - twofactor_backupcodes: 1.20.0
  - twofactor_nextcloud_notification: 5.0.0
  - twofactor_totp: 13.0.0-dev.0
  - twofactor_webauthn: 2.4.0
  - updatenotification: 1.21.0
  - user_saml: 6.6.0
  - user_status: 1.11.0
  - viewer: 4.0.0
  - weather_status: 1.11.0
  - webhook_listeners: 1.2.0
  - workflowengine: 2.13.0
Disabled:
  - drive_email_template: 0.1
  - edusign: 0.0.3 (installed 0.0.3)
  - encryption: 2.19.0
  - firstrunwizard: 4.0.0 (installed 2.18.0)
  - globalsiteselector: 2.6.1 (installed 2.5.2)
  - groupfolders: 19.1.5
  - login_notes: 1.7.0 (installed 1.7.0)
  - mfazones: 0.2.4 (installed 0.2.4)
  - rdsng: 1.2.0
  - stepupauth: 0.2.3 (installed 0.2.2)
  - user_ldap: 1.22.0```
</details>

### Browser
No browser necessary

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions