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
9e30e901
Kaydet (Commit)
9e30e901
authored
Mar 16, 2012
tarafından
Herbert Dürr
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#i119048# handle edge cases when importing BDB hash files
üst
147efd6c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
33 deletions
+50
-33
dp_persmap.cxx
desktop/source/deployment/dp_persmap.cxx
+50
-33
No files found.
desktop/source/deployment/dp_persmap.cxx
Dosyayı görüntüle @
9e30e901
...
...
@@ -372,45 +372,62 @@ bool PersistentMap::importFromBDB()
nOfs
+=
nBytesRead
;
}
// check BDB file header for non_encrypted Hash
_v9 format
if
(
nFileSize
<
0x
10
00
)
// check BDB file header for non_encrypted Hash
format v4..9
if
(
nFileSize
<
0x
01
00
)
return
false
;
if
(
(
aRawBDB
[
12
]
!=
0x61
||
aRawBDB
[
13
]
!=
0x15
||
aRawBDB
[
14
]
!=
0x06
)
&&
(
aRawBDB
[
15
]
!=
0x61
||
aRawBDB
[
14
]
!=
0x15
||
aRawBDB
[
13
]
!=
0x06
))
if
(
aRawBDB
[
24
]
!=
0
)
// only not-encrypted migration
return
false
;
if
(
aRawBDB
[
16
]
!=
0x09
)
if
(
aRawBDB
[
25
]
!=
8
)
// we expect a P_HASHMETA page
return
false
;
const
bool
bLE
=
(
aRawBDB
[
12
]
==
0x61
&&
aRawBDB
[
13
]
==
0x15
&&
aRawBDB
[
14
]
==
0x06
);
const
bool
bBE
=
(
aRawBDB
[
15
]
==
0x61
&&
aRawBDB
[
14
]
==
0x15
&&
aRawBDB
[
13
]
==
0x06
);
if
(
bBE
==
bLE
)
return
false
;
if
(
(
aRawBDB
[
16
]
<
4
)
||
(
9
<
aRawBDB
[
16
]))
// version
return
false
;
const
sal_uInt64
nPgSize
=
bLE
?
(
aRawBDB
[
20
]
+
(
aRawBDB
[
21
]
<<
8
)
+
(
aRawBDB
[
22
]
<<
16
)
+
(
aRawBDB
[
23
]
<<
24
))
:
(
aRawBDB
[
23
]
+
(
aRawBDB
[
22
]
<<
8
)
+
(
aRawBDB
[
21
]
<<
16
)
+
(
aRawBDB
[
20
]
<<
24
));
const
int
nPgCount
=
nFileSize
/
nPgSize
;
if
(
nPgCount
*
nPgSize
!=
nFileSize
)
return
false
;
// find PackageManagers new_style entries
// using a simple heuristic for BDB_Hash
_v9 fil
es
// find PackageManager
'
s new_style entries
// using a simple heuristic for BDB_Hash
pag
es
int
nEntryCount
=
0
;
const
sal_uInt8
*
pBeg
=
&
aRawBDB
[
0
]
+
0x1000
;
const
sal_uInt8
*
pEnd
=
pBeg
+
nFileSize
;
for
(
const
sal_uInt8
*
pCur
=
pBeg
;
pCur
<
pEnd
;
++
pCur
)
{
if
(
pCur
[
0
]
!=
0x01
)
continue
;
// get the value-candidate
const
sal_uInt8
*
pVal
=
pCur
+
1
;
while
(
++
pCur
<
pEnd
)
if
(
(
*
pCur
<
' '
)
||
((
*
pCur
>
0x7F
)
&&
(
*
pCur
!=
0xFF
)))
for
(
int
nPgNo
=
1
;
nPgNo
<
nPgCount
;
++
nPgNo
)
{
// parse the next _db_page
const
sal_uInt8
*
const
pPage
=
&
aRawBDB
[
nPgNo
*
nPgSize
];
const
sal_uInt8
*
const
pEnd
=
pPage
+
nPgSize
;
const
int
nHfOffset
=
bLE
?
(
pPage
[
22
]
+
(
pPage
[
23
]
<<
8
))
:
(
pPage
[
23
]
+
(
pPage
[
22
]
<<
8
));
const
sal_uInt8
*
pCur
=
pPage
+
nHfOffset
;
// iterate through the entries
for
(;
pCur
<
pEnd
;
++
pCur
)
{
if
(
pCur
[
0
]
!=
0x01
)
continue
;
// get the value-candidate
const
sal_uInt8
*
pVal
=
pCur
+
1
;
while
(
++
pCur
<
pEnd
)
if
(
(
*
pCur
<
' '
)
||
((
*
pCur
>
0x7F
)
&&
(
*
pCur
!=
0xFF
)))
break
;
if
(
pCur
>=
pEnd
)
break
;
if
(
pCur
>=
pEnd
)
break
;
if
(
(
pCur
[
0
]
!=
0x01
)
||
(
pCur
[
1
]
!=
0xFF
))
continue
;
const
OString
aVal
(
(
sal_Char
*
)
pVal
,
pCur
-
pVal
);
// get the key-candidate
const
sal_uInt8
*
pKey
=
pCur
+
1
;
while
(
++
pCur
<
pEnd
)
if
(
(
*
pCur
<
' '
)
||
((
*
pCur
>
0x7F
)
&&
(
*
pCur
!=
0xFF
)))
break
;
if
(
(
pCur
<
pEnd
)
&&
(
*
pCur
>
0x01
))
continue
;
const
OString
aKey
(
(
sal_Char
*
)
pKey
,
pCur
-
pKey
);
// add the key/value pair
add
(
aKey
,
aVal
);
++
nEntryCount
;
if
(
(
pCur
[
0
]
!=
0x01
)
||
(
pCur
[
1
]
!=
0xFF
))
continue
;
const
OString
aVal
(
(
sal_Char
*
)
pVal
,
pCur
-
pVal
);
// get the key-candidate
const
sal_uInt8
*
pKey
=
pCur
+
1
;
while
(
++
pCur
<
pEnd
)
if
(
(
*
pCur
<
' '
)
||
((
*
pCur
>
0x7F
)
&&
(
*
pCur
!=
0xFF
)))
break
;
if
(
(
pCur
<
pEnd
)
&&
(
*
pCur
>
0x01
))
continue
;
const
OString
aKey
(
(
sal_Char
*
)
pKey
,
pCur
-
pKey
);
// add the key/value pair
add
(
aKey
,
aVal
);
++
nEntryCount
;
}
}
return
(
nEntryCount
>
0
);
...
...
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