[Commits] [SCM] claws branch, master, updated. 3.13.2-76-g2eedcae

ticho at claws-mail.org ticho at claws-mail.org
Sat Mar 19 20:02:56 CET 2016


The branch, master has been updated
       via  2eedcaea0fcc6a09e6774f90ab61f35a0d19b7e1 (commit)
      from  da1b45c1f740e74c392081065aa36c0bbf4a3e99 (commit)

Summary of changes:
 src/passwordstore.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)


- Log -----------------------------------------------------------------
commit 2eedcaea0fcc6a09e6774f90ab61f35a0d19b7e1
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Mar 19 20:00:57 2016 +0100

    Do not create password block when deleting a password from store.

diff --git a/src/passwordstore.c b/src/passwordstore.c
index a518b7c..dfc96a0 100644
--- a/src/passwordstore.c
+++ b/src/passwordstore.c
@@ -121,11 +121,17 @@ gboolean passwd_store_set(PasswordBlockType block_type,
 			(encrypted ? ", already encrypted" : "") );
 
 	// find correct block (create if needed)
-	if ((block = _get_block(block_type, block_name)) == NULL &&
-			(block = _new_block(block_type, block_name)) == NULL) {
-		debug_print("Could not create password block (%d/%s)\n",
-				block_type, block_name);
-		return FALSE;
+	if ((block = _get_block(block_type, block_name)) == NULL) {
+		/* If caller wants to delete a password, and even its block
+		 * doesn't exist, we're done. */
+		if (password == NULL)
+			return TRUE;
+
+		if ((block = _new_block(block_type, block_name)) == NULL) {
+			debug_print("Could not create password block (%d/%s)\n",
+					block_type, block_name);
+			return FALSE;
+		}
 	}
 
 	if (password == NULL) {

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list