From d9fe2b4c1a9b7a3ad36e8525572dc6c8165498bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Tue, 16 May 2017 16:03:58 +0800 Subject: [PATCH] Added an illustration on how verifying old password works when changing the library password. --- bin/obasync | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bin/obasync b/bin/obasync index 77c815f..1bd64c3 100755 --- a/bin/obasync +++ b/bin/obasync @@ -581,6 +581,18 @@ def set_library_password(storage, libname): print("ERROR: Please enter the old password.", file=sys.stderr) continue + # There is no easy way to verify the old password. + # The verifyLibraryPassword() method does not work when + # the password of the library was verified before. + # The changeLibraryPassword() method always success + # when the old password is the same as the new password. + # So I have to change the password to a temporary password + # to verify the old password, and then change it back. + # This has the risk that if the script crashes between, + # the password is changed, and the users do not know how + # to get back their password-protected library. + # But I suppose the users has the local files as their + # source repository. tmppass = oldpass + "tmp" try: storage.libs.changeLibraryPassword(