[epiphany] migration: be more strict with checks when storing



commit da08ca431fedfaea6a77b53a07e6b67331d1cba8
Author: Diego Escalante Urrelo <descalante igalia com>
Date:   Mon Mar 15 17:57:16 2010 -0500

    migration: be more strict with checks when storing
    
    Make sure we don't confuse form passwords with HTTP auth passwords. And also
    check that username is not empty (at least that). Sometimes decryption fails
    (not even nss tools work) and we get empty usernames. As you can see, we are
    assuming here that usernames are always mandatory but passwords might not be.

 lib/ephy-profile-migration.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/lib/ephy-profile-migration.c b/lib/ephy-profile-migration.c
index fd717cc..991a212 100644
--- a/lib/ephy-profile-migration.c
+++ b/lib/ephy-profile-migration.c
@@ -292,7 +292,9 @@ parse_and_decrypt_signons (const char *signons,
           begin++;
       }
 
-      if (handle_forms && username && password && 
+      if (handle_forms && !realm &&
+          username && password &&
+          !g_str_equal (username, "") &&
           !g_str_equal (form_username, "") &&
           !g_str_equal (form_password, "*")) {
         char *u = soup_uri_to_string (uri, FALSE);
@@ -303,7 +305,10 @@ parse_and_decrypt_signons (const char *signons,
                                             username,
                                             password);
         g_free (u);
-      } else if (!handle_forms && username && password) {
+      } else if (!handle_forms && realm &&
+                 username && password &&
+                 !g_str_equal (username, "") &&
+                 form_username == NULL && form_password == NULL) {
         gnome_keyring_set_network_password_sync (NULL,
                                                  username,
                                                  realm,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]