undeflife / libreoffice-rs

Rust binding to LibreOfficeKit
Apache License 2.0
15 stars 7 forks source link

Enhancement - Mitigate infinite loops upon wrong password entry #4

Closed yveszoundi closed 2 years ago

yveszoundi commented 2 years ago

Problem statement

When a wrong password is set for a given document, LibreOffice will continuously send password requests until the document is loaded (inside callbacks): This can essentially trigger infinite loops.

Description of proposed solution

Approach

A solution is to introduce an unset_document_password method that sets the password to a null pointer for a given URI.

Other considerations

It appears that LibreOfficeKit does not expose synchronization methods required for callback invocation("notify" for waiting locks/monitors). Even if you properly set or unset a password, you might get few additional "meaningless callbacks".

yveszoundi commented 2 years ago

@undeflife, I'll provide a pull request for this (very soon).

Minimal application for testing the proposed approach