Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
ebeb76f0
Kaydet (Commit)
ebeb76f0
authored
Haz 16, 2017
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
updater: work on supporting language pack updates
Change-Id: I563aa8ee285d4c2ecdb45835b5cee38074295106
üst
fc26bbc0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
96 additions
and
86 deletions
+96
-86
updater.cxx
onlineupdate/source/update/updater/updater.cxx
+96
-86
No files found.
onlineupdate/source/update/updater/updater.cxx
Dosyayı görüntüle @
ebeb76f0
...
@@ -2553,133 +2553,143 @@ ReadMARChannelIDs(const NS_tchar *path, MARChannelStringTable *results)
...
@@ -2553,133 +2553,143 @@ ReadMARChannelIDs(const NS_tchar *path, MARChannelStringTable *results)
#endif
#endif
static
int
static
int
GetUpdateFileName
(
NS_tchar
*
fileName
,
int
maxChar
s
)
GetUpdateFileName
s
(
std
::
vector
<
tstring
>
fileName
s
)
{
{
NS_tchar
fileName
[
MAXPATHLEN
];
// TODO: moggi: needs adaption for LibreOffice
// TODO: moggi: needs adaption for LibreOffice
// We would like to store the name inside of an ini file
// We would like to store the name inside of an ini file
NS_tsnprintf
(
fileName
,
maxChars
,
NS_tsnprintf
(
fileName
,
MAXPATHLEN
,
NS_T
(
"%s/update.mar"
),
gPatchDirPath
);
NS_T
(
"%s/update.mar"
),
gPatchDirPath
);
fileNames
.
push_back
(
fileName
);
// add the language packs
return
OK
;
return
OK
;
}
}
static
void
static
int
UpdateThreadFunc
(
void
*
/*param*/
)
CheckSignature
(
tstring
&
fileName
)
{
{
// open ZIP archive and process...
int
rv
=
gArchiveReader
.
Open
(
fileName
.
c_str
());
int
rv
;
if
(
sReplaceRequest
)
{
rv
=
ProcessReplaceRequest
();
}
else
{
NS_tchar
dataFile
[
MAXPATHLEN
];
rv
=
GetUpdateFileName
(
dataFile
,
sizeof
(
dataFile
)
/
sizeof
(
dataFile
[
0
]));
if
(
rv
==
OK
)
{
rv
=
gArchiveReader
.
Open
(
dataFile
);
}
#ifdef VERIFY_MAR_SIGNATURE
#ifdef VERIFY_MAR_SIGNATURE
if
(
rv
==
OK
)
if
(
rv
==
OK
)
{
{
#ifdef _WIN32
#ifdef _WIN32
HKEY
baseKey
=
nullptr
;
HKEY
baseKey
=
nullptr
;
wchar_t
valueName
[]
=
L"Image Path"
;
wchar_t
valueName
[]
=
L"Image Path"
;
wchar_t
rasenh
[]
=
L"rsaenh.dll"
;
wchar_t
rasenh
[]
=
L"rsaenh.dll"
;
bool
reset
=
false
;
bool
reset
=
false
;
if
(
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
if
(
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
L"SOFTWARE
\\
Microsoft
\\
Cryptography
\\
Defaults
\\
Provider
\\
Microsoft Enhanced Cryptographic Provider v1.0"
,
L"SOFTWARE
\\
Microsoft
\\
Cryptography
\\
Defaults
\\
Provider
\\
Microsoft Enhanced Cryptographic Provider v1.0"
,
0
,
KEY_READ
|
KEY_WRITE
,
0
,
KEY_READ
|
KEY_WRITE
,
&
baseKey
)
==
ERROR_SUCCESS
)
&
baseKey
)
==
ERROR_SUCCESS
)
{
wchar_t
path
[
MAX_PATH
+
1
];
DWORD
size
=
sizeof
(
path
);
DWORD
type
;
if
(
RegQueryValueExW
(
baseKey
,
valueName
,
0
,
&
type
,
(
LPBYTE
)
path
,
&
size
)
==
ERROR_SUCCESS
)
{
{
wchar_t
path
[
MAX_PATH
+
1
];
if
(
type
==
REG_SZ
&&
wcscmp
(
path
,
rasenh
)
==
0
)
DWORD
size
=
sizeof
(
path
);
DWORD
type
;
if
(
RegQueryValueExW
(
baseKey
,
valueName
,
0
,
&
type
,
(
LPBYTE
)
path
,
&
size
)
==
ERROR_SUCCESS
)
{
{
if
(
type
==
REG_SZ
&&
wcscmp
(
path
,
rasenh
)
==
0
)
wchar_t
rasenhFullPath
[]
=
L"%SystemRoot%
\\
System32
\\
rsaenh.dll"
;
if
(
RegSetValueExW
(
baseKey
,
valueName
,
0
,
REG_SZ
,
(
const
BYTE
*
)
rasenhFullPath
,
sizeof
(
rasenhFullPath
))
==
ERROR_SUCCESS
)
{
{
wchar_t
rasenhFullPath
[]
=
L"%SystemRoot%
\\
System32
\\
rsaenh.dll"
;
reset
=
true
;
if
(
RegSetValueExW
(
baseKey
,
valueName
,
0
,
REG_SZ
,
(
const
BYTE
*
)
rasenhFullPath
,
sizeof
(
rasenhFullPath
))
==
ERROR_SUCCESS
)
{
reset
=
true
;
}
}
}
}
}
}
}
}
#endif
#endif
rv
=
gArchiveReader
.
VerifySignature
();
rv
=
gArchiveReader
.
VerifySignature
();
#ifdef _WIN32
#ifdef _WIN32
if
(
baseKey
)
if
(
baseKey
)
{
if
(
reset
)
{
{
if
(
reset
)
RegSetValueExW
(
baseKey
,
valueName
,
0
,
REG_SZ
,
{
(
const
BYTE
*
)
rasenh
,
RegSetValueExW
(
baseKey
,
valueName
,
0
,
REG_SZ
,
sizeof
(
rasenh
));
(
const
BYTE
*
)
rasenh
,
sizeof
(
rasenh
));
}
RegCloseKey
(
baseKey
);
}
}
#endif
RegCloseKey
(
baseKey
);
}
}
#endif
}
if
(
rv
==
OK
)
{
if
(
rv
==
OK
)
if
(
rv
==
OK
)
{
{
if
(
rv
==
OK
)
NS_tchar
updateSettingsPath
[
MAX_TEXT_LEN
];
{
NS_tchar
updateSettingsPath
[
MAX_TEXT_LEN
];
// TODO: moggi: needs adaption for LibreOffice
// TODO: moggi: needs adaption for LibreOffice
// These paths need to be adapted for us.
// These paths need to be adapted for us.
NS_tsnprintf
(
updateSettingsPath
,
NS_tsnprintf
(
updateSettingsPath
,
sizeof
(
updateSettingsPath
)
/
sizeof
(
updateSettingsPath
[
0
]),
sizeof
(
updateSettingsPath
)
/
sizeof
(
updateSettingsPath
[
0
]),
#ifdef MACOSX
#ifdef MACOSX
NS_T
(
"%s/Contents/Resources/update-settings.ini"
),
NS_T
(
"%s/Contents/Resources/update-settings.ini"
),
#else
#else
NS_T
(
"%s/update-settings.ini"
),
NS_T
(
"%s/update-settings.ini"
),
#endif
#endif
gWorkingDirPath
);
gWorkingDirPath
);
MARChannelStringTable
MARStrings
;
MARChannelStringTable
MARStrings
;
if
(
ReadMARChannelIDs
(
updateSettingsPath
,
&
MARStrings
)
!=
OK
)
if
(
ReadMARChannelIDs
(
updateSettingsPath
,
&
MARStrings
)
!=
OK
)
{
{
// If we can't read from update-settings.ini then we shouldn't impose
// If we can't read from update-settings.ini then we shouldn't impose
// a MAR restriction. Some installations won't even include this file.
// a MAR restriction. Some installations won't even include this file.
MARStrings
.
MARChannelID
[
0
]
=
'\0'
;
MARStrings
.
MARChannelID
[
0
]
=
'\0'
;
}
rv
=
gArchiveReader
.
VerifyProductInformation
(
MARStrings
.
MARChannelID
,
LIBO_VERSION_DOTTED
);
}
}
rv
=
gArchiveReader
.
VerifyProductInformation
(
MARStrings
.
MARChannelID
,
LIBO_VERSION_DOTTED
);
}
}
}
#endif
#endif
if
(
rv
==
OK
&&
sStagedUpdate
)
gArchiveReader
.
Close
();
return
rv
;
}
static
void
UpdateThreadFunc
(
void
*
/*param*/
)
{
// open ZIP archive and process...
int
rv
;
if
(
sReplaceRequest
)
{
rv
=
ProcessReplaceRequest
();
}
else
{
std
::
vector
<
tstring
>
fileNames
;
GetUpdateFileNames
(
fileNames
);
for
(
auto
&
fileName
:
fileNames
)
{
{
#ifdef TEST_UPDATER
rv
=
CheckSignature
(
fileName
);
// The MOZ_TEST_SKIP_UPDATE_STAGE environment variable prevents copying
if
(
rv
!=
OK
)
// the files in dist/bin in the test updater when staging an update since
// this can cause tests to timeout.
if
(
EnvHasValue
(
"MOZ_TEST_SKIP_UPDATE_STAGE"
))
{
{
rv
=
OK
;
LOG
((
"Could not verify the signature of "
LOG_S
,
fileName
.
c_str
()));
}
break
;
else
{
rv
=
CopyInstallDirToDestDir
();
}
}
#else
}
if
(
rv
==
OK
&&
sStagedUpdate
)
{
rv
=
CopyInstallDirToDestDir
();
rv
=
CopyInstallDirToDestDir
();
#endif
}
}
if
(
rv
==
OK
)
if
(
rv
==
OK
)
{
{
rv
=
DoUpdate
();
for
(
auto
&
fileName
:
fileNames
)
gArchiveReader
.
Close
();
{
gArchiveReader
.
Open
(
fileName
.
c_str
());
rv
=
DoUpdate
();
gArchiveReader
.
Close
();
}
NS_tchar
updatingDir
[
MAXPATHLEN
];
NS_tchar
updatingDir
[
MAXPATHLEN
];
NS_tsnprintf
(
updatingDir
,
sizeof
(
updatingDir
)
/
sizeof
(
updatingDir
[
0
]),
NS_tsnprintf
(
updatingDir
,
sizeof
(
updatingDir
)
/
sizeof
(
updatingDir
[
0
]),
NS_T
(
"%s/updating"
),
gWorkingDirPath
);
NS_T
(
"%s/updating"
),
gWorkingDirPath
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment