aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <descalante@igalia.com>2010-03-16 06:57:16 +0800
committerDiego Escalante Urrelo <descalante@igalia.com>2010-03-16 09:03:16 +0800
commitda08ca431fedfaea6a77b53a07e6b67331d1cba8 (patch)
tree3c33645d51ce8bd8b6d4114f08daa7a08fb4630b /lib
parent5d2c310ba6e13fbfa3cb41c40c9b4b9e387df04e (diff)
downloadgsoc2013-epiphany-da08ca431fedfaea6a77b53a07e6b67331d1cba8.tar.gz
gsoc2013-epiphany-da08ca431fedfaea6a77b53a07e6b67331d1cba8.tar.zst
gsoc2013-epiphany-da08ca431fedfaea6a77b53a07e6b67331d1cba8.zip
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/ephy-profile-migration.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/ephy-profile-migration.c b/lib/ephy-profile-migration.c
index fd717cc0a..991a21248 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,