merge mozilla-central to autoland. r=merge a=merge

This commit is contained in:
Sebastian Hengst 2017-04-29 21:33:12 +02:00
Родитель ab6f4b520c 218d14273c
Коммит 450ceee50f
73 изменённых файлов: 19360 добавлений и 18495 удалений

Просмотреть файл

@ -3488,41 +3488,23 @@ function getPEMString(cert) {
var PrintPreviewListener = {
_printPreviewTab: null,
_simplifiedPrintPreviewTab: null,
_tabBeforePrintPreview: null,
_simplifyPageTab: null,
_lastRequestedPrintPreviewTab: null,
_createPPBrowser() {
if (!this._tabBeforePrintPreview) {
this._tabBeforePrintPreview = gBrowser.selectedTab;
}
let browser = this._tabBeforePrintPreview.linkedBrowser;
let preferredRemoteType = browser.remoteType;
return gBrowser.loadOneTab("about:printpreview", {
inBackground: true,
preferredRemoteType,
sameProcessAsFrameLoader: browser.frameLoader
});
},
getPrintPreviewBrowser() {
if (!this._printPreviewTab) {
this._printPreviewTab = this._createPPBrowser();
let browser = gBrowser.selectedBrowser;
let preferredRemoteType = browser.remoteType;
this._tabBeforePrintPreview = gBrowser.selectedTab;
this._printPreviewTab = gBrowser.loadOneTab("about:printpreview", {
inBackground: false,
preferredRemoteType,
sameProcessAsFrameLoader: browser.frameLoader
});
gBrowser.selectedTab = this._printPreviewTab;
}
gBrowser._allowTabChange = true;
this._lastRequestedPrintPreviewTab = gBrowser.selectedTab = this._printPreviewTab;
gBrowser._allowTabChange = false;
return gBrowser.getBrowserForTab(this._printPreviewTab);
},
getSimplifiedPrintPreviewBrowser() {
if (!this._simplifiedPrintPreviewTab) {
this._simplifiedPrintPreviewTab = this._createPPBrowser();
}
gBrowser._allowTabChange = true;
this._lastRequestedPrintPreviewTab = gBrowser.selectedTab = this._simplifiedPrintPreviewTab;
gBrowser._allowTabChange = false;
return gBrowser.getBrowserForTab(this._simplifiedPrintPreviewTab);
},
createSimplifiedBrowser() {
let browser = this._tabBeforePrintPreview.linkedBrowser;
this._simplifyPageTab = gBrowser.loadOneTab("about:printpreview", {
@ -3545,8 +3527,8 @@ var PrintPreviewListener = {
onEnter() {
// We might have accidentally switched tabs since the user invoked print
// preview
if (gBrowser.selectedTab != this._lastRequestedPrintPreviewTab) {
gBrowser.selectedTab = this._lastRequestedPrintPreviewTab;
if (gBrowser.selectedTab != this._printPreviewTab) {
gBrowser.selectedTab = this._printPreviewTab;
}
gInPrintPreviewMode = true;
this._toggleAffectedChrome();
@ -3556,15 +3538,13 @@ var PrintPreviewListener = {
this._tabBeforePrintPreview = null;
gInPrintPreviewMode = false;
this._toggleAffectedChrome();
let tabsToRemove = ["_simplifyPageTab", "_printPreviewTab", "_simplifiedPrintPreviewTab"];
for (let tabProp of tabsToRemove) {
if (this[tabProp]) {
gBrowser.removeTab(this[tabProp]);
this[tabProp] = null;
}
if (this._simplifyPageTab) {
gBrowser.removeTab(this._simplifyPageTab);
this._simplifyPageTab = null;
}
gBrowser.removeTab(this._printPreviewTab);
gBrowser.deactivatePrintPreviewBrowsers();
this._lastRequestedPrintPreviewTab = null;
this._printPreviewTab = null;
},
_toggleAffectedChrome() {
gNavToolbox.collapsed = gInPrintPreviewMode;

Просмотреть файл

@ -3401,7 +3401,7 @@
</getter>
<setter>
<![CDATA[
if (gNavToolbox.collapsed && !this._allowTabChange) {
if (gNavToolbox.collapsed) {
return this.mTabBox.selectedTab;
}
// Update the tab

Просмотреть файл

@ -46,6 +46,7 @@ const FILTER_FLAGS = [
"larger-than",
"is",
"has-response-header",
"regexp",
];
/*
@ -93,6 +94,8 @@ function parseFilters(query) {
function processFlagFilter(type, value) {
switch (type) {
case "regexp":
return value;
case "size":
case "transferred":
case "larger-than":
@ -182,6 +185,14 @@ function isFlagFilterMatch(item, { type, value, negative }) {
let scheme = new URL(item.url).protocol.replace(":", "").toLowerCase();
match = scheme === value;
break;
case "regexp":
try {
let pattern = new RegExp(value);
match = pattern.test(item.url);
} catch (e) {
match = false;
}
break;
case "set-cookie-domain":
if (responseCookies.length > 0) {
let host = item.urlDetails.host;

Просмотреть файл

@ -183,6 +183,10 @@ add_task(function* () {
setFreetextFilter("-mime-type:HtmL status-code:200");
testContents([0, 1, 1, 1, 1, 1, 1, 0]);
// Test regex filter
setFreetextFilter("regexp:content.*?Sam");
testContents([1, 0, 0, 0, 0, 0, 0, 0]);
yield teardown(monitor);
function testContents(visibility) {

Просмотреть файл

@ -2,7 +2,7 @@
tags = devtools
subsuite = devtools
# !e10s: RDM only works for remote tabs
skip-if = !e10s || (e10s && os == "win" && (bits == 64)) # Win64: Bug 1319248
skip-if = !e10s || (e10s && os == "win") # Win: Bug 1319248
support-files =
devices.json
doc_page_state.html

Просмотреть файл

@ -328,9 +328,12 @@ const NativePropertyHooks sWindowNamedPropertiesNativePropertyHooks[] = { {
nullptr
} };
// Note that this class doesn't need any reserved slots, but SpiderMonkey
// asserts all proxy classes have at least one reserved slot.
static const DOMIfaceAndProtoJSClass WindowNamedPropertiesClass = {
PROXY_CLASS_DEF("WindowProperties",
JSCLASS_IS_DOMIFACEANDPROTOJSCLASS),
JSCLASS_IS_DOMIFACEANDPROTOJSCLASS |
JSCLASS_HAS_RESERVED_SLOTS(1)),
eNamedPropertiesObject,
false,
prototypes::id::_ID_Count,

Просмотреть файл

@ -1143,9 +1143,12 @@ static const js::ClassExtension OuterWindowProxyClassExtension = PROXY_MAKE_EXT(
nsOuterWindowProxy::ObjectMoved
);
// Give OuterWindowProxyClass 2 reserved slots, like the other wrappers, so
// JSObject::swap can swap it with CrossCompartmentWrappers without requiring
// malloc.
const js::Class OuterWindowProxyClass = PROXY_CLASS_WITH_EXT(
"Proxy",
0, /* additional class flags */
JSCLASS_HAS_RESERVED_SLOTS(2), /* additional class flags */
&OuterWindowProxyClassExtension);
const char *

Просмотреть файл

@ -528,7 +528,9 @@ class CGDOMProxyJSClass(CGThing):
return ""
def define(self):
flags = ["JSCLASS_IS_DOMJSCLASS"]
# We need one reserved slot (DOM_OBJECT_SLOT).
flags = ["JSCLASS_IS_DOMJSCLASS",
"JSCLASS_HAS_RESERVED_SLOTS(1)"]
# We don't use an IDL annotation for JSCLASS_EMULATES_UNDEFINED because
# we don't want people ever adding that to any interface other than
# HTMLAllCollection. So just hardcode it here.

Просмотреть файл

@ -681,6 +681,57 @@ inline void assertEnteredPolicy(JSContext* cx, JSObject* obj, jsid id,
extern JS_FRIEND_API(JSObject*)
InitProxyClass(JSContext* cx, JS::HandleObject obj);
extern JS_FRIEND_DATA(const js::ClassOps) ProxyClassOps;
extern JS_FRIEND_DATA(const js::ClassExtension) ProxyClassExtension;
extern JS_FRIEND_DATA(const js::ObjectOps) ProxyObjectOps;
/*
* Helper Macros for creating JSClasses that function as proxies.
*
* NB: The macro invocation must be surrounded by braces, so as to
* allow for potential JSClass extensions.
*/
#define PROXY_MAKE_EXT(objectMoved) \
{ \
js::proxy_WeakmapKeyDelegate, \
objectMoved \
}
template <unsigned Flags>
constexpr unsigned
CheckProxyFlags()
{
// For now assert each Proxy Class has at least 1 reserved slot. This is
// not a hard requirement, but helps catch Classes that need an explicit
// JSCLASS_HAS_RESERVED_SLOTS since bug 1360523.
static_assert(((Flags >> JSCLASS_RESERVED_SLOTS_SHIFT) & JSCLASS_RESERVED_SLOTS_MASK) > 0,
"Proxy Classes must have at least 1 reserved slot");
// ProxyValueArray must fit inline in the object, so assert the number of
// slots does not exceed MAX_FIXED_SLOTS.
static_assert((offsetof(js::detail::ProxyValueArray, reservedSlots) / sizeof(Value)) +
((Flags >> JSCLASS_RESERVED_SLOTS_SHIFT) & JSCLASS_RESERVED_SLOTS_MASK)
<= shadow::Object::MAX_FIXED_SLOTS,
"ProxyValueArray size must not exceed max JSObject size");
return Flags;
}
#define PROXY_CLASS_WITH_EXT(name, flags, extPtr) \
{ \
name, \
js::Class::NON_NATIVE | \
JSCLASS_IS_PROXY | \
JSCLASS_DELAY_METADATA_BUILDER | \
js::CheckProxyFlags<flags>(), \
&js::ProxyClassOps, \
JS_NULL_CLASS_SPEC, \
extPtr, \
&js::ProxyObjectOps \
}
#define PROXY_CLASS_DEF(name, flags) \
PROXY_CLASS_WITH_EXT(name, flags, &js::ProxyClassExtension)
} /* namespace js */
#endif /* js_Proxy_h */

Просмотреть файл

@ -20,7 +20,7 @@ static const js::ClassExtension OuterWrapperClassExtension = PROXY_MAKE_EXT(
const js::Class OuterWrapperClass = PROXY_CLASS_WITH_EXT(
"Proxy",
0, /* additional class flags */
JSCLASS_HAS_RESERVED_SLOTS(1), /* additional class flags */
&OuterWrapperClassExtension);
static JSObject*

Просмотреть файл

@ -343,39 +343,6 @@ JS_DefineFunctionsWithHelp(JSContext* cx, JS::HandleObject obj, const JSFunction
namespace js {
extern JS_FRIEND_DATA(const js::ClassOps) ProxyClassOps;
extern JS_FRIEND_DATA(const js::ClassExtension) ProxyClassExtension;
extern JS_FRIEND_DATA(const js::ObjectOps) ProxyObjectOps;
/*
* Helper Macros for creating JSClasses that function as proxies.
*
* NB: The macro invocation must be surrounded by braces, so as to
* allow for potential JSClass extensions.
*/
#define PROXY_MAKE_EXT(objectMoved) \
{ \
js::proxy_WeakmapKeyDelegate, \
objectMoved \
}
#define PROXY_CLASS_WITH_EXT(name, flags, extPtr) \
{ \
name, \
js::Class::NON_NATIVE | \
JSCLASS_IS_PROXY | \
JSCLASS_DELAY_METADATA_BUILDER | \
JSCLASS_HAS_RESERVED_SLOTS(2) | \
flags, \
&js::ProxyClassOps, \
JS_NULL_CLASS_SPEC, \
extPtr, \
&js::ProxyObjectOps \
}
#define PROXY_CLASS_DEF(name, flags) \
PROXY_CLASS_WITH_EXT(name, flags, &js::ProxyClassExtension)
extern JS_FRIEND_API(JSObject*)
proxy_WeakmapKeyDelegate(JSObject* obj);
@ -556,6 +523,8 @@ struct Object {
JS::Value* slots;
void* _1;
static const size_t MAX_FIXED_SLOTS = 16;
size_t numFixedSlots() const { return shape->slotInfo >> Shape::FIXED_SLOTS_SHIFT; }
JS::Value* fixedSlots() const {
return (JS::Value*)(uintptr_t(this) + sizeof(shadow::Object));

Просмотреть файл

@ -4680,7 +4680,7 @@ IsGrayListObject(JSObject* obj)
ProxyObject::grayLinkReservedSlot(JSObject* obj)
{
MOZ_ASSERT(IsGrayListObject(obj));
return 1;
return CrossCompartmentWrapperObject::GrayLinkReservedSlot;
}
#ifdef DEBUG

Просмотреть файл

@ -692,8 +692,11 @@ ProxyObject::trace(JSTracer* trc, JSObject* obj)
* The GC can use the second reserved slot to link the cross compartment
* wrappers into a linked list, in which case we don't want to trace it.
*/
if (proxy->is<CrossCompartmentWrapperObject>() && i == 1)
if (proxy->is<CrossCompartmentWrapperObject>() &&
i == CrossCompartmentWrapperObject::GrayLinkReservedSlot)
{
continue;
}
TraceEdge(trc, proxy->reservedSlotPtr(i), "proxy_reserved");
}
@ -779,7 +782,9 @@ const ObjectOps js::ProxyObjectOps = {
};
const Class js::ProxyObject::proxyClass =
PROXY_CLASS_DEF("Proxy", JSCLASS_HAS_CACHED_PROTO(JSProto_Proxy));
PROXY_CLASS_DEF("Proxy",
JSCLASS_HAS_CACHED_PROTO(JSProto_Proxy) |
JSCLASS_HAS_RESERVED_SLOTS(2));
const Class* const js::ProxyClassPtr = &js::ProxyObject::proxyClass;

Просмотреть файл

@ -876,7 +876,7 @@ class NativeObject : public ShapedObject
// MAX_FIXED_SLOTS is the biggest number of fixed slots our GC
// size classes will give an object.
static const uint32_t MAX_FIXED_SLOTS = 16;
static const uint32_t MAX_FIXED_SLOTS = shadow::Object::MAX_FIXED_SLOTS;
protected:
MOZ_ALWAYS_INLINE bool updateSlotsForSpan(JSContext* cx, size_t oldSpan, size_t newSpan);

Просмотреть файл

@ -20,6 +20,10 @@ GetProxyGCObjectKind(const Class* clasp, const BaseProxyHandler* handler, const
MOZ_ASSERT(clasp->isProxy());
uint32_t nreserved = JSCLASS_RESERVED_SLOTS(clasp);
// For now assert each Proxy Class has at least 1 reserved slot. This is
// not a hard requirement, but helps catch Classes that need an explicit
// JSCLASS_HAS_RESERVED_SLOTS since bug 1360523.
MOZ_ASSERT(nreserved > 0);
MOZ_ASSERT(js::detail::ProxyValueArray::sizeOf(nreserved) % sizeof(Value) == 0,

Просмотреть файл

@ -24,6 +24,8 @@ class WrapperObject : public ProxyObject
class CrossCompartmentWrapperObject : public WrapperObject
{
public:
static const unsigned GrayLinkReservedSlot = 1;
};
} // namespace js

Просмотреть файл

@ -1,7 +1,7 @@
default-preferences pref(layout.css.grid.enabled,true)
fails-if(!stylo) == grid-whitespace-handling-1a.xhtml grid-whitespace-handling-1-ref.xhtml
fails-if(!stylo) == grid-whitespace-handling-1b.xhtml grid-whitespace-handling-1-ref.xhtml
fails-if(!stylo) skip-if(stylo) == grid-whitespace-handling-1b.xhtml grid-whitespace-handling-1-ref.xhtml
fails-if(stylo) == grid-whitespace-handling-2.xhtml grid-whitespace-handling-2-ref.xhtml
fails-if(stylo) == grid-placement-definite-001.html grid-placement-definite-001-ref.html
fails-if(stylo) == grid-placement-definite-002.html grid-placement-definite-002-ref.html

Просмотреть файл

@ -1254,6 +1254,7 @@ nsStyleSVGReset::HasMask() const
// nsStyleSVGPaint implementation
nsStyleSVGPaint::nsStyleSVGPaint(nsStyleSVGPaintType aType)
: mType(aType)
, mFallbackType(eStyleSVGFallbackType_NotSet)
, mFallbackColor(NS_RGB(0, 0, 0))
{
MOZ_ASSERT(aType == nsStyleSVGPaintType(0) ||
@ -1288,6 +1289,7 @@ nsStyleSVGPaint::Reset()
MOZ_FALLTHROUGH;
case eStyleSVGPaintType_ContextFill:
case eStyleSVGPaintType_ContextStroke:
mFallbackType = eStyleSVGFallbackType_NotSet;
mFallbackColor = NS_RGB(0, 0, 0);
break;
}

Просмотреть файл

@ -3376,7 +3376,7 @@ protected:
nscoord mTwipsPerPixel;
};
enum nsStyleSVGPaintType {
enum nsStyleSVGPaintType : uint8_t {
eStyleSVGPaintType_None = 1,
eStyleSVGPaintType_Color,
eStyleSVGPaintType_Server,
@ -3384,6 +3384,12 @@ enum nsStyleSVGPaintType {
eStyleSVGPaintType_ContextStroke
};
enum nsStyleSVGFallbackType : uint8_t {
eStyleSVGFallbackType_NotSet,
eStyleSVGFallbackType_None,
eStyleSVGFallbackType_Color,
};
enum nsStyleSVGOpacitySource : uint8_t {
eStyleSVGOpacitySource_Normal,
eStyleSVGOpacitySource_ContextFillOpacity,
@ -3418,6 +3424,10 @@ public:
return mPaint.mPaintServer;
}
nsStyleSVGFallbackType GetFallbackType() const {
return mFallbackType;
}
nscolor GetFallbackColor() const {
MOZ_ASSERT(mType == eStyleSVGPaintType_Server ||
mType == eStyleSVGPaintType_ContextFill ||
@ -3439,6 +3449,7 @@ private:
mozilla::css::URLValue* mPaintServer;
} mPaint;
nsStyleSVGPaintType mType;
nsStyleSVGFallbackType mFallbackType;
nscolor mFallbackColor;
};

Просмотреть файл

@ -1158,4 +1158,4 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = {
static const int32_t kUnknownId = -1;
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1501858190044000);
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1501944717714000);

Просмотреть файл

@ -11,6 +11,7 @@
0xa.in: could not connect to host
0xb612.org: could not connect to host
0xf00.ch: did not receive HSTS header
1000serien.com: could not connect to host
100dayloans.com: max-age too low: 0
1018hosting.nl: did not receive HSTS header
1022996493.rsc.cdn77.org: could not connect to host
@ -23,6 +24,7 @@
163pwd.com: could not connect to host
16packets.com: could not connect to host
188betwarriors.co.uk: could not connect to host
1972969867.rsc.cdn77.org: did not receive HSTS header
1a-jva.de: could not connect to host
1cover.com: could not connect to host
1k8b.com: could not connect to host
@ -60,9 +62,9 @@
3yearloans.com: max-age too low: 0
404.sh: max-age too low: 0
404404.info: could not connect to host
41844.de: could not connect to host
420dongstorm.com: could not connect to host
42ms.org: could not connect to host
439191.com: did not receive HSTS header
4455software.com: did not receive HSTS header
4679.space: could not connect to host
47ronin.com: could not connect to host
@ -80,7 +82,7 @@
6120.eu: did not receive HSTS header
69square.com: could not connect to host
7kovrikov.ru: did not receive HSTS header
808.lv: did not receive HSTS header
808.lv: could not connect to host
83i.net: could not connect to host
911911.pw: could not connect to host
922.be: could not connect to host
@ -110,9 +112,11 @@ about.ge: did not receive HSTS header
aboutmyip.info: did not receive HSTS header
aboutyou-deals.de: did not receive HSTS header
abt.de: did not receive HSTS header
abthorpe.org: could not connect to host
abtom.de: did not receive HSTS header
abury.fr: did not receive HSTS header
abury.me: did not receive HSTS header
academialowcost.com.br: could not connect to host
accelerole.com: did not receive HSTS header
accessacademies.org: max-age too low: 0
accountradar.com: could not connect to host
@ -158,6 +162,7 @@ adrl.ca: could not connect to host
adsfund.org: could not connect to host
aduedu.de: did not receive HSTS header
advancedstudio.ro: did not receive HSTS header
advancis.net: could not connect to host
adver.top: could not connect to host
adviespuntklokkenluiders.nl: could not connect to host
aemoria.com: could not connect to host
@ -173,6 +178,7 @@ agalaxyfarfaraway.co.uk: could not connect to host
agate.pw: did not receive HSTS header
agatheetraphael.fr: could not connect to host
agbremen.de: did not receive HSTS header
ageg.ca: could not connect to host
agentseeker.ca: did not receive HSTS header
agevio.com: could not connect to host
agrimap.com: did not receive HSTS header
@ -211,14 +217,13 @@ alessandro.pw: did not receive HSTS header
alethearose.com: did not receive HSTS header
alexandre.sh: did not receive HSTS header
alexisabarca.com: did not receive HSTS header
alexpavel.com: could not connect to host
alfa24.pro: could not connect to host
alinode.com: could not connect to host
alisync.com: could not connect to host
alittlebitcheeky.com: did not receive HSTS header
alkami.com: did not receive HSTS header
all-subtitles.com: did not receive HSTS header
all.tf: did not receive HSTS header
all.tf: could not connect to host
alldaymonitoring.com: could not connect to host
allforyou.at: could not connect to host
allinnote.com: could not connect to host
@ -230,6 +235,7 @@ alphabit-secure.com: could not connect to host
alphabuild.io: did not receive HSTS header
alphalabs.xyz: could not connect to host
alt33c3.org: could not connect to host
alteqnia.com: could not connect to host
altfire.ca: could not connect to host
altmv.com: max-age too low: 7776000
alza.at: did not receive HSTS header
@ -281,7 +287,7 @@ anime.my: could not connect to host
animeday.ml: could not connect to host
animesfusion.com.br: could not connect to host
animesharp.com: could not connect to host
animurecs.com: could not connect to host
animurecs.com: did not receive HSTS header
aniplus.cf: could not connect to host
aniplus.gq: could not connect to host
aniplus.ml: could not connect to host
@ -337,7 +343,6 @@ appsdash.io: could not connect to host
appseccalifornia.org: did not receive HSTS header
aptive.co.uk: did not receive HSTS header
aqilacademy.com.au: could not connect to host
aqualogy.de: could not connect to host
aquilalab.com: could not connect to host
arabdigitalexpression.org: did not receive HSTS header
aradulconteaza.ro: could not connect to host
@ -512,7 +517,6 @@ bedabox.com: max-age too low: 0
bedeta.de: could not connect to host
bedreid.dk: did not receive HSTS header
bedrijvenadministratie.nl: did not receive HSTS header
beekbier.nl: could not connect to host
behere.be: could not connect to host
beholdthehurricane.com: could not connect to host
beier.io: did not receive HSTS header
@ -569,7 +573,7 @@ bildschirmflackern.de: did not receive HSTS header
billin.net: did not receive HSTS header
billkiss.com: could not connect to host
billninja.com: did not receive HSTS header
billrusling.com: did not receive HSTS header
billrusling.com: could not connect to host
binderapp.net: could not connect to host
bingcheung.com: did not receive HSTS header
biofam.ru: did not receive HSTS header
@ -580,6 +584,7 @@ birkman.com: did not receive HSTS header
biscoint.io: did not receive HSTS header
bisterfeldt.com: could not connect to host
bitchan.it: could not connect to host
bitcoin-india.net: did not receive HSTS header
bitcoinprivacy.net: did not receive HSTS header
bitcoinworld.me: could not connect to host
bitconcepts.co.uk: did not receive HSTS header
@ -593,6 +598,7 @@ bitnet.io: did not receive HSTS header
bitrage.de: did not receive HSTS header
bitraum.io: could not connect to host
bitsafe.systems: did not receive HSTS header
bittmann.me: did not receive HSTS header
bitvigor.com: could not connect to host
bityes.org: could not connect to host
bivsi.com: could not connect to host
@ -617,7 +623,6 @@ blitzprog.org: could not connect to host
blocksatz-medien.de: did not receive HSTS header
blog-ritaline.com: could not connect to host
blog.cyveillance.com: did not receive HSTS header
blog.lookout.com: did not receive HSTS header
blogabout.ru: did not receive HSTS header
bloglikepro.com: could not connect to host
blubbablasen.de: could not connect to host
@ -651,8 +656,6 @@ booked.holiday: could not connect to host
bookofraonlinecasinos.com: did not receive HSTS header
bookourdjs.com: max-age too low: 0
boomerang.com: did not receive HSTS header
boomshelf.com: could not connect to host
boomshelf.org: could not connect to host
boosterlearnpro.com: did not receive HSTS header
bootjp.me: did not receive HSTS header
borderlinegroup.com: max-age too low: 0
@ -689,9 +692,9 @@ brks.xyz: could not connect to host
broken-oak.com: could not connect to host
brokenhands.io: could not connect to host
brookechase.com: did not receive HSTS header
brookframework.org: did not receive HSTS header
browserid.org: did not receive HSTS header
brunix.net: did not receive HSTS header
brunner.ninja: could not connect to host
brunosouza.org: could not connect to host
bsagan.fr: could not connect to host
bsdtips.com: could not connect to host
@ -829,6 +832,7 @@ cecipu.gob.cl: could not connect to host
celina-reads.de: did not receive HSTS header
cellsites.nz: could not connect to host
centillien.com: did not receive HSTS header
centos.pub: did not receive HSTS header
centralvacsunlimited.net: could not connect to host
centrepoint-community.com: could not connect to host
ceritamalam.net: could not connect to host
@ -881,7 +885,6 @@ chinacdn.org: could not connect to host
chinawhale.com: did not receive HSTS header
chirgui.eu: could not connect to host
chm.vn: did not receive HSTS header
chocolatesandhealth.com: could not connect to host
chontalpa.pw: could not connect to host
choruscrowd.com: could not connect to host
chotu.net: could not connect to host
@ -964,7 +967,7 @@ cmsbattle.com: could not connect to host
cmscafe.ru: did not receive HSTS header
cmso-cal.com: could not connect to host
cn.search.yahoo.com: did not receive HSTS header
cncn.us: could not connect to host
cncn.us: did not receive HSTS header
cni-certing.it: max-age too low: 0
cnwage.com: could not connect to host
cnwarn.com: could not connect to host
@ -990,7 +993,6 @@ codiva.io: max-age too low: 2592000
coffeeetc.co.uk: did not receive HSTS header
coffeestrategies.com: max-age too low: 2592000
coiffeurschnittstelle.ch: did not receive HSTS header
coincoin.eu.org: could not connect to host
coindam.com: could not connect to host
coldlostsick.net: could not connect to host
collegepulse.org: did not receive HSTS header
@ -1281,6 +1283,7 @@ diezel.com: could not connect to host
digioccumss.ddns.net: could not connect to host
digitalbank.kz: could not connect to host
digitaldaddy.net: could not connect to host
digitalero.rip: did not receive HSTS header
digitalriver.tk: could not connect to host
digitalskillswap.com: could not connect to host
dim.lighting: could not connect to host
@ -1341,6 +1344,7 @@ dolphincorp.co.uk: could not connect to host
domaris.de: did not receive HSTS header
dominicpratt.de: did not receive HSTS header
dominique-mueller.de: did not receive HSTS header
donmez.uk: could not connect to host
donmez.ws: could not connect to host
donttrustrobots.nl: could not connect to host
donzelot.co.uk: max-age too low: 3600
@ -1384,12 +1388,12 @@ drtroyhendrickson.com: could not connect to host
drumbandesperanto.nl: could not connect to host
ds-christiansen.de: did not receive HSTS header
dshiv.io: could not connect to host
dtub.co: did not receive HSTS header
dubrovskiy.net: could not connect to host
dubrovskiy.pro: could not connect to host
duesee.org: could not connect to host
dullsir.com: did not receive HSTS header
dungi.org: could not connect to host
dutchessuganda.com: did not receive HSTS header
dutchrank.com: could not connect to host
dworzak.ch: could not connect to host
dycontrol.de: could not connect to host
@ -1459,6 +1463,7 @@ ehito.ovh: could not connect to host
ehrenamt-skpfcw.de: could not connect to host
eicfood.com: could not connect to host
eidolonhost.com: did not receive HSTS header
einaros.is: could not connect to host
ekbanden.nl: could not connect to host
eksik.com: could not connect to host
elaintehtaat.fi: did not receive HSTS header
@ -1583,11 +1588,12 @@ euanbaines.com: did not receive HSTS header
eucl3d.com: did not receive HSTS header
euclideanpostulates.xyz: could not connect to host
eupho.me: could not connect to host
euren.se: could not connect to host
eurocamping.se: could not connect to host
euroshop24.net: could not connect to host
evafojtova.cz: did not receive HSTS header
evdenevenakliyatankara.pw: did not receive HSTS header
everybooks.com: could not connect to host
everybooks.com: max-age too low: 60
everylab.org: could not connect to host
everything.place: could not connect to host
evin.ml: could not connect to host
@ -1626,7 +1632,7 @@ fabianasantiago.com: could not connect to host
fabianfischer.de: did not receive HSTS header
factorable.net: did not receive HSTS header
factorygw.com: did not receive HSTS header
fadilus.com: did not receive HSTS header
fadilus.com: could not connect to host
faesser.com: did not receive HSTS header
fail4free.de: did not receive HSTS header
failforward.org: did not receive HSTS header
@ -1657,6 +1663,7 @@ fatlossguide.xyz: could not connect to host
fatwin.pw: could not connect to host
fayolle.info: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 118" data: no]
fbox.li: could not connect to host
fca-tools.com: could not connect to host
fdj.im: could not connect to host
feac.us: could not connect to host
feard.space: could not connect to host
@ -1675,7 +1682,6 @@ festrip.com: could not connect to host
fexmen.com: could not connect to host
ffmradio.de: did not receive HSTS header
fics-twosigma.com: could not connect to host
fierman.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 118" data: no]
fiftyshadesofluca.ml: could not connect to host
fig.co: did not receive HSTS header
fightr.co: could not connect to host
@ -1721,7 +1727,6 @@ flags.ninja: could not connect to host
flamewall.net: could not connect to host
flareon.net: could not connect to host
flawcheck.com: did not receive HSTS header
fletchto99.com: could not connect to host
fliexer.com: could not connect to host
flirchi.com: did not receive HSTS header
floless.co.uk: did not receive HSTS header
@ -1734,6 +1739,7 @@ flow.pe: could not connect to host
flow.su: could not connect to host
flowersandclouds.com: could not connect to host
flowlo.me: could not connect to host
flucky.xyz: could not connect to host
fluidojobs.com: could not connect to host
flukethoughts.com: could not connect to host
flushstudios.com: did not receive HSTS header
@ -1808,7 +1814,6 @@ fullytrained.co.uk: did not receive HSTS header
fundacionhijosdelsol.org: could not connect to host
funi4u.com: could not connect to host
funkyweddingideas.com.au: could not connect to host
funnyang.com: could not connect to host
funrun.com: did not receive HSTS header
furiffic.com: did not receive HSTS header
furnation.com: could not connect to host
@ -1862,6 +1867,7 @@ gamerz-point.de: did not receive HSTS header
gamesdepartment.co.uk: did not receive HSTS header
gameserver-sponsor.de: could not connect to host
gamingmedia.eu: did not receive HSTS header
gamishou.fr: could not connect to host
gampenhof.de: did not receive HSTS header
gaptek.id: could not connect to host
garciamartin.me: could not connect to host
@ -1870,7 +1876,6 @@ gatapro.net: could not connect to host
gatorsa.es: did not receive HSTS header
gdegem.org: did not receive HSTS header
gdpventure.com: max-age too low: 0
gdz.tv: did not receive HSTS header
gedankenbude.info: could not connect to host
geekcast.co.uk: did not receive HSTS header
geeky.software: could not connect to host
@ -1883,7 +1888,7 @@ genyhitch.com: did not receive HSTS header
geofox.org: did not receive HSTS header
georgesonarthurs.com.au: did not receive HSTS header
gerencianet.com.br: did not receive HSTS header
gersting.net: could not connect to host
gersting.net: did not receive HSTS header
gesiwista.net: could not connect to host
gesunde-smoothies.de: did not receive HSTS header
get.zenpayroll.com: could not connect to host
@ -1914,6 +1919,7 @@ getremembrall.com: could not connect to host
getsello.com: could not connect to host
getwashdaddy.com: could not connect to host
gfm.tech: could not connect to host
gfournier.ca: could not connect to host
gfwsb.ml: could not connect to host
ggss.ml: could not connect to host
gheorghesarcov.ga: could not connect to host
@ -1983,6 +1989,7 @@ gopay.cz: did not receive HSTS header
gorilla-gym.site: could not connect to host
gothamlimo.com: could not connect to host
goto.google.com: did not receive HSTS header (error ignored - included regardless)
gotocloud.ru: could not connect to host
gotowned.org: did not receive HSTS header
gotspot.com: could not connect to host
gottcode.org: did not receive HSTS header
@ -1996,13 +2003,13 @@ gpstuner.com: did not receive HSTS header
grabi.ga: could not connect to host
gracesofgrief.com: could not connect to host
gradienthosting.co.uk: did not receive HSTS header
grana.com: did not receive HSTS header
grana.com: could not connect to host
grandmascookieblog.com: did not receive HSTS header
grantedby.me: max-age too low: 0
graph.no: did not receive HSTS header
graphsearchengine.com: could not connect to host
gratisonlinesex.com: could not connect to host
gravitation.pro: could not connect to host
gravitation.pro: did not receive HSTS header
gravito.nl: did not receive HSTS header
gravity-net.de: could not connect to host
graycell.net: could not connect to host
@ -2030,7 +2037,6 @@ gryffin.ga: could not connect to host
gryffin.ml: could not connect to host
gryffin.tk: could not connect to host
gsm-map.com: could not connect to host
gsmkungen.com: did not receive HSTS header
gsnort.com: could not connect to host
gtamodshop.org: could not connect to host
gtanda.tk: could not connect to host
@ -2099,7 +2105,6 @@ hancc.net: could not connect to host
handicapindeles.nl: did not receive HSTS header
handiworker.com: could not connect to host
hanfu.la: could not connect to host
hang333.pw: could not connect to host
hanimalis.fr: could not connect to host
hansen.hn: could not connect to host
hao2taiwan.com: max-age too low: 0
@ -2225,7 +2230,6 @@ hotchoc.io: did not receive HSTS header
houkago-step.com: did not receive HSTS header
housemaadiah.org: did not receive HSTS header
housingstudents.org.uk: could not connect to host
howbigismybuilding.com: could not connect to host
howrandom.org: could not connect to host
howtocuremysciatica.com: could not connect to host
hr-intranet.com: could not connect to host
@ -2262,6 +2266,7 @@ hyper69.com: did not receive HSTS header
i-jp.net: could not connect to host
i-partners.sk: did not receive HSTS header
i-rickroll-n.pw: could not connect to host
i10z.com: could not connect to host
iamokay.nl: did not receive HSTS header
iamreubin.co.uk: did not receive HSTS header
iamveto.com: could not connect to host
@ -2276,6 +2281,7 @@ ichoosebtec.com: could not connect to host
icity.ly: did not receive HSTS header
icloud.net: could not connect to host
icntorrent.download: could not connect to host
icodeconnect.com: could not connect to host
icodesign.me: could not connect to host
icreative.nl: did not receive HSTS header
ictradar.com: could not connect to host
@ -2297,7 +2303,6 @@ ierna.com: did not receive HSTS header
ies-italia.it: did not receive HSTS header
ies.id.lv: could not connect to host
ifad.org: did not receive HSTS header
ifconfig.co: did not receive HSTS header
ifleurs.com: could not connect to host
ifx.ee: could not connect to host
ignatisd.gr: did not receive HSTS header
@ -2510,7 +2515,6 @@ jayschulman.com: did not receive HSTS header
jayscoaching.com: did not receive HSTS header
jayshao.com: did not receive HSTS header
jbn.mx: could not connect to host
jcaicedo.tk: could not connect to host
jcch.de: could not connect to host
jcor.me: did not receive HSTS header
jcoscia.com: could not connect to host
@ -2550,6 +2554,7 @@ jingyuesi.com: could not connect to host
jirav.io: could not connect to host
jkb.pics: could not connect to host
jkbuster.com: could not connect to host
jmdekker.it: could not connect to host
joakimalgroy.com: could not connect to host
jobmedic.com: did not receive HSTS header
jobss.co.uk: did not receive HSTS header
@ -2567,13 +2572,14 @@ jongha.me: could not connect to host
jonn.me: could not connect to host
joostbovee.nl: did not receive HSTS header
jordanhamilton.me: could not connect to host
joretapo.fr: did not receive HSTS header
joretapo.fr: could not connect to host
jornane.me: max-age too low: 0
jornane.nl: max-age too low: 0
jornane.no: max-age too low: 0
josahrens.me: could not connect to host
joshi.su: could not connect to host
joshstroup.me: could not connect to host
jotpics.com: could not connect to host
jottit.com: could not connect to host
jpbike.cz: could not connect to host
jrc9.ca: did not receive HSTS header
@ -2592,7 +2598,7 @@ junaos.xyz: did not receive HSTS header
junge-selbsthilfe.info: could not connect to host
junjung.me: max-age too low: 0
junqtion.com: could not connect to host
jupp0r.de: did not receive HSTS header
jupp0r.de: could not connect to host
justanothercompany.name: could not connect to host
justinlemay.com: did not receive HSTS header
justlikethat.hosting: did not receive HSTS header
@ -2615,13 +2621,14 @@ kaisers.de: did not receive HSTS header
kaiyuewu.com: could not connect to host
kalami.nl: could not connect to host
kamikano.com: could not connect to host
kamitech.ch: could not connect to host
kaneo-gmbh.de: did not receive HSTS header
kany.me: did not receive HSTS header
kaplatz.is: could not connect to host
kapucini.si: max-age too low: 0
karaoketonight.com: could not connect to host
karpanhellas.com: did not receive HSTS header
kasilag.me: did not receive HSTS header
kasilag.me: could not connect to host
katiaetdavid.fr: could not connect to host
katproxy.online: could not connect to host
katproxy.site: could not connect to host
@ -2692,7 +2699,6 @@ kleinblogje.nl: [Exception... "Component returned failure code: 0x80004005 (NS_E
kleppe.co: could not connect to host
kletterkater.com: did not receive HSTS header
klicktojob.de: could not connect to host
klinknetz.de: could not connect to host
kmartin.io: did not receive HSTS header
knccloud.com: could not connect to host
knightsbridgegroup.org: could not connect to host
@ -2715,6 +2721,7 @@ kontaxis.network: could not connect to host
kontorhaus-schlachte.de: could not connect to host
koopjesnel.nl: did not receive HSTS header
koordinate.net: could not connect to host
kopular.com: could not connect to host
korni22.org: did not receive HSTS header
korsanparti.org: could not connect to host
kostuumstore.nl: could not connect to host
@ -2729,6 +2736,7 @@ krayx.com: did not receive HSTS header
kreavis.com: did not receive HSTS header
kredite.sale: could not connect to host
kriegt.es: did not receive HSTS header
kristikala.nl: could not connect to host
krizevci.info: did not receive HSTS header
kroetenfuchs.de: could not connect to host
kropkait.pl: could not connect to host
@ -2775,7 +2783,6 @@ lacledeslan.ninja: could not connect to host
lacocinadelila.com: did not receive HSTS header
ladbroke.net: did not receive HSTS header
laf.in.net: could not connect to host
lafeemam.fr: could not connect to host
lagalerievirtuelle.fr: did not receive HSTS header
lagoza.name: could not connect to host
lamaland.ru: did not receive HSTS header
@ -2838,10 +2845,10 @@ les-voitures-electriques.com: max-age too low: 2592000
lesliekearney.com: did not receive HSTS header
lesperlesdunet.fr: could not connect to host
lesquerda.cat: did not receive HSTS header
letitfly.me: could not connect to host
letras.mus.br: did not receive HSTS header
letsmultiplayerplay.com: did not receive HSTS header
letustravel.tk: could not connect to host
levans.fr: could not connect to host
levelum.com: did not receive HSTS header
lfullerdesign.com: did not receive HSTS header
lg21.co: could not connect to host
@ -2859,7 +2866,6 @@ lianye3.cc: could not connect to host
lianye4.cc: could not connect to host
lianye5.cc: could not connect to host
lianye6.cc: could not connect to host
lianyexiuchang.in: could not connect to host
liaoshuma.com: could not connect to host
libanco.com: could not connect to host
libertyrp.org: could not connect to host
@ -2867,7 +2873,6 @@ library.linode.com: did not receive HSTS header
libreboot.org: did not receive HSTS header
librechan.net: could not connect to host
libreduca.com: could not connect to host
libscode.com: did not receive HSTS header
lidl-selection.at: could not connect to host
lidlovajogurteka.si: could not connect to host
lidow.eu: could not connect to host
@ -2913,7 +2918,7 @@ little.pw: did not receive HSTS header
livedemo.io: could not connect to host
livej.am: could not connect to host
livi.co: did not receive HSTS header
lknw.de: could not connect to host
lixiang.one: could not connect to host
lkummer.cz: could not connect to host
loacg.com: did not receive HSTS header
loadingdeck.com: did not receive HSTS header
@ -2921,6 +2926,7 @@ loadso.me: could not connect to host
loafbox.com: could not connect to host
loansonline.today: could not connect to host
localdrive.me: did not receive HSTS header
localhorst.xyz: could not connect to host
locktheirphone.com: could not connect to host
locomotive.ca: did not receive HSTS header
loftboard.eu: could not connect to host
@ -2986,7 +2992,7 @@ luther.fi: did not receive HSTS header
luxus-russen.de: did not receive HSTS header
luxwatch.com: could not connect to host
lv.search.yahoo.com: did not receive HSTS header
lzkill.com: could not connect to host
lzkill.com: did not receive HSTS header
m-ali.xyz: could not connect to host
m-rickroll-v.pw: could not connect to host
m.gparent.org: could not connect to host
@ -3016,8 +3022,6 @@ mail-settings.google.com: did not receive HSTS header (error ignored - included
mail.google.com: did not receive HSTS header (error ignored - included regardless)
maildragon.com: could not connect to host
mailhost.it: could not connect to host
mailing-jbgg.com: did not receive HSTS header
mainlywrenches.co: could not connect to host
majesnix.org: did not receive HSTS header
makeitdynamic.com: could not connect to host
makerstuff.net: did not receive HSTS header
@ -3100,7 +3104,6 @@ may24.tw: could not connect to host
maya.mg: could not connect to host
mazz-tech.com: could not connect to host
mca2017.org: did not receive HSTS header
mcadmin.net: could not connect to host
mcard.vn: did not receive HSTS header
mcc.re: could not connect to host
mcdonalds.ru: did not receive HSTS header
@ -3202,6 +3205,7 @@ miku.hatsune.my: max-age too low: 5184000
milatrans.pl: did not receive HSTS header
milcoresonline.com: could not connect to host
military-portal.cz: did not receive HSTS header
mimoderoupa.pt: could not connect to host
mindcraft.ga: could not connect to host
mindoktor.se: did not receive HSTS header
minecraftserverz.com: could not connect to host
@ -3252,7 +3256,7 @@ modernibytovytextil.cz: could not connect to host
moebel-nagel.de: did not receive HSTS header
moelord.org: could not connect to host
moen.io: did not receive HSTS header
moeyi.xyz: did not receive HSTS header
moeyi.xyz: could not connect to host
mogry.net: could not connect to host
moho.kr: could not connect to host
mokhtarmial.com: max-age too low: 2592000
@ -3303,7 +3307,6 @@ mpintaamalabanna.it: could not connect to host
mqas.net: could not connect to host
mrdani.net: could not connect to host
mrettich.org: did not receive HSTS header
mrhee.com: could not connect to host
mrning.com: did not receive HSTS header
mrnonz.com: max-age too low: 0
mrpopat.in: did not receive HSTS header
@ -3367,6 +3370,7 @@ myphonebox.de: could not connect to host
mysecretrewards.com: did not receive HSTS header
mystery-science-theater-3000.de: did not receive HSTS header
mythlogic.com: did not receive HSTS header
mytweeps.com: did not receive HSTS header
myweb360.de: did not receive HSTS header
myzone.com: did not receive HSTS header
n-rickroll-e.pw: could not connect to host
@ -3405,8 +3409,8 @@ nathanmfarrugia.com: did not receive HSTS header
natural-progesterone.net: did not receive HSTS header
naturecoaster.com: did not receive HSTS header
naturesystems.cz: max-age too low: 0
naturline.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 118" data: no]
natuurbehangnederland.nl: could not connect to host
nauck.org: could not connect to host
nav.jobs: could not connect to host
naval.tf: could not connect to host
navenlle.com: did not receive HSTS header
@ -3571,7 +3575,6 @@ nwgh.org: could not connect to host
nwork.media: could not connect to host
nyantec.com: did not receive HSTS header
nycroth.com: did not receive HSTS header
nynex.net: could not connect to host
nys-hk.com: could not connect to host
nysepho.pw: could not connect to host
nysifclaimcentral.com: did not receive HSTS header
@ -3664,7 +3667,7 @@ opensrd.com: could not connect to host
openxmpp.com: could not connect to host
opim.ca: did not receive HSTS header
opoleo.com: could not connect to host
opperwall.net: could not connect to host
opperwall.net: did not receive HSTS header
opsafewinter.net: could not connect to host
opsbears.com: did not receive HSTS header
optenhoefel.de: could not connect to host
@ -3842,6 +3845,7 @@ philpropertygroup.com: could not connect to host
phoebe.co.nz: did not receive HSTS header
phonenumberinfo.co.uk: could not connect to host
phongmay24h.com: could not connect to host
photoancestry.com: did not receive HSTS header
photoblogverona.com: could not connect to host
php-bach.org: could not connect to host
phus.lu: did not receive HSTS header
@ -3854,7 +3858,6 @@ piggott.me.uk: did not receive HSTS header
pilgermaske.org: did not receive HSTS header
piligrimname.com: could not connect to host
pillowandpepper.com: did not receive HSTS header
pimpmymac.ru: could not connect to host
pippen.io: could not connect to host
piratedb.com: could not connect to host
piratedot.com: could not connect to host
@ -3885,6 +3888,7 @@ platform.lookout.com: could not connect to host
play.google.com: did not receive HSTS header (error ignored - included regardless)
playflick.com: did not receive HSTS header
playmaker.io: could not connect to host
playmyplay.com: did not receive HSTS header
playnation.io: could not connect to host
please-deny.me: did not receive HSTS header
pleasure.forsale: could not connect to host
@ -3906,7 +3910,6 @@ pocketsix.com: could not connect to host
pocloud.homelinux.net: could not connect to host
poiema.com.sg: did not receive HSTS header
pointpro.de: did not receive HSTS header
poitiers-ttacc-86.eu.org: could not connect to host
pol.in.th: could not connect to host
pole.net.nz: could not connect to host
poleartschool.com: could not connect to host
@ -3924,7 +3927,6 @@ poolsandstuff.com: did not receive HSTS header
poon.tech: could not connect to host
porno-gif.ru: did not receive HSTS header
portalplatform.net: could not connect to host
portalzine.de: did not receive HSTS header
poshpak.com: max-age too low: 86400
postcodewise.co.uk: did not receive HSTS header
postscheduler.org: could not connect to host
@ -3957,7 +3959,7 @@ prezola.com: did not receive HSTS header
prgslab.net: could not connect to host
pridoc.se: did not receive HSTS header
printerest.io: could not connect to host
printexpress.cloud: could not connect to host
printexpress.cloud: did not receive HSTS header
printfn.com: could not connect to host
priolkar.com: did not receive HSTS header
privacylabs.io: did not receive HSTS header
@ -3976,7 +3978,6 @@ progg.no: could not connect to host
progress-technologies.com: could not connect to host
prohostonline.fi: could not connect to host
project-sparks.eu: did not receive HSTS header
projectdp.net: could not connect to host
projectmercury.space: could not connect to host
promecon-gmbh.de: did not receive HSTS header
prontocleaners.co.uk: could not connect to host
@ -4058,7 +4059,6 @@ r15.me: could not connect to host
r3bl.me: did not receive HSTS header
ra-schaal.de: could not connect to host
raajheshkannaa.com: could not connect to host
racunovodstvo-prina.si: could not connect to host
radicaleducation.net: could not connect to host
rafaelcz.de: could not connect to host
railjob.cn: could not connect to host
@ -4070,9 +4070,9 @@ randomcloud.net: could not connect to host
randomhero.cloud: could not connect to host
rankthespot.com: could not connect to host
rannseier.org: did not receive HSTS header
rany.duckdns.org: max-age too low: 0
rany.io: max-age too low: 0
rany.pw: max-age too low: 0
rany.duckdns.org: could not connect to host
rany.io: could not connect to host
rany.pw: could not connect to host
rapidresearch.me: could not connect to host
rapidthunder.io: could not connect to host
rasing.me: did not receive HSTS header
@ -4110,6 +4110,7 @@ readr.pw: could not connect to host
realloc.me: could not connect to host
realmic.net: could not connect to host
realmofespionage.com: could not connect to host
realmofespionage.xyz: could not connect to host
reaper.rip: could not connect to host
reardenporn.com: could not connect to host
rebekaesgabor.online: could not connect to host
@ -4255,6 +4256,7 @@ ruiming.me: did not receive HSTS header
runawebinar.nl: could not connect to host
runementors.com: could not connect to host
runtondev.com: did not receive HSTS header
ruobiyi.com: did not receive HSTS header
ruqu.nl: could not connect to host
rusadmin.biz: did not receive HSTS header
ruska-modra.cz: did not receive HSTS header
@ -4381,7 +4383,6 @@ securesuisse.ch: could not connect to host
security-carpet.com: could not connect to host
security.google.com: did not receive HSTS header (error ignored - included regardless)
securitybsides.pl: did not receive HSTS header
securityglance.com: could not connect to host
securityinet.biz: did not receive HSTS header
securityinet.net: did not receive HSTS header
securityinet.org.il: did not receive HSTS header
@ -4430,6 +4431,7 @@ setuid.io: did not receive HSTS header
sexpay.net: could not connect to host
seyahatsagliksigortalari.com: could not connect to host
sfsltd.com: did not receive HSTS header
sftool.gov: could not connect to host
shadoom.com: did not receive HSTS header
shadowmorph.info: did not receive HSTS header
shadowsocks.net: could not connect to host
@ -4439,6 +4441,7 @@ sharepass.pw: could not connect to host
shauncrowley.co.uk: could not connect to host
shaunwheelhou.se: could not connect to host
shazzlemd.com: did not receive HSTS header
shazzlepro.com: did not receive HSTS header
sheehyinfinitioftysonsparts.com: could not connect to host
shellj.me: max-age too low: 86400
shellsec.pw: did not receive HSTS header
@ -4454,11 +4457,13 @@ shiona.xyz: did not receive HSTS header
shirosaki.org: could not connect to host
shocksrv.com: did not receive HSTS header
shooshosha.com: could not connect to host
shoplandia.co: could not connect to host
shopontarget.com: did not receive HSTS header
shoprose.ru: could not connect to host
shops.neonisi.com: could not connect to host
shota.party: could not connect to host
showkeeper.tv: did not receive HSTS header
shrike.me: could not connect to host
shu-kin.net: could not connect to host
shukatsu-note.com: could not connect to host
shv25.se: could not connect to host
@ -4472,7 +4477,7 @@ siddhant.me: did not receive HSTS header
siebens.net: could not connect to host
sifls.com: could not connect to host
sig6.org: could not connect to host
sijimi.cn: did not receive HSTS header
sijmenschoon.nl: did not receive HSTS header
silashes.com: could not connect to host
silaslova-ekb.ru: could not connect to host
silentcircle.com: did not receive HSTS header
@ -4676,6 +4681,7 @@ starmusic.ga: did not receive HSTS header
starttraffic.com: did not receive HSTS header
startuponcloud.com: max-age too low: 2678400
stash.ai: did not receive HSTS header
stassi.ch: did not receive HSTS header
state-sponsored-actors.net: could not connect to host
statementinsertsforless.com: did not receive HSTS header
stateofexception.io: could not connect to host
@ -4689,6 +4695,7 @@ statuschecks.net: could not connect to host
stayokhotelscdc-mailing.com: could not connect to host
stcomex.com: did not receive HSTS header
stefanweiser.de: did not receive HSTS header
steffi-in-australien.com: could not connect to host
stepbystep3d.com: did not receive HSTS header
stephanierxo.com: did not receive HSTS header
stephenandburns.com: did not receive HSTS header
@ -4783,6 +4790,7 @@ suprlink.net: could not connect to host
supweb.ovh: did not receive HSTS header
surfeasy.com: did not receive HSTS header
surfone-leucate.com: did not receive HSTS header
sushi101tempe.com: could not connect to host
sushifrick.de: did not receive HSTS header
suzukikenichi.com: did not receive HSTS header
sv.search.yahoo.com: did not receive HSTS header
@ -4821,7 +4829,6 @@ t-shirts4less.nl: did not receive HSTS header
t-tz.com: could not connect to host
t4x.org: did not receive HSTS header
taabe.xyz: could not connect to host
taboragroup.com: could not connect to host
tacomafia.net: did not receive HSTS header
tadigitalstore.com: could not connect to host
tafoma.com: did not receive HSTS header
@ -4830,6 +4837,7 @@ taglondon.org: did not receive HSTS header
tailify.com: did not receive HSTS header
tails.com.ar: did not receive HSTS header
tales-of-interia.de: did not receive HSTS header
talheim-records.ca: did not receive HSTS header
talk.google.com: did not receive HSTS header (error ignored - included regardless)
talktwincities.com: could not connect to host
tallr.se: could not connect to host
@ -4840,7 +4848,7 @@ tangel.me: could not connect to host
tangibilizing.com: could not connect to host
tante-bugil.net: did not receive HSTS header
tanze-jetzt.de: did not receive HSTS header
taozj.org: could not connect to host
taozj.org: did not receive HSTS header
tapfinder.ca: could not connect to host
tapka.cz: did not receive HSTS header
tappublisher.com: did not receive HSTS header
@ -4856,6 +4864,7 @@ tatt.io: could not connect to host
tauchkater.de: could not connect to host
tavopica.lt: did not receive HSTS header
taxbench.com: could not connect to host
taxiindenbosch.nl: did not receive HSTS header
taxsnaps.co.nz: could not connect to host
tazz.in: could not connect to host
tc-bonito.de: did not receive HSTS header
@ -4901,7 +4910,6 @@ tendertool.nl: could not connect to host
tenni.xyz: could not connect to host
tensei-slime.com: did not receive HSTS header
tensionup.com: could not connect to host
teodio.cl: did not receive HSTS header
teos.online: could not connect to host
terra.by: did not receive HSTS header
terrax.berlin: could not connect to host
@ -4940,7 +4948,6 @@ thecrochetcottage.net: could not connect to host
thediaryofadam.com: did not receive HSTS header
theendofzion.com: did not receive HSTS header
theescapistswiki.com: could not connect to host
theeyeopener.com: did not receive HSTS header
thefarbeyond.com: could not connect to host
theflowerbasketonline.com: could not connect to host
thefootballanalyst.com: did not receive HSTS header
@ -4980,6 +4987,7 @@ thewhitneypaige.com: could not connect to host
thewp.pro: could not connect to host
thezonders.com: did not receive HSTS header
thierfreund.de: could not connect to host
thierryhayoz.ch: could not connect to host
thinkcoding.de: could not connect to host
thinkcoding.org: could not connect to host
thinlyveiledcontempt.com: could not connect to host
@ -4995,6 +5003,7 @@ thriveapproach.co.uk: did not receive HSTS header
thumbtack.com: did not receive HSTS header
thusoy.com: did not receive HSTS header
ti.blog.br: could not connect to host
ticfleet.com: could not connect to host
tickettoaster.de: max-age too low: 0
tickopa.co.uk: could not connect to host
tickreport.com: did not receive HSTS header
@ -5022,6 +5031,7 @@ timotrans.eu: did not receive HSTS header
timowi.de: could not connect to host
timowi.net: could not connect to host
timwittenberg.com: could not connect to host
tinyvpn.net: could not connect to host
tipsyk.ru: could not connect to host
tirex.media: did not receive HSTS header
titanleaf.com: could not connect to host
@ -5035,7 +5045,6 @@ tlcdn.net: could not connect to host
tlo.hosting: could not connect to host
tlo.link: did not receive HSTS header
tlo.network: could not connect to host
tloxygen.com: could not connect to host
tls.li: could not connect to host
tlsbv.nl: did not receive HSTS header
tm-solutions.eu: did not receive HSTS header
@ -5052,7 +5061,7 @@ todamateria.com.br: did not receive HSTS header
todesschaf.org: could not connect to host
todo.is: did not receive HSTS header
todobazar.es: could not connect to host
togelonlinecommunity.com: did not receive HSTS header
togelonlinecommunity.com: could not connect to host
tokoone.com: did not receive HSTS header
tollmanz.com: did not receive HSTS header
tolud.com: could not connect to host
@ -5095,6 +5104,7 @@ tradinews.com: could not connect to host
tradinews.fr: could not connect to host
tradingcentre.com.au: did not receive HSTS header
tradinghope.com: could not connect to host
tradiz.org: could not connect to host
traindb.nl: did not receive HSTS header
trainut.com: did not receive HSTS header
trakfusion.com: could not connect to host
@ -5208,6 +5218,7 @@ unblocked.win: could not connect to host
unblocked.works: did not receive HSTS header
unblocked.world: did not receive HSTS header
unblockedall.site: could not connect to host
unblockmy.party: could not connect to host
unblockmyproxy.site: could not connect to host
unccdesign.club: could not connect to host
unclegen.xyz: could not connect to host
@ -5229,6 +5240,7 @@ unplugg3r.dk: could not connect to host
unravel.ie: could not connect to host
unsystem.net: did not receive HSTS header
unwiredbrain.com: could not connect to host
unwomen.is: did not receive HSTS header
unyq.me: could not connect to host
uonstaffhub.com: could not connect to host
uow.ninja: could not connect to host
@ -5240,7 +5252,6 @@ uprotect.it: could not connect to host
upstats.eu: could not connect to host
ur-lauber.de: did not receive HSTS header
urandom.eu.org: did not receive HSTS header
urbanstylestaging.com: did not receive HSTS header
urown.net: could not connect to host
urphp.com: could not connect to host
us-immigration.com: did not receive HSTS header
@ -5280,6 +5291,7 @@ valmagus.com: could not connect to host
vampirism.eu: could not connect to host
vanacht.co.za: did not receive HSTS header
vanderkley.it: could not connect to host
vanderstraeten.dynv6.net: could not connect to host
vanestack.com: could not connect to host
vanetv.com: could not connect to host
vanitas.xyz: could not connect to host
@ -5314,11 +5326,11 @@ vglimg.com: could not connect to host
vhost.co.id: could not connect to host
viadeux.com: could not connect to host
vicianovi.cz: could not connect to host
vidbuchanan.co.uk: could not connect to host
viclab.se: could not connect to host
videnskabsklubben.dk: did not receive HSTS header
videomuz.com: did not receive HSTS header
videotogel.net: did not receive HSTS header
vidid.net: did not receive HSTS header
videotogel.net: could not connect to host
vidid.net: could not connect to host
vidz.ga: could not connect to host
vieaw.com: did not receive HSTS header
vietnamphotographytours.com: did not receive HSTS header
@ -5341,6 +5353,7 @@ virginiacrimeanalysisnetwork.org: did not receive HSTS header
visitbroadstairs.com: could not connect to host
vissanum.com: did not receive HSTS header
vistarait.com: did not receive HSTS header
visualideas.org: could not connect to host
vitagenda.nl: could not connect to host
vitalita.cz: did not receive HSTS header
vitalorange.com: did not receive HSTS header
@ -5360,11 +5373,10 @@ voicesuk.co.uk: did not receive HSTS header
voidpay.com: could not connect to host
voidpay.net: could not connect to host
voidpay.org: could not connect to host
volcrado.com: did not receive HSTS header
volcrado.com: could not connect to host
voliere-info.nl: did not receive HSTS header
volkden.com: could not connect to host
vortexhobbies.com: did not receive HSTS header
voshod.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 118" data: no]
vosjesweb.nl: did not receive HSTS header
vox.vg: did not receive HSTS header
vpl.me: did not receive HSTS header
@ -5402,6 +5414,7 @@ warlions.info: did not receive HSTS header
warped.com: did not receive HSTS header
warsentech.com: could not connect to host
washingtonviews.com: did not receive HSTS header
wassim.is: did not receive HSTS header
watchium.com: did not receive HSTS header
watersportmarkt.net: did not receive HSTS header
watsonhall.uk: could not connect to host
@ -5451,6 +5464,7 @@ wellastore.ru: did not receive HSTS header
weltmeisterschaft.net: could not connect to host
weltverschwoerung.de: did not receive HSTS header
weme.eu: could not connect to host
wendalyncheng.com: did not receive HSTS header
werdeeintimo.de: did not receive HSTS header
werkenbijkfc.nl: did not receive HSTS header
werkplaatsoost.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 118" data: no]
@ -5488,12 +5502,12 @@ wiire.me: could not connect to host
wikiclash.info: could not connect to host
wikisports.eu: could not connect to host
wilf1rst.com: could not connect to host
wilfrid-calixte.fr: could not connect to host
willcipriano.com: could not connect to host
william.si: did not receive HSTS header
willosagiede.com: did not receive HSTS header
winaes.com: did not receive HSTS header
winclient.cn: could not connect to host
windhaven.nl: could not connect to host
windowsphoneblog.it: could not connect to host
winecodeavocado.com: could not connect to host
winged.io: could not connect to host
@ -5506,7 +5520,6 @@ wipply.com: did not receive HSTS header
wirc.gr: could not connect to host
wiseloan.com: did not receive HSTS header
wishcert.com: could not connect to host
wispsuperfoods.com: could not connect to host
witae.com: could not connect to host
withgoogle.com: did not receive HSTS header (error ignored - included regardless)
withmy.beer: could not connect to host
@ -5621,7 +5634,6 @@ xn--lgb3a8bcpn.ga: could not connect to host
xn--lgb3a8bcpn.gq: could not connect to host
xn--lgb3a8bcpn.ml: could not connect to host
xn--ls8hi7a.tk: could not connect to host
xn--lsupp-mra.net: did not receive HSTS header
xn--mgbbh2a9fub.xn--ngbc5azd: did not receive HSTS header
xn--neb-tma3u8u.xyz: could not connect to host
xn--seelenwchter-mcb.eu: could not connect to host
@ -5707,6 +5719,7 @@ z3liff.com: could not connect to host
z3liff.net: could not connect to host
za.search.yahoo.com: did not receive HSTS header
zadieheimlich.com: did not receive HSTS header
zahyantechnologies.com: could not connect to host
zakmccrac.de: did not receive HSTS header
zamis.net: did not receive HSTS header
zamorano.edu: could not connect to host
@ -5740,6 +5753,7 @@ zhangzifan.com: did not receive HSTS header
zhaojin97.cn: did not receive HSTS header
zhendingresources.com: max-age too low: 0
zhihua-lai.com: did not receive HSTS header
zhousiru.com: could not connect to host
zigcore.com.br: could not connect to host
zihao.me: did not receive HSTS header
zinc-x.com: did not receive HSTS header
@ -5762,7 +5776,6 @@ zoomingin.net: max-age too low: 5184000
zoommailing.com: did not receive HSTS header
zorasvobodova.cz: did not receive HSTS header
zortium.report: could not connect to host
zorz.info: could not connect to host
zoznamrealit.sk: did not receive HSTS header
zqhong.com: could not connect to host
ztan.tk: could not connect to host

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <windows.h>
#include "updatelogging.h"
#include "updatecommon.h"
BOOL PathAppendSafe(LPWSTR base, LPCWSTR extra);
BOOL VerifySameFiles(LPCWSTR file1Path, LPCWSTR file2Path, BOOL &sameContent);

Просмотреть файл

@ -22,8 +22,11 @@
#include "registrycertificates.h"
#include "uachelper.h"
#include "updatehelper.h"
#include "pathhash.h"
#include "errors.h"
#define PATCH_DIR_PATH L"\\updates\\0"
// Wait 15 minutes for an update operation to run at most.
// Updates usually take less than a minute so this seems like a
// significantly large and safe amount of time to wait.
@ -32,6 +35,7 @@ wchar_t* MakeCommandLine(int argc, wchar_t** argv);
BOOL WriteStatusFailure(LPCWSTR updateDirPath, int errorCode);
BOOL PathGetSiblingFilePath(LPWSTR destinationBuffer, LPCWSTR siblingFilePath,
LPCWSTR newFileName);
BOOL DoesFallbackKeyExist();
/*
* Read the update.status file and sets isApplying to true if
@ -415,8 +419,7 @@ ProcessSoftwareUpdateCommand(DWORD argc, LPWSTR *argv)
// We can only update update.status if argv[1] exists. argv[1] is
// the directory where the update.status file exists.
if (argc < 2 ||
!WriteStatusFailure(argv[1],
SERVICE_NOT_ENOUGH_COMMAND_LINE_ARGS)) {
!WriteStatusFailure(argv[1], SERVICE_NOT_ENOUGH_COMMAND_LINE_ARGS)) {
LOG_WARN(("Could not write update.status service update failure. (%d)",
GetLastError()));
}
@ -426,8 +429,7 @@ ProcessSoftwareUpdateCommand(DWORD argc, LPWSTR *argv)
WCHAR installDir[MAX_PATH + 1] = {L'\0'};
if (!GetInstallationDir(argc, argv, installDir)) {
LOG_WARN(("Could not get the installation directory"));
if (!WriteStatusFailure(argv[1],
SERVICE_INSTALLDIR_ERROR)) {
if (!WriteStatusFailure(argv[1], SERVICE_INSTALLDIR_ERROR)) {
LOG_WARN(("Could not write update.status for GetInstallationDir failure."));
}
return FALSE;
@ -587,6 +589,87 @@ ExecuteServiceCommand(int argc, LPWSTR *argv)
BOOL result = FALSE;
if (!lstrcmpi(argv[2], L"software-update")) {
// This check is also performed in updater.cpp and is performed here
// as well since the maintenance service can be called directly.
if (argc < 4 || !IsValidFullPath(argv[4])) {
// Since the status file is written to the patch directory and the patch
// directory is invalid don't write the status file.
LOG_WARN(("The patch directory path is not valid for this application."));
return FALSE;
}
// The patch directory path must end with updates\0 to use the maintenance
// service.
size_t fullPathLen = NS_tstrlen(argv[4]);
size_t relPathLen = NS_tstrlen(PATCH_DIR_PATH);
if (relPathLen > fullPathLen) {
LOG_WARN(("The patch directory path length is not valid for this application."));
return FALSE;
}
if (_wcsnicmp(argv[4] + fullPathLen - relPathLen, PATCH_DIR_PATH, relPathLen) != 0) {
LOG_WARN(("The patch directory path subdirectory is not valid for this application."));
return FALSE;
}
// This check is also performed in updater.cpp and is performed here
// as well since the maintenance service can be called directly.
if (argc < 5 || !IsValidFullPath(argv[5])) {
LOG_WARN(("The install directory path is not valid for this application."));
if (!WriteStatusFailure(argv[4], SERVICE_INVALID_INSTALL_DIR_PATH_ERROR)) {
LOG_WARN(("Could not write update.status for previous failure."));
}
return FALSE;
}
if (!IsOldCommandline(argc - 3, argv + 3)) {
// This check is also performed in updater.cpp and is performed here
// as well since the maintenance service can be called directly.
if (argc < 6 || !IsValidFullPath(argv[6])) {
LOG_WARN(("The working directory path is not valid for this application."));
if (!WriteStatusFailure(argv[4], SERVICE_INVALID_WORKING_DIR_PATH_ERROR)) {
LOG_WARN(("Could not write update.status for previous failure."));
}
return FALSE;
}
// These checks are also performed in updater.cpp and is performed here
// as well since the maintenance service can be called directly.
if (_wcsnicmp(argv[6], argv[5], MAX_PATH) != 0) {
if (wcscmp(argv[7], L"-1") != 0 && !wcsstr(argv[7], L"/replace")) {
LOG_WARN(("Installation directory and working directory must be the "
"same for non-staged updates. Exiting."));
if (!WriteStatusFailure(argv[4], SERVICE_INVALID_APPLYTO_DIR_ERROR)) {
LOG_WARN(("Could not write update.status for previous failure."));
}
return FALSE;
}
NS_tchar workingDirParent[MAX_PATH];
NS_tsnprintf(workingDirParent,
sizeof(workingDirParent) / sizeof(workingDirParent[0]),
NS_T("%s"), argv[6]);
if (!PathRemoveFileSpecW(workingDirParent)) {
LOG_WARN(("Couldn't remove file spec when attempting to verify the "
"working directory path. (%d)", GetLastError()));
if (!WriteStatusFailure(argv[4], REMOVE_FILE_SPEC_ERROR)) {
LOG_WARN(("Could not write update.status for previous failure."));
}
return FALSE;
}
if (_wcsnicmp(workingDirParent, argv[5], MAX_PATH) != 0) {
LOG_WARN(("The apply-to directory must be the same as or "
"a child of the installation directory! Exiting."));
if (!WriteStatusFailure(argv[4], SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR)) {
LOG_WARN(("Could not write update.status for previous failure."));
}
return FALSE;
}
}
}
// Use the passed in command line arguments for the update, except for the
// path to updater.exe. We always look for updater.exe in the installation
// directory, then we copy updater.exe to a the directory of the
@ -596,12 +679,37 @@ ExecuteServiceCommand(int argc, LPWSTR *argv)
WCHAR installDir[MAX_PATH + 1] = { L'\0' };
if (!GetInstallationDir(argc - 3, argv + 3, installDir)) {
LOG_WARN(("Could not get the installation directory"));
if (!WriteStatusFailure(argv[1],
SERVICE_INSTALLDIR_ERROR)) {
LOG_WARN(("Could not write update.status for GetInstallationDir failure."));
if (!WriteStatusFailure(argv[4], SERVICE_INSTALLDIR_ERROR)) {
LOG_WARN(("Could not write update.status for previous failure."));
}
return FALSE;
}
if (!DoesFallbackKeyExist()) {
WCHAR maintenanceServiceKey[MAX_PATH + 1];
if (CalculateRegistryPathFromFilePath(installDir, maintenanceServiceKey)) {
LOG(("Checking for Maintenance Service registry. key: '%ls'",
maintenanceServiceKey));
HKEY baseKey = nullptr;
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
maintenanceServiceKey, 0,
KEY_READ | KEY_WOW64_64KEY,
&baseKey) != ERROR_SUCCESS) {
LOG_WARN(("The maintenance service registry key does not exist."));
if (!WriteStatusFailure(argv[4], SERVICE_INSTALL_DIR_REG_ERROR)) {
LOG_WARN(("Could not write update.status for previous failure."));
}
return FALSE;
}
RegCloseKey(baseKey);
} else {
if (!WriteStatusFailure(argv[4], SERVICE_CALC_REG_PATH_ERROR)) {
LOG_WARN(("Could not write update.status for previous failure."));
}
return FALSE;
}
}
WCHAR installDirUpdater[MAX_PATH + 1] = { L'\0' };
wcsncpy(installDirUpdater, installDir, MAX_PATH);
if (!PathAppendSafe(installDirUpdater, L"updater.exe")) {
@ -609,7 +717,7 @@ ExecuteServiceCommand(int argc, LPWSTR *argv)
result = FALSE;
}
result = UpdaterIsValid(installDirUpdater, installDir, argv[5]);
result = UpdaterIsValid(installDirUpdater, installDir, argv[4]);
WCHAR secureUpdaterPath[MAX_PATH + 1] = { L'\0' };
if (result) {
@ -617,7 +725,7 @@ ExecuteServiceCommand(int argc, LPWSTR *argv)
}
if (result) {
LOG(("Passed in path: '%ls'; Using this path for updating: '%ls'.",
installDirUpdater, secureUpdaterPath));
installDirUpdater, secureUpdaterPath));
DeleteSecureUpdater(secureUpdaterPath);
result = CopyFileW(installDirUpdater, secureUpdaterPath, FALSE);
}
@ -625,8 +733,7 @@ ExecuteServiceCommand(int argc, LPWSTR *argv)
if (!result) {
LOG_WARN(("Could not copy path to secure location. (%d)",
GetLastError()));
if (argc > 4 && !WriteStatusFailure(argv[4],
SERVICE_COULD_NOT_COPY_UPDATER)) {
if (!WriteStatusFailure(argv[4], SERVICE_COULD_NOT_COPY_UPDATER)) {
LOG_WARN(("Could not write update.status could not copy updater error"));
}
} else {

Просмотреть файл

@ -175,16 +175,6 @@
</body>
</method>
<method name="destroy">
<body>
<![CDATA[
this.mMessageManager.removeMessageListener("Printing:Preview:UpdatePageCount", this);
delete this.mMessageManager;
delete this.mPPBrowser;
]]>
</body>
</method>
<method name="doPageSetup">
<body>
<![CDATA[

Просмотреть файл

@ -183,21 +183,11 @@ var PrintUtils = {
* Returns the <xul:browser> to display the print preview in. This
* <xul:browser> must have its type attribute set to "content".
*
* getSimplifiedPrintPreviewBrowser:
* Returns the <xul:browser> to display the simplified print preview
* in. This <xul:browser> must have its type attribute set to
* "content".
*
* getSourceBrowser:
* Returns the <xul:browser> that contains the document being
* printed. This <xul:browser> must have its type attribute set to
* "content".
*
* getSimplifiedSourceBrowser:
* Returns the <xul:browser> that contains the simplified version
* of the document being printed. This <xul:browser> must have its
* type attribute set to "content".
*
* getNavToolbox:
* Returns the primary toolbox for this window.
*
@ -230,9 +220,7 @@ var PrintUtils = {
// issues in bug 267422.
// We use the print preview browser as the source browser to avoid
// re-initializing print preview with a document that might now have changed.
this._sourceBrowser = this._shouldSimplify ?
this._listener.getSimplifiedPrintPreviewBrowser() :
this._listener.getPrintPreviewBrowser();
this._sourceBrowser = this._listener.getPrintPreviewBrowser();
this._sourceBrowser.collapsed = true;
// If the user transits too quickly within preview and we have a pending
@ -319,7 +307,7 @@ var PrintUtils = {
return {};
}
return this._currentPPBrowser.docShell.printPreview;
return this._listener.getPrintPreviewBrowser().docShell.printPreview;
},
get inPrintPreview() {
@ -513,41 +501,13 @@ var PrintUtils = {
this._shouldSimplify = shouldSimplify;
},
/**
* Currently, we create a new print preview browser to host the simplified
* cloned-document when Simplify Page option is used on preview. To accomplish
* this, we need to keep track of what browser should be presented, based on
* whether the 'Simplify page' checkbox is checked.
*
* _ppBrowsers
* Set of print preview browsers.
* _currentPPBrowser
* References the current print preview browser that is being presented.
*/
_ppBrowsers: new Set(),
_currentPPBrowser: null,
enterPrintPreview() {
// Send a message to the print preview browser to initialize
// print preview. If we happen to have gotten a print preview
// progress listener from nsIPrintingPromptService.showProgress
// in printPreview, we add listeners to feed that progress
// listener.
let ppBrowser = this._shouldSimplify ?
this._listener.getSimplifiedPrintPreviewBrowser() :
this._listener.getPrintPreviewBrowser();
this._ppBrowsers.add(ppBrowser);
// If we're switching from 'normal' print preview to 'simplified' print
// preview, we will want to run reader mode against the 'normal' print
// preview browser's content:
let oldPPBrowser = null;
let changingPrintPreviewBrowsers = false;
if (this._currentPPBrowser && ppBrowser != this._currentPPBrowser) {
changingPrintPreviewBrowsers = true;
oldPPBrowser = this._currentPPBrowser;
}
this._currentPPBrowser = ppBrowser;
let ppBrowser = this._listener.getPrintPreviewBrowser();
let mm = ppBrowser.messageManager;
let defaultPrinterName = this.getDefaultPrinterName();
@ -555,7 +515,6 @@ var PrintUtils = {
mm.sendAsyncMessage("Printing:Preview:Enter", {
windowID: browser.outerWindowID,
simplifiedMode: simplified,
changingBrowsers: changingPrintPreviewBrowsers,
defaultPrinterName,
});
};
@ -586,7 +545,7 @@ var PrintUtils = {
// that the document is ready for print previewing.
spMM.sendAsyncMessage("Printing:Preview:ParseDocument", {
URL: this._originalURL,
windowID: oldPPBrowser.outerWindowID,
windowID: this._sourceBrowser.outerWindowID,
});
// Here we log telemetry data for when the user enters simplify mode.
@ -618,10 +577,6 @@ var PrintUtils = {
let printPreviewTB = document.getElementById("print-preview-toolbar");
if (printPreviewTB) {
if (message.data.changingBrowsers) {
printPreviewTB.destroy();
printPreviewTB.initialize(ppBrowser);
}
printPreviewTB.updateToolbar();
ppBrowser.collapsed = false;
ppBrowser.focus();
@ -678,12 +633,9 @@ var PrintUtils = {
},
exitPrintPreview() {
for (let browser of this._ppBrowsers) {
let browserMM = browser.messageManager;
browserMM.sendAsyncMessage("Printing:Preview:Exit");
}
this._ppBrowsers.clear();
this._currentPPBrowser = null;
let ppBrowser = this._listener.getPrintPreviewBrowser();
let browserMM = ppBrowser.messageManager;
browserMM.sendAsyncMessage("Printing:Preview:Exit");
window.removeEventListener("keydown", this.onKeyDownPP, true);
window.removeEventListener("keypress", this.onKeyPressPP, true);
@ -693,8 +645,7 @@ var PrintUtils = {
// remove the print preview toolbar
let printPreviewTB = document.getElementById("print-preview-toolbar");
printPreviewTB.destroy();
printPreviewTB.remove();
this._listener.getNavToolbox().parentNode.removeChild(printPreviewTB);
let fm = Components.classes["@mozilla.org/focus-manager;1"]
.getService(Components.interfaces.nsIFocusManager);

Просмотреть файл

@ -2,7 +2,6 @@
module.exports = {
"extends": [
"plugin:mozilla/chrome-test",
"plugin:mozilla/browser-test"
"plugin:mozilla/chrome-test"
],
};

Просмотреть файл

@ -1,7 +1,2 @@
[browser_page_change_print_original.js]
skip-if = os == "mac"
[browser_preview_switch_print_selected.js]
support-files =
simplifyArticleSample.html
skip-if = os == "mac"

Просмотреть файл

@ -1,104 +0,0 @@
/**
* Verify if we correctly switch print preview browsers based on whether
* Simplify Page checkbox is checked.
*/
const TEST_PATH = getRootDirectory(gTestPath)
.replace("chrome://mochitests/content", "http://example.com");
add_task(function* set_simplify_and_reader_pref() {
// Ensure we have the simplify page preference set
yield SpecialPowers.pushPrefEnv({
set: [
["print.use_simplify_page", true],
["reader.parse-on-load.enabled", true]
]
});
});
add_task(function* switch_print_preview_browsers() {
let url = TEST_PATH + "simplifyArticleSample.html";
// Can only do something if we have a print preview UI:
if (AppConstants.platform != "win" && AppConstants.platform != "linux") {
ok(false, "Can't test if there's no print preview.");
return;
}
// Ensure we get a browserStopped for this browser
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, url, false, true);
// Wait for Reader Mode to parse and set property of loaded tab
yield BrowserTestUtils.waitForCondition(() => {
return tab.linkedBrowser.isArticle;
});
// Enter print preview
let defaultPPBrowser = PrintPreviewListener.getPrintPreviewBrowser();
let defaultPPEntered = BrowserTestUtils
.waitForMessage(defaultPPBrowser.messageManager,
"Printing:Preview:Entered");
document.getElementById("cmd_printPreview").doCommand();
yield defaultPPEntered;
// Assert that we are showing the initial content on default print preview browser
yield ContentTask.spawn(defaultPPBrowser, null, function* () {
is(content.document.title, "Article title", "Should have initial content.");
});
// Here we call simplified mode
let simplifiedPPBrowser = PrintPreviewListener.getSimplifiedPrintPreviewBrowser();
let simplifiedPPEntered = BrowserTestUtils
.waitForMessage(simplifiedPPBrowser.messageManager,
"Printing:Preview:Entered");
let printPreviewToolbar = document.getElementById("print-preview-toolbar");
// Wait for simplify page option enablement
yield BrowserTestUtils.waitForCondition(() => {
return !printPreviewToolbar.mSimplifyPageCheckbox.disabled;
});
printPreviewToolbar.mSimplifyPageCheckbox.click();
yield simplifiedPPEntered;
// Assert that simplify page option is checked
is(printPreviewToolbar.mSimplifyPageCheckbox.checked, true,
"Should have simplify page option checked");
// Assert that we are showing custom content on simplified print preview browser
yield ContentTask.spawn(simplifiedPPBrowser, null, function* () {
is(content.document.title, "Article title", "Should have custom content.");
});
// Assert that we are selecting simplified print preview browser, and not default one
is(gBrowser.selectedTab.linkedBrowser, simplifiedPPBrowser,
"Should have simplified print preview browser selected");
isnot(gBrowser.selectedTab.linkedBrowser, defaultPPBrowser,
"Should not have default print preview browser selected");
// Switch back to default print preview content
defaultPPEntered = BrowserTestUtils
.waitForMessage(defaultPPBrowser.messageManager,
"Printing:Preview:Entered");
printPreviewToolbar.mSimplifyPageCheckbox.click();
yield defaultPPEntered;
// Assert that simplify page option is not checked
isnot(printPreviewToolbar.mSimplifyPageCheckbox.checked, true,
"Should not have simplify page option checked");
// Assert that we are showing the initial content on default print preview browser
yield ContentTask.spawn(defaultPPBrowser, null, function* () {
is(content.document.title, "Article title", "Should have initial content.");
});
// Assert that we are selecting default print preview browser, and not simplified one
is(gBrowser.selectedTab.linkedBrowser, defaultPPBrowser,
"Should have default print preview browser selected");
isnot(gBrowser.selectedTab.linkedBrowser, simplifiedPPBrowser,
"Should not have simplified print preview browser selected");
PrintUtils.exitPrintPreview();
yield BrowserTestUtils.removeTab(tab);
});

Просмотреть файл

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Article title</title>
<meta name="description" content="This is the article description." />
</head>
<body>
<header>Site header</header>
<div>
<h1>Article title</h1>
<h2 class="author">by Jane Doe</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetu</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetu</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetu</p>
</body>
</html>

Просмотреть файл

@ -445,7 +445,7 @@ var Printing = {
let data = message.data;
switch (message.name) {
case "Printing:Preview:Enter": {
this.enterPrintPreview(Services.wm.getOuterWindowWithId(data.windowID), data.simplifiedMode, data.changingBrowsers, data.defaultPrinterName);
this.enterPrintPreview(Services.wm.getOuterWindowWithId(data.windowID), data.simplifiedMode, data.defaultPrinterName);
break;
}
@ -622,7 +622,7 @@ var Printing = {
});
},
enterPrintPreview(contentWindow, simplifiedMode, changingBrowsers, defaultPrinterName) {
enterPrintPreview(contentWindow, simplifiedMode, defaultPrinterName) {
// We'll call this whenever we've finished reflowing the document, or if
// we errored out while attempting to print preview (in which case, we'll
// notify the parent that we've failed).
@ -630,7 +630,6 @@ var Printing = {
removeEventListener("printPreviewUpdate", onPrintPreviewReady);
sendAsyncMessage("Printing:Preview:Entered", {
failed: !!error,
changingBrowsers,
});
};

Просмотреть файл

@ -9,7 +9,7 @@
#include <wintrust.h>
#include "certificatecheck.h"
#include "updatelogging.h"
#include "updatecommon.h"
static const int ENCODING = X509_ASN_ENCODING | PKCS_7_ASN_ENCODING;

Просмотреть файл

@ -41,7 +41,7 @@
#define MAR_CHANNEL_MISMATCH_ERROR 22
#define VERSION_DOWNGRADE_ERROR 23
// Error codes 24-33 and 49-51 are for the Windows maintenance service.
// Error codes 24-33 and 49-57 are for the Windows maintenance service.
#define SERVICE_UPDATER_COULD_NOT_BE_STARTED 24
#define SERVICE_NOT_ENOUGH_COMMAND_LINE_ARGS 25
#define SERVICE_UPDATER_SIGN_ERROR 26
@ -66,10 +66,16 @@
#define DELETE_ERROR_EXPECTED_FILE 47
#define RENAME_ERROR_EXPECTED_FILE 48
// Error codes 24-33 and 49-51 are for the Windows maintenance service.
// Error codes 24-33 and 49-57 are for the Windows maintenance service.
#define SERVICE_COULD_NOT_COPY_UPDATER 49
#define SERVICE_STILL_APPLYING_TERMINATED 50
#define SERVICE_STILL_APPLYING_NO_EXIT_CODE 51
#define SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR 52
#define SERVICE_CALC_REG_PATH_ERROR 53
#define SERVICE_INVALID_APPLYTO_DIR_ERROR 54
#define SERVICE_INVALID_INSTALL_DIR_PATH_ERROR 55
#define SERVICE_INVALID_WORKING_DIR_PATH_ERROR 56
#define SERVICE_INSTALL_DIR_REG_ERROR 57
#define WRITE_ERROR_FILE_COPY 61
#define WRITE_ERROR_DELETE_FILE 62
@ -85,6 +91,10 @@
#define INVALID_APPLYTO_DIR_STAGED_ERROR 72
#define LOCK_ERROR_PATCH_FILE 73
#define INVALID_APPLYTO_DIR_ERROR 74
#define INVALID_INSTALL_DIR_PATH_ERROR 75
#define INVALID_WORKING_DIR_PATH_ERROR 76
#define INVALID_CALLBACK_PATH_ERROR 77
#define INVALID_CALLBACK_DIR_ERROR 78
// Error codes 80 through 99 are reserved for nsUpdateService.js

Просмотреть файл

@ -6,8 +6,8 @@
EXPORTS += [
'readstrings.h',
'updatecommon.h',
'updatedefines.h',
'updatelogging.h',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':

Просмотреть файл

@ -8,7 +8,7 @@
#include "registrycertificates.h"
#include "pathhash.h"
#include "updatelogging.h"
#include "updatecommon.h"
#include "updatehelper.h"
#define MAX_KEY_LENGTH 255

Просмотреть файл

@ -22,7 +22,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
sources += [
'readstrings.cpp',
'updatelogging.cpp',
'updatecommon.cpp',
]
SOURCES += sorted(['%s/%s' % (srcdir, s) for s in sources])

Просмотреть файл

@ -5,7 +5,7 @@
#include <windows.h>
#include <wtsapi32.h>
#include "uachelper.h"
#include "updatelogging.h"
#include "updatecommon.h"
// See the MSDN documentation with title: Privilege Constants
// At the time of this writing, this documentation is located at:

Просмотреть файл

@ -12,7 +12,7 @@
#include <stdlib.h>
#include <stdarg.h>
#include "updatelogging.h"
#include "updatecommon.h"
UpdateLog::UpdateLog() : logFP(nullptr)
{
@ -34,12 +34,13 @@ void UpdateLog::Init(NS_tchar* sourcePath,
(dstFilePathLen <
static_cast<int>(sizeof(mDstFilePath)/sizeof(mDstFilePath[0])))) {
#ifdef XP_WIN
GetTempFileNameW(sourcePath, L"log", 0, mTmpFilePath);
logFP = NS_tfopen(mTmpFilePath, NS_T("w"));
if (GetTempFileNameW(sourcePath, L"log", 0, mTmpFilePath) != 0) {
logFP = NS_tfopen(mTmpFilePath, NS_T("w"));
// Delete this file now so it is possible to tell from the unelevated
// updater process if the elevated updater process has written the log.
DeleteFileW(mDstFilePath);
// Delete this file now so it is possible to tell from the unelevated
// updater process if the elevated updater process has written the log.
DeleteFileW(mDstFilePath);
}
#elif XP_MACOSX
logFP = NS_tfopen(mDstFilePath, NS_T("w"));
#else
@ -145,3 +146,68 @@ void UpdateLog::WarnPrintf(const char *fmt, ... )
fprintf(logFP, "***\n");
va_end(ap);
}
/**
* Performs checks of a full path for validity for this application.
*
* @param origFullPath
* The full path to check.
* @return true if the path is valid for this application and false otherwise.
*/
bool
IsValidFullPath(NS_tchar* origFullPath)
{
// Subtract 1 from MAXPATHLEN for null termination.
if (NS_tstrlen(origFullPath) > MAXPATHLEN - 1) {
// The path is longer than acceptable for this application.
return false;
}
#ifdef XP_WIN
NS_tchar testPath[MAXPATHLEN] = {NS_T('\0')};
// GetFullPathNameW will replace / with \ which PathCanonicalizeW requires.
if (GetFullPathNameW(origFullPath, MAXPATHLEN, testPath, nullptr) == 0) {
// Unable to get the full name for the path (e.g. invalid path).
return false;
}
NS_tchar canonicalPath[MAXPATHLEN] = {NS_T('\0')};
if (!PathCanonicalizeW(canonicalPath, testPath)) {
// Path could not be canonicalized (e.g. invalid path).
return false;
}
// Check if the path passed in resolves to a differerent path.
if (NS_tstricmp(origFullPath, canonicalPath) != 0) {
// Case insensitive string comparison between the supplied path and the
// canonical path are not equal. This will prevent directory traversal and
// the use of / in paths since they are converted to \.
return false;
}
NS_tstrncpy(testPath, origFullPath, MAXPATHLEN);
if (!PathStripToRootW(testPath)) {
// It should always be possible to strip a valid path to its root.
return false;
}
if (origFullPath[0] == NS_T('\\')) {
// Only allow UNC server share paths.
if (!PathIsUNCServerShareW(testPath)) {
return false;
}
}
#else
// Only allow full paths.
if (origFullPath[0] != NS_T('/')) {
return false;
}
// The path must not traverse directories
if (NS_tstrstr(origFullPath, NS_T("..")) != nullptr ||
NS_tstrstr(origFullPath, NS_T("./")) != nullptr) {
return false;
}
#endif
return true;
}

Просмотреть файл

@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef UPDATELOGGING_H
#define UPDATELOGGING_H
#ifndef UPDATECOMMON_H
#define UPDATECOMMON_H
#include "updatedefines.h"
#include <stdio.h>
@ -35,6 +35,8 @@ protected:
NS_tchar mDstFilePath[MAXPATHLEN];
};
bool IsValidFullPath(NS_tchar* fullPath);
#define LOG_WARN(args) UpdateLog::GetPrimaryLog().WarnPrintf args
#define LOG(args) UpdateLog::GetPrimaryLog().Printf args
#define LogInit(PATHNAME_, FILENAME_) \

Просмотреть файл

@ -273,7 +273,9 @@ WriteStatusFailure(LPCWSTR updateDirPath, int errorCode)
// The temp file is not removed on failure since there is client code that
// will remove it.
WCHAR tmpUpdateStatusFilePath[MAX_PATH + 1] = { L'\0' };
GetTempFileNameW(updateDirPath, L"svc", 0, tmpUpdateStatusFilePath);
if (GetTempFileNameW(updateDirPath, L"svc", 0, tmpUpdateStatusFilePath) == 0) {
return FALSE;
}
HANDLE tmpStatusFile = CreateFileW(tmpUpdateStatusFilePath, GENERIC_WRITE, 0,
nullptr, CREATE_ALWAYS, 0, nullptr);

Просмотреть файл

@ -396,92 +396,53 @@ function getElevationRequired() {
* @return true if an update can be applied, false otherwise
*/
function getCanApplyUpdates() {
let useService = false;
if (shouldUseService()) {
// No need to perform directory write checks, the maintenance service will
// be able to write to all directories.
LOG("getCanApplyUpdates - bypass the write checks because we'll use the service");
useService = true;
if (AppConstants.platform == "macosx") {
LOG("getCanApplyUpdates - bypass the write since elevation can be used " +
"on Mac OS X");
return true;
}
if (!useService && AppConstants.platform != "macosx") {
try {
let updateTestFile = getUpdateFile([FILE_UPDATE_TEST]);
LOG("getCanApplyUpdates - testing write access " + updateTestFile.path);
testWriteAccess(updateTestFile, false);
if (AppConstants.platform == "win") {
// Example windowsVersion: Windows XP == 5.1
let windowsVersion = Services.sysinfo.getProperty("version");
LOG("getCanApplyUpdates - windowsVersion = " + windowsVersion);
if (shouldUseService()) {
LOG("getCanApplyUpdates - bypass the write checks because the Windows " +
"Maintenance Service can be used");
return true;
}
/**
* For Vista, updates can be performed to a location requiring admin
* privileges by requesting elevation via the UAC prompt when launching
* updater.exe if the appDir is under the Program Files directory
* (e.g. C:\Program Files\) and UAC is turned on and we can elevate
* (e.g. user has a split token).
*
* Note: this does note attempt to handle the case where UAC is turned on
* and the installation directory is in a restricted location that
* requires admin privileges to update other than Program Files.
*/
let userCanElevate = false;
if (parseFloat(windowsVersion) >= 6) {
try {
// KEY_UPDROOT will fail and throw an exception if
// appDir is not under the Program Files, so we rely on that
Services.dirsvc.get(KEY_UPDROOT, Ci.nsIFile);
// appDir is under Program Files, so check if the user can elevate
userCanElevate = Services.appinfo.QueryInterface(Ci.nsIWinAppHelper).
userCanElevate;
LOG("getCanApplyUpdates - on Vista, userCanElevate: " + userCanElevate);
} catch (ex) {
// When the installation directory is not under Program Files,
// fall through to checking if write access to the
// installation directory is available.
LOG("getCanApplyUpdates - on Vista, appDir is not under Program Files");
}
}
/**
* On Windows, we no longer store the update under the app dir.
*
* If we are on Windows (including Vista, if we can't elevate) we need to
* to check that we can create and remove files from the actual app
* directory (like C:\Program Files\Mozilla Firefox). If we can't
* (because this user is not an adminstrator, for example) canUpdate()
* should return false.
*
* For Vista, we perform this check to enable updating the application
* when the user has write access to the installation directory under the
* following scenarios:
* 1) the installation directory is not under Program Files
* (e.g. C:\Program Files)
* 2) UAC is turned off
* 3) UAC is turned on and the user is not an admin
* (e.g. the user does not have a split token)
* 4) UAC is turned on and the user is already elevated, so they can't be
* elevated again
*/
if (!userCanElevate) {
// if we're unable to create the test file this will throw an exception.
let appDirTestFile = getAppBaseDir();
appDirTestFile.append(FILE_UPDATE_TEST);
LOG("getCanApplyUpdates - testing write access " + appDirTestFile.path);
if (appDirTestFile.exists()) {
appDirTestFile.remove(false);
}
appDirTestFile.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, FileUtils.PERMS_FILE);
try {
// Test write access to the updates directory. On Linux the updates
// directory is located in the installation directory so this is the only
// write access check that is necessary to tell whether the user can apply
// updates. On Windows the updates directory is in the user's local
// application data directory so this should always succeed and additional
// checks are performed below.
let updateTestFile = getUpdateFile([FILE_UPDATE_TEST]);
LOG("getCanApplyUpdates - testing write access " + updateTestFile.path);
testWriteAccess(updateTestFile, false);
if (AppConstants.platform == "win") {
// On Windows when the maintenance service isn't used updates can still be
// performed in a location requiring admin privileges by the client
// accepting a UAC prompt from an elevation request made by the updater.
// Whether the client can elevate (e.g. has a split token) is determined
// in nsXULAppInfo::GetUserCanElevate which is located in nsAppRunner.cpp.
let userCanElevate = Services.appinfo.QueryInterface(Ci.nsIWinAppHelper).
userCanElevate;
if (!userCanElevate) {
// if we're unable to create the test file this will throw an exception.
let appDirTestFile = getAppBaseDir();
appDirTestFile.append(FILE_UPDATE_TEST);
LOG("getCanApplyUpdates - testing write access " + appDirTestFile.path);
if (appDirTestFile.exists()) {
appDirTestFile.remove(false);
}
appDirTestFile.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, FileUtils.PERMS_FILE);
appDirTestFile.remove(false);
}
} catch (e) {
LOG("getCanApplyUpdates - unable to apply updates. Exception: " + e);
// No write privileges to install directory
return false;
}
} // if (!useService)
} catch (e) {
LOG("getCanApplyUpdates - unable to apply updates. Exception: " + e);
// No write access to the installation directory
return false;
}
LOG("getCanApplyUpdates - able to apply updates");
return true;
@ -790,81 +751,14 @@ function shouldUseService() {
// 1) This build was done with the maintenance service enabled
// 2) The maintenance service is installed
// 3) The pref for using the service is enabled
// 4) The Windows version is XP Service Pack 3 or above (for SHA-2 support)
// The maintenance service requires SHA-2 support because we sign our binaries
// with a SHA-2 certificate and the certificate is verified before the binary
// is launched.
if (!AppConstants.MOZ_MAINTENANCE_SERVICE || !isServiceInstalled() ||
!getPref("getBoolPref", PREF_APP_UPDATE_SERVICE_ENABLED, false) ||
!AppConstants.isPlatformAndVersionAtLeast("win", "5.1") /* WinXP */) {
!getPref("getBoolPref", PREF_APP_UPDATE_SERVICE_ENABLED, false)) {
LOG("shouldUseService - returning false");
return false;
}
// If it's newer than XP, then the service pack doesn't matter.
if (Services.sysinfo.getProperty("version") != "5.1") {
return true;
}
// If the Windows version is XP, we also need to check the service pack.
// We'll return false if only < SP3 is installed, or if we can't tell.
// Check the service pack level by calling GetVersionEx via ctypes.
const BYTE = ctypes.uint8_t;
const WORD = ctypes.uint16_t;
const DWORD = ctypes.uint32_t;
const WCHAR = ctypes.char16_t;
const BOOL = ctypes.int;
// This structure is described at:
// http://msdn.microsoft.com/en-us/library/ms724833%28v=vs.85%29.aspx
const SZCSDVERSIONLENGTH = 128;
const OSVERSIONINFOEXW = new ctypes.StructType("OSVERSIONINFOEXW",
[
{dwOSVersionInfoSize: DWORD},
{dwMajorVersion: DWORD},
{dwMinorVersion: DWORD},
{dwBuildNumber: DWORD},
{dwPlatformId: DWORD},
{szCSDVersion: ctypes.ArrayType(WCHAR, SZCSDVERSIONLENGTH)},
{wServicePackMajor: WORD},
{wServicePackMinor: WORD},
{wSuiteMask: WORD},
{wProductType: BYTE},
{wReserved: BYTE}
]);
let kernel32 = false;
try {
kernel32 = ctypes.open("Kernel32");
} catch (e) {
Cu.reportError("Unable to open kernel32! " + e);
return false;
}
if (kernel32) {
try {
try {
let GetVersionEx = kernel32.declare("GetVersionExW",
ctypes.winapi_abi,
BOOL,
OSVERSIONINFOEXW.ptr);
let winVer = OSVERSIONINFOEXW();
winVer.dwOSVersionInfoSize = OSVERSIONINFOEXW.size;
if (0 !== GetVersionEx(winVer.address())) {
return winVer.wServicePackMajor >= 3;
}
Cu.reportError("Unknown failure in GetVersionEX (returned 0)");
return false;
} catch (e) {
Cu.reportError("Error getting service pack information. Exception: " + e);
return false;
}
} finally {
kernel32.close();
}
}
// If the service pack check couldn't be done, assume we can't use the service.
return false;
LOG("shouldUseService - returning true");
return true;
}
/**
@ -873,23 +767,25 @@ function shouldUseService() {
* @return true if the service is installed.
*/
function isServiceInstalled() {
if (AppConstants.MOZ_MAINTENANCE_SERVICE && AppConstants.platform == "win") {
let installed = 0;
try {
let wrk = Cc["@mozilla.org/windows-registry-key;1"].
createInstance(Ci.nsIWindowsRegKey);
wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE,
"SOFTWARE\\Mozilla\\MaintenanceService",
wrk.ACCESS_READ | wrk.WOW64_64);
installed = wrk.readIntValue("Installed");
wrk.close();
} catch (e) {
}
installed = installed == 1; // convert to bool
LOG("isServiceInstalled = " + installed);
return installed;
if (!AppConstants.MOZ_MAINTENANCE_SERVICE || AppConstants.platform != "win") {
LOG("isServiceInstalled - returning false");
return false;
}
return false;
let installed = 0;
try {
let wrk = Cc["@mozilla.org/windows-registry-key;1"].
createInstance(Ci.nsIWindowsRegKey);
wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE,
"SOFTWARE\\Mozilla\\MaintenanceService",
wrk.ACCESS_READ | wrk.WOW64_64);
installed = wrk.readIntValue("Installed");
wrk.close();
} catch (e) {
}
installed = installed == 1; // convert to bool
LOG("isServiceInstalled - returning " + installed);
return installed;
}
/**
@ -1389,7 +1285,6 @@ function Update(update) {
this._properties = {};
this._patches = [];
this.isCompleteUpdate = false;
this.isOSUpdate = false;
this.showPrompt = false;
this.showNeverForVersion = false;
this.unsupported = false;
@ -1447,8 +1342,6 @@ function Update(update) {
this.isCompleteUpdate = attr.value == "true";
} else if (attr.name == "isSecurityUpdate") {
this.isSecurityUpdate = attr.value == "true";
} else if (attr.name == "isOSUpdate") {
this.isOSUpdate = attr.value == "true";
} else if (attr.name == "showNeverForVersion") {
this.showNeverForVersion = attr.value == "true";
} else if (attr.name == "showPrompt") {
@ -1590,7 +1483,6 @@ Update.prototype = {
update.setAttribute("displayVersion", this.displayVersion);
update.setAttribute("installDate", this.installDate);
update.setAttribute("isCompleteUpdate", this.isCompleteUpdate);
update.setAttribute("isOSUpdate", this.isOSUpdate);
update.setAttribute("name", this.name);
update.setAttribute("serviceURL", this.serviceURL);
update.setAttribute("showNeverForVersion", this.showNeverForVersion);
@ -1841,6 +1733,23 @@ UpdateService.prototype = {
return;
}
// Handle the case when the update is the same or older than the current
// version and nsUpdateDriver.cpp skipped updating due to the version being
// older than the current version.
if (update && update.appVersion &&
(status == STATE_PENDING || status == STATE_PENDING_SERVICE ||
status == STATE_APPLIED || status == STATE_APPLIED_SERVICE ||
status == STATE_PENDING_ELEVATE)) {
if (Services.vc.compare(update.appVersion, Services.appinfo.version) < 0 ||
Services.vc.compare(update.appVersion, Services.appinfo.version) == 0 &&
update.buildID == Services.appinfo.appBuildID) {
LOG("UpdateService:_postUpdateProcessing - removing update for older " +
"or same application version");
cleanupActiveUpdate();
return;
}
}
if (status == STATE_DOWNLOADING) {
LOG("UpdateService:_postUpdateProcessing - patch found in downloading " +
"state");

Просмотреть файл

@ -337,6 +337,26 @@ int NS_main(int argc, NS_tchar **argv)
#endif
}
if (!NS_tstrcmp(argv[1], NS_T("launch-service"))) {
#ifdef XP_WIN
DWORD ret = LaunchServiceSoftwareUpdateCommand(argc - 2, (LPCWSTR *)argv + 2);
if (ret != ERROR_SUCCESS) {
// 192 is used to avoid reusing a possible return value from the call to
// WaitForServiceStop
return 0x000000C0;
}
// Wait a maximum of 120 seconds.
DWORD lastState = WaitForServiceStop(SVC_NAME, 120);
if (SERVICE_STOPPED == lastState) {
return 0;
}
return lastState;
#else
// Not implemented on non-Windows platforms
return 1;
#endif
}
if (NS_tchdir(argv[1]) != 0) {
return 1;
}

Просмотреть файл

@ -37,14 +37,23 @@ const STATE_SUCCEEDED = "succeeded";
const STATE_DOWNLOAD_FAILED = "download-failed";
const STATE_FAILED = "failed";
const LOADSOURCE_ERROR_WRONG_SIZE = 2;
const CRC_ERROR = 4;
const READ_ERROR = 6;
const WRITE_ERROR = 7;
const MAR_CHANNEL_MISMATCH_ERROR = 22;
const VERSION_DOWNGRADE_ERROR = 23;
const INVALID_APPLYTO_DIR_STAGED_ERROR = 72;
const INVALID_APPLYTO_DIR_ERROR = 74;
const LOADSOURCE_ERROR_WRONG_SIZE = 2;
const CRC_ERROR = 4;
const READ_ERROR = 6;
const WRITE_ERROR = 7;
const MAR_CHANNEL_MISMATCH_ERROR = 22;
const VERSION_DOWNGRADE_ERROR = 23;
const SERVICE_COULD_NOT_COPY_UPDATER = 49;
const SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR = 52;
const SERVICE_INVALID_APPLYTO_DIR_ERROR = 54;
const SERVICE_INVALID_INSTALL_DIR_PATH_ERROR = 55;
const SERVICE_INVALID_WORKING_DIR_PATH_ERROR = 56;
const INVALID_APPLYTO_DIR_STAGED_ERROR = 72;
const INVALID_APPLYTO_DIR_ERROR = 74;
const INVALID_INSTALL_DIR_PATH_ERROR = 75;
const INVALID_WORKING_DIR_PATH_ERROR = 76;
const INVALID_CALLBACK_PATH_ERROR = 77;
const INVALID_CALLBACK_DIR_ERROR = 78;
const STATE_FAILED_DELIMETER = ": ";
@ -60,10 +69,28 @@ const STATE_FAILED_MAR_CHANNEL_MISMATCH_ERROR =
STATE_FAILED + STATE_FAILED_DELIMETER + MAR_CHANNEL_MISMATCH_ERROR;
const STATE_FAILED_VERSION_DOWNGRADE_ERROR =
STATE_FAILED + STATE_FAILED_DELIMETER + VERSION_DOWNGRADE_ERROR;
const STATE_FAILED_SERVICE_COULD_NOT_COPY_UPDATER =
STATE_FAILED + STATE_FAILED_DELIMETER + SERVICE_COULD_NOT_COPY_UPDATER
const STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR =
STATE_FAILED + STATE_FAILED_DELIMETER + SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR;
const STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_ERROR =
STATE_FAILED + STATE_FAILED_DELIMETER + SERVICE_INVALID_APPLYTO_DIR_ERROR;
const STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR =
STATE_FAILED + STATE_FAILED_DELIMETER + SERVICE_INVALID_INSTALL_DIR_PATH_ERROR;
const STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR =
STATE_FAILED + STATE_FAILED_DELIMETER + SERVICE_INVALID_WORKING_DIR_PATH_ERROR;
const STATE_FAILED_INVALID_APPLYTO_DIR_STAGED_ERROR =
STATE_FAILED + STATE_FAILED_DELIMETER + INVALID_APPLYTO_DIR_STAGED_ERROR;
const STATE_FAILED_INVALID_APPLYTO_DIR_ERROR =
STATE_FAILED + STATE_FAILED_DELIMETER + INVALID_APPLYTO_DIR_ERROR;
const STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR =
STATE_FAILED + STATE_FAILED_DELIMETER + INVALID_INSTALL_DIR_PATH_ERROR;
const STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR =
STATE_FAILED + STATE_FAILED_DELIMETER + INVALID_WORKING_DIR_PATH_ERROR;
const STATE_FAILED_INVALID_CALLBACK_PATH_ERROR =
STATE_FAILED + STATE_FAILED_DELIMETER + INVALID_CALLBACK_PATH_ERROR;
const STATE_FAILED_INVALID_CALLBACK_DIR_ERROR =
STATE_FAILED + STATE_FAILED_DELIMETER + INVALID_CALLBACK_DIR_ERROR;
/**
* Constructs a string representing a remote update xml file.

Просмотреть файл

@ -39,7 +39,7 @@ const URL_HTTP_UPDATE_SJS = "http://test_details/";
/* global INSTALL_LOCALE, MOZ_APP_NAME, BIN_SUFFIX, MOZ_APP_VENDOR */
/* global MOZ_APP_BASENAME, APP_BIN_SUFFIX, APP_INFO_NAME, APP_INFO_VENDOR */
/* global IS_WIN, IS_MACOSX, IS_UNIX, MOZ_VERIFY_MAR_SIGNATURE */
/* global MOZ_VERIFY_MAR_SIGNATURE, IS_AUTHENTICODE_CHECK_ENABLED */
/* global IS_AUTHENTICODE_CHECK_ENABLED */
load("../data/xpcshellConstantsPP.js");
function getLogSuffix() {
@ -159,8 +159,6 @@ var gGREDirOrig;
var gGREBinDirOrig;
var gAppDirOrig;
var gApplyToDirOverride;
// Variables are used instead of contants so tests can override these values if
// necessary.
var gCallbackBinFile = "callback_app" + BIN_SUFFIX;
@ -1134,18 +1132,6 @@ function getAppVersion() {
return iniParser.getString("App", "Version");
}
/**
* Override the apply-to directory parameter to be passed to the updater.
* This ought to cause the updater to fail when using any value that isn't the
* default, automatically computed one.
*
* @param dir
* Complete string to use as the apply-to directory parameter.
*/
function overrideApplyToDir(dir) {
gApplyToDirOverride = dir;
}
/**
* Helper function for getting the relative path to the directory where the
* application binary is located (e.g. <test_file_leafname>/dir.app/).
@ -1673,9 +1659,25 @@ function readServiceLogFile() {
* tests.
* @param aCheckSvcLog
* Whether the service log should be checked for service tests.
* @param aPatchDirPath (optional)
* When specified the patch directory path to use for invalid argument
* tests otherwise the normal path will be used.
* @param aInstallDirPath (optional)
* When specified the install directory path to use for invalid
* argument tests otherwise the normal path will be used.
* @param aApplyToDirPath (optional)
* When specified the apply to / working directory path to use for
* invalid argument tests otherwise the normal path will be used.
* @param aCallbackPath (optional)
* When specified the callback path to use for invalid argument tests
* otherwise the normal path will be used.
*/
function runUpdate(aExpectedStatus, aSwitchApp, aExpectedExitValue,
aCheckSvcLog) {
function runUpdate(aExpectedStatus, aSwitchApp, aExpectedExitValue, aCheckSvcLog,
aPatchDirPath, aInstallDirPath, aApplyToDirPath,
aCallbackPath) {
let isInvalidArgTest = !!aPatchDirPath || !!aInstallDirPath ||
!!aApplyToDirPath || aCallbackPath;
let svcOriginalLog;
if (IS_SERVICE_TEST) {
copyFileToTestAppDir(FILE_MAINTENANCE_SERVICE_BIN, false);
@ -1690,28 +1692,39 @@ function runUpdate(aExpectedStatus, aSwitchApp, aExpectedExitValue,
Assert.ok(updateBin.exists(),
MSG_SHOULD_EXIST + getMsgPath(updateBin.path));
let updatesDirPath = getUpdatesPatchDir().path;
let applyToDirPath = getApplyDirFile(null, true).path;
let stageDirPath = getStageDirFile(null, true).path;
let updatesDirPath = aPatchDirPath || getUpdatesPatchDir().path;
let installDirPath = aInstallDirPath || getApplyDirFile(null, true).path;
let applyToDirPath = aApplyToDirPath || getApplyDirFile(null, true).path;
let stageDirPath = aApplyToDirPath || getStageDirFile(null, true).path;
let callbackApp = getApplyDirFile(DIR_RESOURCES + gCallbackBinFile);
callbackApp.permissions = PERMS_DIRECTORY;
setAppBundleModTime();
let args = [updatesDirPath, applyToDirPath];
let args = [updatesDirPath, installDirPath];
if (aSwitchApp) {
args[2] = gApplyToDirOverride || stageDirPath;
args[2] = stageDirPath;
args[3] = "0/replace";
} else {
args[2] = gApplyToDirOverride || applyToDirPath;
args[2] = applyToDirPath;
args[3] = "0";
}
args = args.concat([callbackApp.parent.path, callbackApp.path]);
args = args.concat(gCallbackArgs);
debugDump("running the updater: " + updateBin.path + " " + args.join(" "));
if (aSwitchApp) {
let launchBin = IS_SERVICE_TEST && isInvalidArgTest ? callbackApp : updateBin;
if (!isInvalidArgTest) {
args = args.concat([callbackApp.parent.path, callbackApp.path]);
args = args.concat(gCallbackArgs);
} else if (IS_SERVICE_TEST) {
args = ["launch-service", updateBin.path].concat(args);
} else if (aCallbackPath) {
args = args.concat([callbackApp.parent.path, aCallbackPath]);
}
debugDump("launching the program: " + launchBin.path + " " + args.join(" "));
if (aSwitchApp && !isInvalidArgTest) {
// We want to set the env vars again
gShouldResetEnv = undefined;
}
@ -1720,7 +1733,7 @@ function runUpdate(aExpectedStatus, aSwitchApp, aExpectedExitValue,
let process = Cc["@mozilla.org/process/util;1"].
createInstance(Ci.nsIProcess);
process.init(updateBin);
process.init(launchBin);
process.run(true, args, args.length);
resetEnvironment();
@ -1751,9 +1764,11 @@ function runUpdate(aExpectedStatus, aSwitchApp, aExpectedExitValue,
Assert.notEqual(contents, svcOriginalLog,
"the contents of the maintenanceservice.log should not " +
"be the same as the original contents");
Assert.notEqual(contents.indexOf(LOG_SVC_SUCCESSFUL_LAUNCH), -1,
"the contents of the maintenanceservice.log should " +
"contain the successful launch string");
if (!isInvalidArgTest) {
Assert.notEqual(contents.indexOf(LOG_SVC_SUCCESSFUL_LAUNCH), -1,
"the contents of the maintenanceservice.log should " +
"contain the successful launch string");
}
}
do_execute_soon(runUpdateFinished);
@ -2581,8 +2596,12 @@ function waitForHelperExit() {
* @param aPostUpdateAsync
* When null the updater.ini is not created otherwise this parameter
* is passed to createUpdaterINI.
* @param aPostUpdateExeRelPathPrefix
* When aPostUpdateAsync null this value is ignored otherwise it is
* passed to createUpdaterINI.
*/
function setupUpdaterTest(aMarFile, aPostUpdateAsync) {
function setupUpdaterTest(aMarFile, aPostUpdateAsync,
aPostUpdateExeRelPathPrefix = "") {
let updatesPatchDir = getUpdatesPatchDir();
if (!updatesPatchDir.exists()) {
updatesPatchDir.create(Ci.nsIFile.DIRECTORY_TYPE, PERMS_DIRECTORY);
@ -2667,7 +2686,7 @@ function setupUpdaterTest(aMarFile, aPostUpdateAsync) {
setupActiveUpdate();
if (aPostUpdateAsync !== null) {
createUpdaterINI(aPostUpdateAsync);
createUpdaterINI(aPostUpdateAsync, aPostUpdateExeRelPathPrefix);
}
setupAppFilesAsync();
@ -2690,8 +2709,10 @@ function createUpdateSettingsINI() {
* True or undefined if the post update process should be async. If
* undefined ExeAsync will not be added to the updater.ini file in
* order to test the default launch behavior which is async.
* @param aExeRelPathPrefix
* A string to prefix the ExeRelPath values in the updater.ini.
*/
function createUpdaterINI(aIsExeAsync) {
function createUpdaterINI(aIsExeAsync, aExeRelPathPrefix) {
let exeArg = "ExeArg=post-update-async\n";
let exeAsync = "";
if (aIsExeAsync !== undefined) {
@ -2703,16 +2724,23 @@ function createUpdaterINI(aIsExeAsync) {
}
}
if (aExeRelPathPrefix && IS_WIN) {
aExeRelPathPrefix = aExeRelPathPrefix.replace("/", "\\");
}
let exeRelPathMac = "ExeRelPath=" + aExeRelPathPrefix + DIR_RESOURCES +
gPostUpdateBinFile + "\n";
let exeRelPathWin = "ExeRelPath=" + aExeRelPathPrefix + gPostUpdateBinFile + "\n";
let updaterIniContents = "[Strings]\n" +
"Title=Update Test\n" +
"Info=Running update test " + gTestID + "\n\n" +
"[PostUpdateMac]\n" +
"ExeRelPath=" + DIR_RESOURCES + gPostUpdateBinFile + "\n" +
exeRelPathMac +
exeArg +
exeAsync +
"\n" +
"[PostUpdateWin]\n" +
"ExeRelPath=" + gPostUpdateBinFile + "\n" +
exeRelPathWin +
exeArg +
exeAsync;
let updaterIni = getApplyDirFile(DIR_RESOURCES + FILE_UPDATER_INI, true);
@ -3171,16 +3199,6 @@ function checkFilesAfterUpdateCommon(aGetFileFunc, aStageDirExists,
applyToDir = getApplyDirFile(null, true);
checkFilesInDirRecursive(stageDir, checkForBackupFiles);
}
debugDump("testing patch files should not be left behind");
let updatesDir = getUpdatesPatchDir();
let entries = updatesDir.QueryInterface(Ci.nsIFile).directoryEntries;
while (entries.hasMoreElements()) {
let entry = entries.getNext().QueryInterface(Ci.nsIFile);
Assert.notEqual(getFileExtension(entry), "patch",
"the file's extension should not equal patch" +
getMsgPath(entry.path));
}
}
/**
@ -3836,20 +3854,27 @@ function runUpdateUsingApp(aExpectedStatus) {
aExpectedStatus +
", current status: " + status);
} else {
do_execute_soon(afterAppExits);
do_timeout(FILE_IN_USE_TIMEOUT_MS, afterAppExits);
}
return;
}
// Don't proceed until the update log has been created.
let log = getUpdateLog(FILE_UPDATE_LOG);
if (!log.exists()) {
if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
do_throw("Exceeded MAX_TIMEOUT_RUNS while waiting for the update log " +
"to be created. Path: " + log.path);
// Don't check for an update log when the code in nsUpdateDriver.cpp skips
// updating.
if (aExpectedStatus != STATE_PENDING &&
aExpectedStatus != STATE_PENDING_SVC &&
aExpectedStatus != STATE_APPLIED &&
aExpectedStatus != STATE_APPLIED_SVC) {
// Don't proceed until the update log has been created.
let log = getUpdateLog(FILE_UPDATE_LOG);
if (!log.exists()) {
if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
do_throw("Exceeded MAX_TIMEOUT_RUNS while waiting for the update " +
"log to be created. Path: " + log.path);
}
do_timeout(FILE_IN_USE_TIMEOUT_MS, afterAppExits);
return;
}
do_execute_soon(afterAppExits);
return;
}
do_execute_soon(runUpdateFinished);

Просмотреть файл

@ -3,9 +3,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Test trying to use an apply-to directory different from the install
* directory, which should fail.
*/
/* Callback file not in install directory or a sub-directory of the install
directory failure */
const STATE_AFTER_RUNUPDATE = STATE_FAILED_INVALID_CALLBACK_DIR_ERROR;
function run_test() {
if (!setupTestCommon()) {
@ -21,11 +22,8 @@ function run_test() {
* Called after the call to setupUpdaterTest finishes.
*/
function setupUpdaterTestFinished() {
overrideApplyToDir(getApplyDirPath() + "/../NoSuchDir");
// If execv is used the updater process will turn into the callback process
// and the updater's return code will be that of the callback process.
runUpdate(STATE_FAILED_INVALID_APPLYTO_DIR_ERROR, false, (USE_EXECV ? 0 : 1),
false);
let path = getTestDirFile(FILE_HELPER_BIN).path;
runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, null, path);
}
/**

Просмотреть файл

@ -0,0 +1,45 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Too long callback file path failure test */
const STATE_AFTER_RUNUPDATE = STATE_FAILED_INVALID_CALLBACK_PATH_ERROR;
function run_test() {
if (!setupTestCommon()) {
return;
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setTestFilesAndDirsForFailure();
setupUpdaterTest(FILE_COMPLETE_MAR, false);
}
/**
* Called after the call to setupUpdaterTest finishes.
*/
function setupUpdaterTestFinished() {
let path = "123456789";
if (IS_WIN) {
path = "\\" + path;
path = path.repeat(30); // 300 characters
path = "C:" + path;
} else {
path = "/" + path;
path = path.repeat(1000); // 10000 characters
}
runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, null, path);
}
/**
* Called after the call to runUpdateUsingUpdater finishes.
*/
function runUpdateFinished() {
standardInit();
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();
}

Просмотреть файл

@ -0,0 +1,47 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Too long install directory path failure test */
const STATE_AFTER_RUNUPDATE =
IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR
: STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR;
function run_test() {
if (!setupTestCommon()) {
return;
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setTestFilesAndDirsForFailure();
setupUpdaterTest(FILE_COMPLETE_MAR, false);
}
/**
* Called after the call to setupUpdaterTest finishes.
*/
function setupUpdaterTestFinished() {
let path = "123456789";
if (IS_WIN) {
path = "\\" + path;
path = path.repeat(30); // 300 characters
path = "C:" + path;
} else {
path = "/" + path;
path = path.repeat(1000); // 10000 characters
}
runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, path, null, null);
}
/**
* Called after the call to runUpdateUsingUpdater finishes.
*/
function runUpdateFinished() {
standardInit();
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();
}

Просмотреть файл

@ -0,0 +1,44 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Install directory path traversal failure test */
const STATE_AFTER_RUNUPDATE =
IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR
: STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR;
function run_test() {
if (!setupTestCommon()) {
return;
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setTestFilesAndDirsForFailure();
setupUpdaterTest(FILE_COMPLETE_MAR, false);
}
/**
* Called after the call to setupUpdaterTest finishes.
*/
function setupUpdaterTestFinished() {
let path = "123456789";
if (IS_WIN) {
path = "C:\\" + path + "\\..\\" + path;
} else {
path = "/" + path + "/../" + path;
}
runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, path, null, null);
}
/**
* Called after the call to runUpdateUsingUpdater finishes.
*/
function runUpdateFinished() {
standardInit();
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();
}

Просмотреть файл

@ -0,0 +1,38 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Different install and working directories for a regular update failure */
const STATE_AFTER_RUNUPDATE =
IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_ERROR
: STATE_FAILED_INVALID_APPLYTO_DIR_ERROR;
function run_test() {
if (!setupTestCommon()) {
return;
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setTestFilesAndDirsForFailure();
setupUpdaterTest(FILE_COMPLETE_MAR, false);
}
/**
* Called after the call to setupUpdaterTest finishes.
*/
function setupUpdaterTestFinished() {
let path = getApplyDirFile("..", false).path;
runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, path, null);
}
/**
* Called after the call to runUpdateUsingUpdater finishes.
*/
function runUpdateFinished() {
standardInit();
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();
}

Просмотреть файл

@ -0,0 +1,43 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Patch directory path traversal failure test */
const STATE_AFTER_RUNUPDATE =
IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
function run_test() {
if (!setupTestCommon()) {
return;
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setTestFilesAndDirsForFailure();
setupUpdaterTest(FILE_COMPLETE_MAR, false);
}
/**
* Called after the call to setupUpdaterTest finishes.
*/
function setupUpdaterTestFinished() {
let path = getUpdatesPatchDir();
if (IS_WIN) {
path = path + "\\..\\";
} else {
path = path + "/../";
}
runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, path, null, null, null);
}
/**
* Called after the call to runUpdateUsingUpdater finishes.
*/
function runUpdateFinished() {
standardInit();
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();
}

Просмотреть файл

@ -0,0 +1,38 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Different install and working directories for a regular update failure */
const STATE_AFTER_RUNUPDATE =
IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR
: STATE_FAILED_INVALID_APPLYTO_DIR_STAGED_ERROR;
function run_test() {
if (!setupTestCommon()) {
return;
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setTestFilesAndDirsForFailure();
setupUpdaterTest(FILE_COMPLETE_MAR, false);
}
/**
* Called after the call to setupUpdaterTest finishes.
*/
function setupUpdaterTestFinished() {
let path = getApplyDirFile("..", false).path;
runUpdate(STATE_AFTER_RUNUPDATE, true, 1, true, null, null, path, null);
}
/**
* Called after the call to runUpdateUsingUpdater finishes.
*/
function runUpdateFinished() {
standardInit();
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();
}

Просмотреть файл

@ -0,0 +1,38 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Working directory path local UNC failure test */
const STATE_AFTER_RUNUPDATE =
IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR
: STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR;
function run_test() {
if (!setupTestCommon()) {
return;
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setTestFilesAndDirsForFailure();
setupUpdaterTest(FILE_COMPLETE_MAR, false);
}
/**
* Called after the call to setupUpdaterTest finishes.
*/
function setupUpdaterTestFinished() {
let path = "\\\\.\\" + getApplyDirFile(null, false).path;
runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, path, null);
}
/**
* Called after the call to runUpdateUsingUpdater finishes.
*/
function runUpdateFinished() {
standardInit();
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();
}

Просмотреть файл

@ -0,0 +1,37 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Relative working directory path failure test */
const STATE_AFTER_RUNUPDATE =
IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR
: STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR;
function run_test() {
if (!setupTestCommon()) {
return;
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setTestFilesAndDirsForFailure();
setupUpdaterTest(FILE_COMPLETE_MAR, false);
}
/**
* Called after the call to setupUpdaterTest finishes.
*/
function setupUpdaterTestFinished() {
runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, "test", null);
}
/**
* Called after the call to runUpdateUsingUpdater finishes.
*/
function runUpdateFinished() {
standardInit();
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();
}

Просмотреть файл

@ -0,0 +1,88 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
/**
* Test a replace request for a staged update with a version file that specifies
* an older version failure. The same check is used in nsUpdateDriver.cpp for
* all update types which is why there aren't tests for the maintenance service
* as well as for other update types.
*/
const STATE_AFTER_STAGE = STATE_APPLIED;
function run_test() {
if (!setupTestCommon()) {
return;
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setupUpdaterTest(FILE_COMPLETE_MAR);
}
/**
* Called after the call to setupUpdaterTest finishes.
*/
function setupUpdaterTestFinished() {
stageUpdate(false);
}
/**
* Called after the call to stageUpdate finishes.
*/
function stageUpdateFinished() {
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateSuccess(getStageDirFile, true);
checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
// Change the active update to an older version to simulate installing a new
// version of the application while there is an update that has been staged.
let channel = gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_CHANNEL);
let patches = getLocalPatchString(null, null, null, null, null, "true",
STATE_AFTER_STAGE);
let updates = getLocalUpdateString(patches, null, null, null, "1.0", null,
null, null, null, null, "true", channel);
writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
// Change the version file to an older version to simulate installing a new
// version of the application while there is an update that has been staged.
writeVersionFile("1.0");
reloadUpdateManagerData();
// Try to switch the application to the staged application that was updated.
runUpdateUsingApp(STATE_AFTER_STAGE);
}
/**
* Called after the call to runUpdateUsingApp finishes.
*/
function runUpdateFinished() {
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
"the status file state" + MSG_SHOULD_EQUAL);
Assert.ok(!gUpdateManager.activeUpdate,
"the active update should not be defined");
Assert.equal(gUpdateManager.updateCount, 1,
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_STAGE,
"the update state" + MSG_SHOULD_EQUAL);
checkPostUpdateRunningFile(false);
setTestFilesAndDirsForFailure();
checkFilesAfterUpdateFailure(getApplyDirFile, IS_MACOSX ? false : true, false);
let updatesDir = getUpdatesPatchDir();
Assert.ok(updatesDir.exists(),
MSG_SHOULD_EXIST + getMsgPath(updatesDir.path));
let log = getUpdateLog(FILE_UPDATE_LOG);
Assert.ok(!log.exists(),
MSG_SHOULD_NOT_EXIST + getMsgPath(log.path));
log = getUpdateLog(FILE_LAST_UPDATE_LOG);
Assert.ok(log.exists(),
MSG_SHOULD_EXIST + getMsgPath(log.path));
log = getUpdateLog(FILE_BACKUP_UPDATE_LOG);
Assert.ok(!log.exists(),
MSG_SHOULD_NOT_EXIST + getMsgPath(log.path));
waitForFilesInUse();
}

Просмотреть файл

@ -14,7 +14,10 @@ function run_test() {
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setupUpdaterTest(FILE_COMPLETE_MAR, undefined);
// The third parameter will test that a full path to the post update binary
// doesn't execute.
setupUpdaterTest(FILE_COMPLETE_MAR, undefined,
getApplyDirFile(null, true).path + "/");
}
/**
@ -28,13 +31,6 @@ function setupUpdaterTestFinished() {
* Called after the call to runUpdateUsingApp finishes.
*/
function runUpdateFinished() {
checkPostUpdateAppLog();
}
/**
* Called after the call to checkPostUpdateAppLog finishes.
*/
function checkPostUpdateAppLogFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
@ -45,7 +41,7 @@ function checkPostUpdateAppLogFinished() {
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkPostUpdateRunningFile(true);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_COMPLETE_SUCCESS);

Просмотреть файл

@ -13,7 +13,6 @@ function run_test() {
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
createUpdaterINI(false);
setupUpdaterTest(FILE_COMPLETE_MAR, false);
}

Просмотреть файл

@ -18,7 +18,9 @@ function run_test() {
gTestFiles[gTestFiles.length - 2].comparePerms = 0o644;
gTestDirs = gTestDirsPartialSuccess;
setupDistributionDir();
setupUpdaterTest(FILE_PARTIAL_MAR, false);
// The third parameter will test that a relative path that contains a
// directory traversal to the post update binary doesn't execute.
setupUpdaterTest(FILE_PARTIAL_MAR, false, "test/../");
}
/**
@ -32,13 +34,6 @@ function setupUpdaterTestFinished() {
* Called after the call to runUpdate finishes.
*/
function runUpdateFinished() {
checkPostUpdateAppLog();
}
/**
* Called after the call to checkPostUpdateAppLog finishes.
*/
function checkPostUpdateAppLogFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
@ -49,7 +44,7 @@ function checkPostUpdateAppLogFinished() {
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkPostUpdateRunningFile(true);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_PARTIAL_SUCCESS);
checkDistributionDir();

Просмотреть файл

@ -10,6 +10,21 @@
tags = appupdate
head = head_update.js
[invalidArgCallbackFileNotInInstallDirFailure.js]
[invalidArgCallbackFilePathTooLongFailure.js]
[invalidArgInstallDirPathTooLongFailure.js]
[invalidArgInstallDirPathTraversalFailure.js]
[invalidArgInstallWorkingDirPathNotSameFailure_win.js]
skip-if = os != 'win'
reason = Windows only test
[invalidArgPatchDirPathTraversalFailure.js]
[invalidArgStageDirNotInInstallDirFailure_win.js]
skip-if = os != 'win'
reason = Windows only test
[invalidArgWorkingDirPathLocalUNCFailure_win.js]
skip-if = os != 'win'
reason = Windows only test
[invalidArgWorkingDirPathRelativeFailure.js]
[marSuccessComplete.js]
[marSuccessPartial.js]
[marFailurePartial.js]
@ -81,6 +96,4 @@ skip-if = os != 'win'
reason = Windows only test
[marAppApplyUpdateSuccess.js]
[marAppApplyUpdateStageSuccess.js]
[marWrongApplyToDirFailure_win.js]
skip-if = os != 'win'
reason = Windows only test
[marAppApplyUpdateStageOldVersionFailure.js]

Просмотреть файл

@ -0,0 +1,47 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Too long install directory path failure test */
const STATE_AFTER_RUNUPDATE =
IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR
: STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR;
function run_test() {
if (!setupTestCommon()) {
return;
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setTestFilesAndDirsForFailure();
setupUpdaterTest(FILE_COMPLETE_MAR, false);
}
/**
* Called after the call to setupUpdaterTest finishes.
*/
function setupUpdaterTestFinished() {
let path = "123456789";
if (IS_WIN) {
path = "\\" + path;
path = path.repeat(30); // 300 characters
path = "C:" + path;
} else {
path = "/" + path;
path = path.repeat(1000); // 10000 characters
}
runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, path, null, null);
}
/**
* Called after the call to runUpdateUsingUpdater finishes.
*/
function runUpdateFinished() {
standardInit();
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();
}

Просмотреть файл

@ -0,0 +1,44 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Install directory path traversal failure test */
const STATE_AFTER_RUNUPDATE =
IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR
: STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR;
function run_test() {
if (!setupTestCommon()) {
return;
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setTestFilesAndDirsForFailure();
setupUpdaterTest(FILE_COMPLETE_MAR, false);
}
/**
* Called after the call to setupUpdaterTest finishes.
*/
function setupUpdaterTestFinished() {
let path = "123456789";
if (IS_WIN) {
path = "C:\\" + path + "\\..\\" + path;
} else {
path = "/" + path + "/../" + path;
}
runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, path, null, null);
}
/**
* Called after the call to runUpdateUsingUpdater finishes.
*/
function runUpdateFinished() {
standardInit();
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();
}

Просмотреть файл

@ -0,0 +1,38 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Different install and working directories for a regular update failure */
const STATE_AFTER_RUNUPDATE =
IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_ERROR
: STATE_FAILED_INVALID_APPLYTO_DIR_ERROR;
function run_test() {
if (!setupTestCommon()) {
return;
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setTestFilesAndDirsForFailure();
setupUpdaterTest(FILE_COMPLETE_MAR, false);
}
/**
* Called after the call to setupUpdaterTest finishes.
*/
function setupUpdaterTestFinished() {
let path = getApplyDirFile("..", false).path;
runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, path, null);
}
/**
* Called after the call to runUpdateUsingUpdater finishes.
*/
function runUpdateFinished() {
standardInit();
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();
}

Просмотреть файл

@ -0,0 +1,37 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Patch directory path must end with \updates\0 failure test */
const STATE_AFTER_RUNUPDATE =
IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
function run_test() {
if (!setupTestCommon()) {
return;
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setTestFilesAndDirsForFailure();
setupUpdaterTest(FILE_COMPLETE_MAR, false);
}
/**
* Called after the call to setupUpdaterTest finishes.
*/
function setupUpdaterTestFinished() {
let path = getUpdatesPatchDir().parent.path;
runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, path, null, null, null);
}
/**
* Called after the call to runUpdateUsingUpdater finishes.
*/
function runUpdateFinished() {
standardInit();
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();
}

Просмотреть файл

@ -0,0 +1,43 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Patch directory path traversal failure test */
const STATE_AFTER_RUNUPDATE =
IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
function run_test() {
if (!setupTestCommon()) {
return;
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setTestFilesAndDirsForFailure();
setupUpdaterTest(FILE_COMPLETE_MAR, false);
}
/**
* Called after the call to setupUpdaterTest finishes.
*/
function setupUpdaterTestFinished() {
let path = getUpdatesPatchDir();
if (IS_WIN) {
path = path + "\\..\\";
} else {
path = path + "/../";
}
runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, path, null, null, null);
}
/**
* Called after the call to runUpdateUsingUpdater finishes.
*/
function runUpdateFinished() {
standardInit();
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();
}

Просмотреть файл

@ -0,0 +1,38 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Different install and working directories for a regular update failure */
const STATE_AFTER_RUNUPDATE =
IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR
: STATE_FAILED_INVALID_APPLYTO_DIR_STAGED_ERROR;
function run_test() {
if (!setupTestCommon()) {
return;
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setTestFilesAndDirsForFailure();
setupUpdaterTest(FILE_COMPLETE_MAR, false);
}
/**
* Called after the call to setupUpdaterTest finishes.
*/
function setupUpdaterTestFinished() {
let path = getApplyDirFile("..", false).path;
runUpdate(STATE_AFTER_RUNUPDATE, true, 1, true, null, null, path, null);
}
/**
* Called after the call to runUpdateUsingUpdater finishes.
*/
function runUpdateFinished() {
standardInit();
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();
}

Просмотреть файл

@ -0,0 +1,38 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Working directory path local UNC failure test */
const STATE_AFTER_RUNUPDATE =
IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR
: STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR;
function run_test() {
if (!setupTestCommon()) {
return;
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setTestFilesAndDirsForFailure();
setupUpdaterTest(FILE_COMPLETE_MAR, false);
}
/**
* Called after the call to setupUpdaterTest finishes.
*/
function setupUpdaterTestFinished() {
let path = "\\\\.\\" + getApplyDirFile(null, false).path;
runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, path, null);
}
/**
* Called after the call to runUpdateUsingUpdater finishes.
*/
function runUpdateFinished() {
standardInit();
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();
}

Просмотреть файл

@ -0,0 +1,37 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Relative working directory path failure test */
const STATE_AFTER_RUNUPDATE =
IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR
: STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR;
function run_test() {
if (!setupTestCommon()) {
return;
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setTestFilesAndDirsForFailure();
setupUpdaterTest(FILE_COMPLETE_MAR, false);
}
/**
* Called after the call to setupUpdaterTest finishes.
*/
function setupUpdaterTestFinished() {
runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, "test", null);
}
/**
* Called after the call to runUpdateUsingUpdater finishes.
*/
function runUpdateFinished() {
standardInit();
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateFailure(getApplyDirFile);
waitForFilesInUse();
}

Просмотреть файл

@ -14,7 +14,10 @@ function run_test() {
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
setupUpdaterTest(FILE_COMPLETE_MAR, undefined);
// The third parameter will test that a full path to the post update binary
// doesn't execute.
setupUpdaterTest(FILE_COMPLETE_MAR, undefined,
getApplyDirFile(null, true).path + "/");
}
/**
@ -28,13 +31,6 @@ function setupUpdaterTestFinished() {
* Called after the call to runUpdateUsingApp finishes.
*/
function runUpdateFinished() {
checkPostUpdateAppLog();
}
/**
* Called after the call to checkPostUpdateAppLog finishes.
*/
function checkPostUpdateAppLogFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
@ -45,7 +41,7 @@ function checkPostUpdateAppLogFinished() {
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkPostUpdateRunningFile(true);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_COMPLETE_SUCCESS);

Просмотреть файл

@ -13,7 +13,6 @@ function run_test() {
}
gTestFiles = gTestFilesCompleteSuccess;
gTestDirs = gTestDirsCompleteSuccess;
createUpdaterINI(false);
setupUpdaterTest(FILE_COMPLETE_MAR, false);
}

Просмотреть файл

@ -18,7 +18,9 @@ function run_test() {
gTestFiles[gTestFiles.length - 2].comparePerms = 0o644;
gTestDirs = gTestDirsPartialSuccess;
setupDistributionDir();
setupUpdaterTest(FILE_PARTIAL_MAR, false);
// The third parameter will test that a relative path that contains a
// directory traversal to the post update binary doesn't execute.
setupUpdaterTest(FILE_PARTIAL_MAR, false, "test/../");
}
/**
@ -32,13 +34,6 @@ function setupUpdaterTestFinished() {
* Called after the call to runUpdate finishes.
*/
function runUpdateFinished() {
checkPostUpdateAppLog();
}
/**
* Called after the call to checkPostUpdateAppLog finishes.
*/
function checkPostUpdateAppLogFinished() {
checkAppBundleModTime();
standardInit();
Assert.equal(readStatusState(), STATE_NONE,
@ -49,7 +44,7 @@ function checkPostUpdateAppLogFinished() {
"the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
"the update state" + MSG_SHOULD_EQUAL);
checkPostUpdateRunningFile(true);
checkPostUpdateRunningFile(false);
checkFilesAfterUpdateSuccess(getApplyDirFile);
checkUpdateLogContents(LOG_PARTIAL_SUCCESS);
checkDistributionDir();

Просмотреть файл

@ -10,6 +10,22 @@ head = head_update.js
[bootstrapSvc.js]
run-sequentially = Uses the Mozilla Maintenance Service.
[invalidArgInstallDirPathTooLongFailureSvc.js]
run-sequentially = Uses the Mozilla Maintenance Service.
[invalidArgInstallDirPathTraversalFailureSvc.js]
run-sequentially = Uses the Mozilla Maintenance Service.
[invalidArgInstallWorkingDirPathNotSameFailureSvc_win.js]
run-sequentially = Uses the Mozilla Maintenance Service.
[invalidArgPatchDirPathSuffixFailureSvc.js]
run-sequentially = Uses the Mozilla Maintenance Service.
[invalidArgPatchDirPathTraversalFailureSvc.js]
run-sequentially = Uses the Mozilla Maintenance Service.
[invalidArgStageDirNotInInstallDirFailureSvc_win.js]
run-sequentially = Uses the Mozilla Maintenance Service.
[invalidArgWorkingDirPathLocalUNCFailureSvc_win.js]
run-sequentially = Uses the Mozilla Maintenance Service.
[invalidArgWorkingDirPathRelativeFailureSvc.js]
run-sequentially = Uses the Mozilla Maintenance Service.
[marSuccessCompleteSvc.js]
run-sequentially = Uses the Mozilla Maintenance Service.
[marSuccessPartialSvc.js]

Просмотреть файл

@ -79,6 +79,13 @@ LaunchMacPostProcess(const char* aAppBundle)
return;
}
// The path must not traverse directories and it must be a relative path.
if ([exeRelPath rangeOfString:@".."].location != NSNotFound ||
[exeRelPath rangeOfString:@"./"].location != NSNotFound ||
[exeRelPath rangeOfString:@"/"].location == 0) {
return;
}
NSString* exeFullPath = [NSString stringWithUTF8String:aAppBundle];
exeFullPath = [exeFullPath stringByAppendingPathComponent:exeRelPath];

Просмотреть файл

@ -52,7 +52,7 @@
#include <errno.h>
#include <algorithm>
#include "updatelogging.h"
#include "updatecommon.h"
#ifdef XP_MACOSX
#include "updaterfileutils_osx.h"
#endif // XP_MACOSX
@ -281,7 +281,7 @@ private:
//-----------------------------------------------------------------------------
static NS_tchar* gPatchDirPath;
static NS_tchar gPatchDirPath[MAXPATHLEN];
static NS_tchar gInstallDirPath[MAXPATHLEN];
static NS_tchar gWorkingDirPath[MAXPATHLEN];
static ArchiveReader gArchiveReader;
@ -1972,8 +1972,20 @@ LaunchWinPostProcess(const WCHAR *installationDir,
return false;
}
// Verify that exeFile doesn't contain relative paths
if (wcsstr(exefile, L"..") != nullptr) {
// The relative path must not contain directory traversals, current directory,
// or colons.
if (wcsstr(exefile, L"..") != nullptr ||
wcsstr(exefile, L"./") != nullptr ||
wcsstr(exefile, L".\\") != nullptr ||
wcsstr(exefile, L":") != nullptr) {
return false;
}
// The relative path must not start with a decimal point, backslash, or
// forward slash.
if (exefile[0] == L'.' ||
exefile[0] == L'\\' ||
exefile[0] == L'/') {
return false;
}
@ -1983,6 +1995,10 @@ LaunchWinPostProcess(const WCHAR *installationDir,
return false;
}
if (!IsValidFullPath(exefullpath)) {
return false;
}
#if !defined(TEST_UPDATER) && defined(MOZ_MAINTENANCE_SERVICE)
if (sUsingService &&
!DoesBinaryMatchAllowedCertificates(installationDir, exefullpath)) {
@ -2089,7 +2105,9 @@ WriteStatusFile(const char* aStatus)
#if defined(XP_WIN)
// The temp file is not removed on failure since there is client code that
// will remove it.
GetTempFileNameW(gPatchDirPath, L"sta", 0, filename);
if (GetTempFileNameW(gPatchDirPath, L"sta", 0, filename) == 0) {
return false;
}
#else
NS_tsnprintf(filename, sizeof(filename)/sizeof(filename[0]),
NS_T("%s/update.status"), gPatchDirPath);
@ -2720,9 +2738,38 @@ int NS_main(int argc, NS_tchar **argv)
return 1;
}
// This check is also performed in workmonitor.cpp since the maintenance
// service can be called directly.
if (!IsValidFullPath(argv[1])) {
// Since the status file is written to the patch directory and the patch
// directory is invalid don't write the status file.
fprintf(stderr, "The patch directory path is not valid for this " \
"application (" LOG_S ")\n", argv[1]);
#ifdef XP_MACOSX
if (isElevated) {
freeArguments(argc, argv);
CleanupElevatedMacUpdate(true);
}
#endif
return 1;
}
// The directory containing the update information.
gPatchDirPath = argv[1];
NS_tstrncpy(gPatchDirPath, argv[1], MAXPATHLEN);
// This check is also performed in workmonitor.cpp since the maintenance
// service can be called directly.
if (!IsValidFullPath(argv[2])) {
WriteStatusFile(INVALID_INSTALL_DIR_PATH_ERROR);
fprintf(stderr, "The install directory path is not valid for this " \
"application (" LOG_S ")\n", argv[2]);
#ifdef XP_MACOSX
if (isElevated) {
freeArguments(argc, argv);
CleanupElevatedMacUpdate(true);
}
#endif
return 1;
}
// The directory we're going to update to.
// We copy this string because we need to remove trailing slashes. The C++
// standard says that it's always safe to write to strings pointed to by argv
@ -2795,6 +2842,20 @@ int NS_main(int argc, NS_tchar **argv)
}
}
// This check is also performed in workmonitor.cpp since the maintenance
// service can be called directly.
if (!IsValidFullPath(argv[3])) {
WriteStatusFile(INVALID_WORKING_DIR_PATH_ERROR);
fprintf(stderr, "The working directory path is not valid for this " \
"application (" LOG_S ")\n", argv[3]);
#ifdef XP_MACOSX
if (isElevated) {
freeArguments(argc, argv);
CleanupElevatedMacUpdate(true);
}
#endif
return 1;
}
// The directory we're going to update to.
// We copy this string because we need to remove trailing slashes. The C++
// standard says that it's always safe to write to strings pointed to by argv
@ -2806,6 +2867,37 @@ int NS_main(int argc, NS_tchar **argv)
*slash = NS_T('\0');
}
if (argc > callbackIndex) {
if (!IsValidFullPath(argv[callbackIndex])) {
WriteStatusFile(INVALID_CALLBACK_PATH_ERROR);
fprintf(stderr, "The callback file path is not valid for this " \
"application (" LOG_S ")\n", argv[callbackIndex]);
#ifdef XP_MACOSX
if (isElevated) {
freeArguments(argc, argv);
CleanupElevatedMacUpdate(true);
}
#endif
return 1;
}
size_t len = NS_tstrlen(gInstallDirPath);
NS_tchar callbackInstallDir[MAXPATHLEN] = { NS_T('\0') };
NS_tstrncpy(callbackInstallDir, argv[callbackIndex], len);
if (NS_tstrcmp(gInstallDirPath, callbackInstallDir) != 0) {
WriteStatusFile(INVALID_CALLBACK_DIR_ERROR);
fprintf(stderr, "The callback file must be located in the " \
"installation directory (" LOG_S ")\n", argv[callbackIndex]);
#ifdef XP_MACOSX
if (isElevated) {
freeArguments(argc, argv);
CleanupElevatedMacUpdate(true);
}
#endif
return 1;
}
}
#ifdef XP_MACOSX
if (!isElevated && !IsRecursivelyWritable(argv[2])) {
// If the app directory isn't recursively writeable, an elevated update is
@ -2851,6 +2943,8 @@ int NS_main(int argc, NS_tchar **argv)
LOG(("WORKING DIRECTORY " LOG_S, gWorkingDirPath));
#if defined(XP_WIN)
// These checks are also performed in workmonitor.cpp since the maintenance
// service can be called directly.
if (_wcsnicmp(gWorkingDirPath, gInstallDirPath, MAX_PATH) != 0) {
if (!sStagedUpdate && !sReplaceRequest) {
WriteStatusFile(INVALID_APPLYTO_DIR_ERROR);

Просмотреть файл

@ -798,6 +798,16 @@ ProcessUpdates(nsIFile *greDir, nsIFile *appDir, nsIFile *updRootDir,
return rv;
}
// Return early since there isn't a valid update when the update application
// version file doesn't exist or if the update's application version is less
// than the current application version. The cleanup of the update will happen
// during post update processing in nsUpdateService.js.
nsCOMPtr<nsIFile> versionFile;
if (!GetVersionFile(updatesDir, versionFile) ||
IsOlderVersion(versionFile, appVersion)) {
return NS_OK;
}
nsCOMPtr<nsIFile> statusFile;
UpdateStatus status = GetUpdateStatus(updatesDir, statusFile);
switch (status) {
@ -816,16 +826,7 @@ ProcessUpdates(nsIFile *greDir, nsIFile *appDir, nsIFile *updRootDir,
}
case ePendingUpdate:
case ePendingService: {
nsCOMPtr<nsIFile> versionFile;
// Remove the update if the update application version file doesn't exist
// or if the update's application version is less than the current
// application version.
if (!GetVersionFile(updatesDir, versionFile) ||
IsOlderVersion(versionFile, appVersion)) {
updatesDir->Remove(true);
} else {
ApplyUpdate(greDir, updatesDir, appDir, argc, argv, restart, false, pid);
}
ApplyUpdate(greDir, updatesDir, appDir, argc, argv, restart, false, pid);
break;
}
case eAppliedUpdate: