sailfishos / sailfish-secrets

BSD 3-Clause "New" or "Revised" License
24 stars 15 forks source link

[sailfish-secrets] Return an error to client on DBus connection error. Fix Github#155 #159

Closed dcaliste closed 5 years ago

dcaliste commented 5 years ago

Close #155.

The case when the DBus reply is an error was not treated previously. So, if the daemon is too slow to answer (or die?) and the CryptoManager or the SecretManager timeout, the result was successful and the result was empty.

Hopefully, I've catched all requests ;)

@chriadam or @Venemo any remarks ?

chriadam commented 5 years ago

Created JB#45807 to track this issue internally

chriadam commented 5 years ago

Just double checking: manual test for this case is to run "secret-tool --get-user-input" and then manually devel-su kill -9 PID_OF_SECRETSD, and then check that the appropriate (dbus) error message is printed by the secret-tool (i.e. handling the dbus error reply)?

dcaliste commented 5 years ago

Yes, that's it also. Another test case (more common, I would say), is the timeout case. Run the get input command and let the request connection with the daemon timeout. Without the patch, the return value is null string with success, while it should be an error result.

chriadam commented 5 years ago

Thanks very much!