1 /* check resource: protocol for traversal problems */
3 const Cc
= Components
.classes
;
4 const Ci
= Components
.interfaces
;
5 const Cr
= Components
.results
;
8 "resource:///chrome/../plugins",
9 "resource:///chrome%2f../plugins",
10 "resource:///chrome/..%2fplugins",
11 "resource:///chrome%2f%2e%2e%2fplugins",
12 "resource:///../../../..",
13 "resource:///..%2f..%2f..%2f..",
18 var ios
= Cc
["@mozilla.org/network/io-service;1"].
19 getService(Ci
.nsIIOService
);
21 for each (spec
in specs
) {
22 uri
= ios
.newURI(spec
,null,null);
23 if (uri
.spec
.indexOf("..") != -1)
24 do_throw("resource: traversal remains: '"+spec
+"' ==> '"+uri
.spec
+"'");