Skip to content

Commit

Permalink
Revert "Update unrar to 6.0.3"
Browse files Browse the repository at this point in the history
This reverts commit fb8f8c0.

Reason for revert:

Findit (https://goo.gl/kROfz5) identified CL at revision 846061 as the
culprit for failures in the build cycles as shown on:
https://analysis.chromium.org/waterfall/culprit?key=ag9zfmZpbmRpdC1mb3ItbWVyRAsSDVdmU3VzcGVjdGVkQ0wiMWNocm9taXVtL2ZiOGY4YzBkZDZkZjk1ZGRkZmFkNzkzMzhmODhlZjk5NGUwZTliMWEM

Sample Failed Build: https://ci.chromium.org/b/8857394482161435200

Sample Failed Step: browser_tests

Original change's description:
> Update unrar to 6.0.3
> 
> aawc/unrar#25 for the corresponding change on Github
> 
> BUG=1166496, 1166497, 1166498, 1166499, 1166500, 1166501, 1166502, 1166503
> 
> Change-Id: Idece6bd531d55f1b379d0a38fad5f74f64323749
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2634824
> Reviewed-by: Daniel Rubery <drubery@chromium.org>
> Commit-Queue: Varun Khaneja <vakh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#846061}


No-Presubmit: true
No-Tree-Checks: true
No-Try: true
BUG=1166496, 1166497, 1166498, 1166499, 1166500, 1166501, 1166502, 1166503

Change-Id: I7a45d79f9eb6f188fabbc99e3fd4ec3643c7fd93
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2643791
Cr-Commit-Position: refs/heads/master@{#846137}
  • Loading branch information
Findit committed Jan 22, 2021
1 parent af0ae89 commit 3a6ba08
Show file tree
Hide file tree
Showing 57 changed files with 362 additions and 1,382 deletions.
675 changes: 0 additions & 675 deletions third_party/unrar/patches/chromium_changes.v6.0.3.patch

This file was deleted.

2 changes: 1 addition & 1 deletion third_party/unrar/src/acknow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
* RAR uses CRC32 function based on Intel Slicing-by-8 algorithm.
Original Intel Slicing-by-8 code is available here:

https://sourceforge.net/projects/slicing-by-8/
http://sourceforge.net/projects/slicing-by-8/

Original Intel Slicing-by-8 code is licensed under BSD License
available at http://www.opensource.org/licenses/bsd-license.html
Expand Down
11 changes: 2 additions & 9 deletions third_party/unrar/src/arccmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,8 @@ bool Archive::GetComment(Array<wchar> *CmtData)
{
if (!MainComment)
return false;
int64 SavePos=Tell();
bool Success=DoGetComment(CmtData);
Seek(SavePos,SEEK_SET);
return Success;
}

SaveFilePos SavePos(*this);

bool Archive::DoGetComment(Array<wchar> *CmtData)
{
#ifndef SFX_MODULE
uint CmtLength;
if (Format==RARFMT14)
Expand Down Expand Up @@ -143,7 +136,7 @@ bool Archive::DoGetComment(Array<wchar> *CmtData)
bool Archive::ReadCommentData(Array<wchar> *CmtData)
{
Array<byte> CmtRaw;
if (!ReadSubData(&CmtRaw,NULL,false))
if (!ReadSubData(&CmtRaw,NULL))
return false;
size_t CmtSize=CmtRaw.Size();
CmtRaw.Push(0);
Expand Down
7 changes: 3 additions & 4 deletions third_party/unrar/src/archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ bool Archive::IsArchive(bool EnableBroken)
break;
}


// We should not do it for EnableBroken or we'll get 'not RAR archive'
// This check allows to make RS based recovery even if password is incorrect.
// But we should not do it for EnableBroken or we'll get 'not RAR archive'
// messages when extracting encrypted archives with wrong password.
if (FailedHeaderDecryption && !EnableBroken)
return false;
Expand All @@ -233,7 +233,7 @@ bool Archive::IsArchive(bool EnableBroken)
// immediately after IsArchive call.
if (HeadersLeft && (!SilentOpen || !Encrypted))
{
int64 SavePos=Tell();
SaveFilePos SavePos(*this);
int64 SaveCurBlockPos=CurBlockPos,SaveNextBlockPos=NextBlockPos;
HEADER_TYPE SaveCurHeaderType=CurHeaderType;

Expand Down Expand Up @@ -262,7 +262,6 @@ bool Archive::IsArchive(bool EnableBroken)
CurBlockPos=SaveCurBlockPos;
NextBlockPos=SaveNextBlockPos;
CurHeaderType=SaveCurHeaderType;
Seek(SavePos,SEEK_SET);
}
if (!Volume || FirstVolume)
wcsncpyz(FirstVolumeName,FileName,ASIZE(FirstVolumeName));
Expand Down
6 changes: 4 additions & 2 deletions third_party/unrar/src/archive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Archive:public File
void UpdateLatestTime(FileHeader *CurBlock);
void ConvertNameCase(wchar *Name);
void ConvertFileHeader(FileHeader *hd);
void WriteBlock50(HEADER_TYPE HeaderType,BaseBlock *wb,bool OnlySetSize,bool NonFinalWrite);
size_t ReadHeader14();
size_t ReadHeader15();
size_t ReadHeader50();
Expand All @@ -37,7 +38,6 @@ class Archive:public File
void UnexpEndArcMsg();
void BrokenHeaderMsg();
void UnkEncVerMsg(const wchar *Name,const wchar *Info);
bool DoGetComment(Array<wchar> *CmtData);
bool ReadCommentData(Array<wchar> *CmtData);

#if !defined(RAR_NOCRYPT)
Expand Down Expand Up @@ -72,6 +72,8 @@ class Archive:public File
size_t SearchBlock(HEADER_TYPE HeaderType);
size_t SearchSubBlock(const wchar *Type);
size_t SearchRR();
void WriteBlock(HEADER_TYPE HeaderType,BaseBlock *wb=NULL,bool OnlySetSize=false,bool NonFinalWrite=false);
void SetBlockSize(HEADER_TYPE HeaderType,BaseBlock *wb=NULL) {WriteBlock(HeaderType,wb,true);}
size_t ReadHeader();
void CheckArc(bool EnableBroken);
void CheckOpen(const wchar *Name);
Expand All @@ -88,7 +90,7 @@ class Archive:public File
int64 GetStartPos();
void AddSubData(byte *SrcData,uint64 DataSize,File *SrcFile,
const wchar *Name,uint Flags);
bool ReadSubData(Array<byte> *UnpData,File *DestFile,bool TestMode);
bool ReadSubData(Array<byte> *UnpData,File *DestFile);
HEADER_TYPE GetHeaderType() {return CurHeaderType;}
RAROptions* GetRAROptions() {return Cmd;}
void SetSilentOpen(bool Mode) {SilentOpen=Mode;}
Expand Down
29 changes: 13 additions & 16 deletions third_party/unrar/src/arcread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,14 @@ size_t Archive::ReadHeader15()
uint FileTime=Raw.Get4();
hd->UnpVer=Raw.Get1();

hd->Method=Raw.Get1()-0x30;
size_t NameSize=Raw.Get2();
hd->FileAttr=Raw.Get4();

// RAR15 did not use the special dictionary size to mark dirs.
if (hd->UnpVer<20 && (hd->FileAttr & 0x10)!=0)
hd->Dir=true;

hd->Method=Raw.Get1()-0x30;
size_t NameSize=Raw.Get2();
hd->FileAttr=Raw.Get4();

hd->CryptMethod=CRYPT_NONE;
if (hd->Encrypted)
switch(hd->UnpVer)
Expand Down Expand Up @@ -403,8 +403,8 @@ size_t Archive::ReadHeader15()
if (rmode & 4)
rlt.Second++;
rlt.Reminder=0;
uint count=rmode&3;
for (uint J=0;J<count;J++)
int count=rmode&3;
for (int J=0;J<count;J++)
{
byte CurByte=Raw.Get1();
rlt.Reminder|=(((uint)CurByte)<<((J+3-count)*8));
Expand Down Expand Up @@ -522,6 +522,7 @@ size_t Archive::ReadHeader15()
{
// Last 7 bytes of recovered volume can contain zeroes, because
// REV files store its own information (volume number, etc.) here.
SaveFilePos SavePos(*this);
int64 Length=Tell();
Seek(Length-7,SEEK_SET);
Recovered=true;
Expand Down Expand Up @@ -584,7 +585,7 @@ size_t Archive::ReadHeader50()
{
// This message is used by Android GUI to reset cached passwords.
// Update appropriate code if changed.
uiMsg(UIERROR_BADPSW,FileName,FileName);
uiMsg(UIERROR_BADPSW,FileName);
FailedHeaderDecryption=true;
ErrHandler.SetErrorCode(RARX_BADPWD);
return 0;
Expand All @@ -593,7 +594,7 @@ size_t Archive::ReadHeader50()
{
// This message is used by Android GUI and Windows GUI and SFX to
// reset cached passwords. Update appropriate code if changed.
uiMsg(UIWAIT_BADPSW,FileName,FileName);
uiMsg(UIWAIT_BADPSW,FileName);
Cmd->Password.Clean();
}

Expand Down Expand Up @@ -720,7 +721,6 @@ size_t Archive::ReadHeader50()
UnkEncVerMsg(FileName,Info);
return 0;
}

Raw.GetB(CryptHead.Salt,SIZE_SALT50);
if (CryptHead.UsePswCheck)
{
Expand Down Expand Up @@ -786,7 +786,7 @@ size_t Archive::ReadHeader50()
case HEAD_SERVICE:
{
FileHeader *hd=ShortBlock.HeaderType==HEAD_FILE ? &FileHead:&SubHead;
hd->Reset(); // Clear hash, time fields and other stuff like flags.
hd->Reset();
*(BaseBlock *)hd=ShortBlock;

bool FileBlock=ShortBlock.HeaderType==HEAD_FILE;
Expand Down Expand Up @@ -1257,13 +1257,11 @@ size_t Archive::ReadHeader14()
Raw.Read(NameSize);

char FileName[NM];
size_t ReadNameSize=Min(NameSize,ASIZE(FileName)-1);
Raw.GetB((byte *)FileName,ReadNameSize);
FileName[ReadNameSize]=0;
Raw.GetB((byte *)FileName,Min(NameSize,ASIZE(FileName)));
FileName[NameSize]=0;
IntToExt(FileName,FileName,ASIZE(FileName));
CharToWide(FileName,FileHead.FileName,ASIZE(FileHead.FileName));
ConvertNameCase(FileHead.FileName);
ConvertFileHeader(&FileHead);

if (Raw.Size()!=0)
NextBlockPos=CurBlockPos+FileHead.HeadSize+FileHead.PackSize;
Expand Down Expand Up @@ -1417,7 +1415,7 @@ int64 Archive::GetStartPos()
}


bool Archive::ReadSubData(Array<byte> *UnpData,File *DestFile,bool TestMode)
bool Archive::ReadSubData(Array<byte> *UnpData,File *DestFile)
{
if (BrokenHeader)
{
Expand Down Expand Up @@ -1465,7 +1463,6 @@ bool Archive::ReadSubData(Array<byte> *UnpData,File *DestFile,bool TestMode)
SubDataIO.SetPackedSizeToRead(SubHead.PackSize);
SubDataIO.EnableShowProgress(false);
SubDataIO.SetFiles(this,DestFile);
SubDataIO.SetTestMode(TestMode);
SubDataIO.UnpVolume=SubHead.SplitAfter;
SubDataIO.SetSubHeader(&SubHead,NULL);
Unpack.SetDestSize(SubHead.UnpSize);
Expand Down
1 change: 0 additions & 1 deletion third_party/unrar/src/blake2s.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#define _RAR_BLAKE2_

#define BLAKE2_DIGEST_SIZE 32
#define BLAKE2_THREADS_NUMBER 8

enum blake2s_constant
{
Expand Down
Loading

0 comments on commit 3a6ba08

Please sign in to comment.