~ubuntu-branches/ubuntu/jaunty/xulrunner-1.9/jaunty

« back to all changes in this revision

Viewing changes to debian/patches/bz454708_att340035.patch

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack
  • Date: 2008-09-25 17:05:45 UTC
  • Revision ID: james.westby@ubuntu.com-20080925170545-mtei9bmka2tpsk1x
Tags: 1.9.0.3+build1+nobinonly-0ubuntu2
regression fix release (v1.9.0.3 build1)
- see USN-645-3

* fix LP: #270429 - [MASTER] passwords lost from 3.0.1 to 3.0.2; we drop
  the prepatch shipped in previous package as this was applied upstream now.
  - delete debian/patches/bz454708_att340035.patch
  - update debian/patches/series

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
---
2
 
 toolkit/components/passwordmgr/src/storage-Legacy.js              |    6 +-
3
 
 toolkit/components/passwordmgr/test/unit/data/signons-454708.txt  |   10 +++
4
 
 toolkit/components/passwordmgr/test/unit/test_storage_legacy_3.js |   26 ++++++++++
5
 
 3 files changed, 41 insertions(+), 1 deletion(-)
6
 
 
7
 
Index: mozilla/toolkit/components/passwordmgr/src/storage-Legacy.js
8
 
===================================================================
9
 
--- mozilla.orig/toolkit/components/passwordmgr/src/storage-Legacy.js
10
 
+++ mozilla/toolkit/components/passwordmgr/src/storage-Legacy.js
11
 
@@ -845,17 +845,21 @@
12
 
         var parseState = STATE.HEADER;
13
 
 
14
 
         var nsLoginInfo = new Components.Constructor(
15
 
                 "@mozilla.org/login-manager/loginInfo;1", Ci.nsILoginInfo);
16
 
         var processEntry = false;
17
 
 
18
 
         do {
19
 
             var hasMore = lineStream.readLine(line);
20
 
-            line.value = this._utfConverter.ConvertToUnicode(line.value);
21
 
+            try {
22
 
+              line.value = this._utfConverter.ConvertToUnicode(line.value);
23
 
+            } catch (e) {
24
 
+              this.log("Bad UTF8 conversion: " + line.value);
25
 
+            }
26
 
 
27
 
             switch (parseState) {
28
 
                 // Check file header
29
 
                 case STATE.HEADER:
30
 
                     if (line.value == "#2c") {
31
 
                         formatVersion = 0x2c;
32
 
                     } else if (line.value == "#2d") {
33
 
                         formatVersion = 0x2d;
34
 
Index: mozilla/toolkit/components/passwordmgr/test/unit/data/signons-454708.txt
35
 
===================================================================
36
 
--- /dev/null
37
 
+++ mozilla/toolkit/components/passwordmgr/test/unit/data/signons-454708.txt
38
 
@@ -0,0 +1,10 @@
39
 
+#2e
40
 
+.
41
 
+https://FcK�.jp
42
 
+put_user_here
43
 
+MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECEnlbhAkNBbBBBCexD5eaffSLGH/ORiFlQ4X
44
 
+*put_pw_here
45
 
+MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECHmiTaseYjkkBBAA0ILJTFSa5CnlpD5PTEYR
46
 
+https://FcK�.jp
47
 
+---
48
 
+.
49
 
Index: mozilla/toolkit/components/passwordmgr/test/unit/test_storage_legacy_3.js
50
 
===================================================================
51
 
--- mozilla.orig/toolkit/components/passwordmgr/test/unit/test_storage_legacy_3.js
52
 
+++ mozilla/toolkit/components/passwordmgr/test/unit/test_storage_legacy_3.js
53
 
@@ -536,16 +536,42 @@
54
 
 
55
 
 LoginTest.checkStorageData(storage, [utfHost], [utfUser1, utfUser2]);
56
 
 
57
 
 testdesc = "[flush and reload for verification]"
58
 
 LoginTest.initStorage(storage, OUTDIR, "output-451155.txt");
59
 
 LoginTest.checkStorageData(storage, [utfHost], [utfUser1, utfUser2]);
60
 
 
61
 
 
62
 
+/*
63
 
+ * ---------------------- Bug 454708 ----------------------
64
 
+ * Check that previous saved entries that are not valid UTF8
65
 
+ * are read without blowing up.
66
 
+ */
67
 
+
68
 
+/* ========== 16 ========== */
69
 
+testnum++;
70
 
+testdesc = "ensure bogus UTF8 strings don't cause failures."
71
 
+
72
 
+var badHost = "https://FcK" + String.fromCharCode(0x8a) + ".jp";
73
 
+var bad8User = Cc["@mozilla.org/login-manager/loginInfo;1"].
74
 
+               createInstance(Ci.nsILoginInfo);
75
 
+bad8User.init(badHost, badHost, null,
76
 
+              "dummydude", "itsasecret", "put_user_here", "put_pw_here");
77
 
+
78
 
+storage = LoginTest.initStorage(INDIR, "signons-454708.txt",
79
 
+                               OUTDIR, "output-454708.txt");
80
 
+LoginTest.checkStorageData(storage, [], [bad8User]);
81
 
+
82
 
+// The output file should contain valid UTF8 now, but the resulting
83
 
+// JS string value remains the same.
84
 
+
85
 
+testdesc = "[flush and reload for verification]"
86
 
+storage = LoginTest.reloadStorage(OUTDIR, "output-454708.txt");
87
 
+LoginTest.checkStorageData(storage, [], [bad8User]);
88
 
 
89
 
 
90
 
 /* ========== end ========== */
91
 
 } catch (e) {
92
 
     throw ("FAILED in test #" + testnum + " -- " + testdesc + ": " + e);
93
 
 }
94
 
 
95
 
 };